Skip to content

Commit

Permalink
[Gradle Release Plugin] - pre tag commit: 'v0.6.1'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Texter committed Apr 6, 2017
1 parent f11ba26 commit b6335d5
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 24 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
v0.6.1 - TBD
------------
v0.6.1 - 4/5/2017
-------------------
### Changed
- AuthUtils now omits unrecognized scopes from parsed AccessToken instead of throwing an exception when creating

v0.6.0 - 2/14/2017
-------------------
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To use the Uber Rides Android SDK, add the compile dependency with the latest ve
Add the Uber Rides Android SDK to your `build.gradle`:
```gradle
dependencies {
compile 'com.uber.sdk:rides-android:0.6.0'
compile 'com.uber.sdk:rides-android:0.6.1'
}
```

Expand All @@ -31,7 +31,7 @@ In the `pom.xml` file:
<dependency>
<groupId>com.uber.sdk</groupId>
<artifactId>rides-android</artifactId>
<version>0.6.0</version>
<version>0.6.1</version>
</dependency>
```

Expand Down Expand Up @@ -319,7 +319,7 @@ service.getUserProfile().enqueue(new Callback<UserProfile>() {

## Sample Apps

Sample apps can be found in the `samples` folder. Alternatively, you can also download a sample from the [releases page](https://github.com/uber/rides-android-sdk/releases/tag/v0.6.0).
Sample apps can be found in the `samples` folder. Alternatively, you can also download a sample from the [releases page](https://github.com/uber/rides-android-sdk/releases/tag/v0.6.1).

The Sample apps require configuration parameters to interact with the Uber API, these include the client id, redirect uri, and server token. They are provided on the [Uber developer dashboard](https://developer.uber.com/dashboard).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ static Collection<Scope> stringToScopeCollection(@NonNull String scopesString) t

String[] scopeStrings = scopesString.split(" ");
for (String scopeName : scopeStrings) {
scopeCollection.add(Scope.valueOf(scopeName.toUpperCase()));
try {
scopeCollection.add(Scope.valueOf(scopeName.toUpperCase()));
} catch (IllegalArgumentException e) {
// do nothing, will omit custom or bad scopes
}
}

return scopeCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class LoginManager {

static final int REQUEST_CODE_LOGIN_DEFAULT = 1001;

private static final String USER_AGENT = "core-android-v0.6.0-login_manager";
private static final String USER_AGENT = "core-android-v0.6.1-login_manager";

private final AccessTokenManager accessTokenManager;
private final LoginCallback callback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ public void stringToScopeCollection_whenEmptyScopeString_shouldReturnEmptyScopeC
assertEquals(scopes.size(), 0);
}

@Test
public void stringToScopeCollection_whenUnknownScopeInString_shouldReturnOnlyKnownScopes() {
String scopeString = "profile custom";
List<Scope> scopes = new ArrayList<>();
scopes.addAll(AuthUtils.stringToScopeCollection(scopeString));

assertEquals(scopes.size(), 1);
assertTrue(scopes.contains(Scope.PROFILE));
}

@Test
public void scopeCollectionToString_withMultipleScopes_shouldReturnSpaceDelimitedStringScopes() {
List<Scope> scopes = new ArrayList<Scope>();
Expand Down Expand Up @@ -103,11 +113,6 @@ public void scopeCollectionToString_whenEmptyScopeCollection_shouldReturnEmptySt
assertTrue(result.isEmpty());
}

@Test(expected = IllegalArgumentException.class)
public void withBadScopeString_shouldThrowException() {
AuthUtils.stringToScopeCollection("blah");
}

@Test
public void generateAccessTokenFromUrl_whenNullFragment_shouldThrowInvalidResponseError() {
String redirectUri = "http://localhost:1234/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class LoginManagerTest extends RobolectricTestBase {
"uber://connect?client_id=Client1234&scope=profile%20request_receipt&sdk=android&sdk_version="
+ BuildConfig.VERSION_NAME;

private static final String INSTALL = "https://m.uber.com/sign-up?client_id=Client1234&user-agent=core-android-v0.6.0-login_manager";
private static final String INSTALL = "https://m.uber.com/sign-up?client_id=Client1234&user-agent=core-android-v0.6.1-login_manager";
private static final String AUTHORIZATION_CODE = "Auth123Code";

@Mock
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ group=com.uber.sdk
groupId=com.uber.sdk
artifactId=rides-android
githubDownloadPrefix=https://github.com/uber/rides-android-sdk/releases/download/
version=0.6.1-SNAPSHOT
version=0.6.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/
public class RequestDeeplink implements Deeplink {

private static final String USER_AGENT_DEEPLINK = "rides-android-v0.6.0-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.6.1-deeplink";

@NonNull
private final Uri uri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class RideRequestActivity extends Activity implements LoginCallback, Ride
static final int LOGIN_REQUEST_CODE = 1112;

private static final int REQUEST_FINE_LOCATION_PERMISSION_CODE = 1002;
private static final String USER_AGENT_RIDE_WIDGET = "rides-android-v0.6.0-ride_request_widget";
private static final String USER_AGENT_RIDE_WIDGET = "rides-android-v0.6.1-ride_request_widget";

@VisibleForTesting static final String RIDE_PARAMETERS = "ride_parameters";
static final String EXTRA_LOGIN_CONFIGURATION = "login_configuration";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class RideRequestButton extends FrameLayout implements RideRequestButtonV
@StyleRes
int[] STYLES = {R.style.UberButton, R.style.UberButton_White};

private static final String USER_AGENT_BUTTON = "rides-android-v0.6.0-button";
private static final String USER_AGENT_BUTTON = "rides-android-v0.6.1-button";

private RideRequestBehavior rideRequestBehavior;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*/
public class RideRequestView extends LinearLayout {

private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.6.0-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.6.1-ride_request_view";
@Nullable private AccessTokenSession accessTokenSession;
@NonNull @VisibleForTesting RideParameters rideParameters = new RideParameters.Builder().build();
@Nullable private RideRequestViewCallback rideRequestViewCallback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class RequestDeeplinkTest extends RobolectricTestBase {
private static final Double DROPOFF_LONG = -122.6789;
private static final String DROPOFF_NICK = "pickupNick";
private static final String DROPOFF_ADDR = "Dropoff Address";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.6.0-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.6.1-deeplink";

private Context context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ public void onLoad_whenNullUserAgent_shouldAddRideWidgetUserAgent() {
"refreshToken", "tokenType");
activity.onLoginSuccess(accessToken);

assertEquals("rides-android-v0.6.0-ride_request_widget",
assertEquals("rides-android-v0.6.1-ride_request_widget",
activity.rideRequestView.rideParameters.getUserAgent());
}

@Test
public void onLoad_withUserAgentInRideParametersButton_shouldNotGetOverridden() {
String userAgent = "rides-android-v0.6.0-button";
String userAgent = "rides-android-v0.6.1-button";
RideParameters rideParameters = new RideParameters.Builder().build();
rideParameters.setUserAgent(userAgent);
Intent data = RideRequestActivity.newIntent(Robolectric.setupActivity(Activity.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class RideRequestViewTest extends RobolectricTestBase {
private static final String DROPOFF_NICK = "pickupNick";
private static final String DROPOFF_ADDR = "Dropoff Address";
private static final String TOKEN_STRING = "thisIsAnAccessToken";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.6.0-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.6.1-ride_request_view";

private AccessToken accessToken;
private RideRequestView rideRequestView;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void onBuildUrl_withRideParams_shouldHaveRideParamsQueryParams() throws I

@Test
public void onBuildUrl_withUserAgentNonNull_shouldNotOverride() throws IOException {
String widgetUserAgent = "rides-android-v0.6.0-ride_request_widget";
String widgetUserAgent = "rides-android-v0.6.1-ride_request_widget";
String path = "src/test/resources/riderequestviewuris/default_uri";
String expectedUri = readUriResourceWithUserAgentParam(path, widgetUserAgent);

Expand Down

0 comments on commit b6335d5

Please sign in to comment.