Skip to content

Commit

Permalink
[Gradle Release Plugin] - pre tag commit: 'v0.5.3'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Texter committed Aug 12, 2016
1 parent 02f453f commit 7ca6d15
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 30 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
v0.5.3 - TBD
------------
v0.5.3 - 8/12/2016
------------------
### Fixed

- [Pull #42](https://github.com/uber/rides-android-sdk/pull/42) Fix Ride Request Button example in README
- [Issue #46](https://github.com/uber/rides-android-sdk/issues/46) Fix Ride Request Widget incorrectly displaying connectivity errors

v0.5.2 - 7/11/2016
------------------
Expand Down
18 changes: 9 additions & 9 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.5.2'
compile 'com.uber.sdk:rides-android:0.5.3'
}
```

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

Expand Down Expand Up @@ -128,7 +128,7 @@ RideParameters rideParams = new RideParameters.Builder()
.setDropoffLocation(37.795079, -122.4397805, "Embarcadero", "One Embarcadero Center, San Francisco") // Price estimate will only be provided if this is provided.
.setProductId("a1111c8c-c720-46c3-8534-2fcdd730040d") // Optional. If not provided, the cheapest product will be used.
.build();

SessionConfiguration config = new SessionConfiguration.Builder()
.setClientId("YOUR_CLIENT_ID")
.setServerToken("YOUR_SERVER_TOKEN")
Expand All @@ -139,7 +139,7 @@ RideRequestButtonCallback callback = new RideRequestButtonCallback() {

@Override
public void onRideInformationLoaded() {

}

@Override
Expand All @@ -154,7 +154,7 @@ RideRequestButtonCallback callback = new RideRequestButtonCallback() {
};

requestButton.setRideParameters(rideParams);
requestButton.setSession(session);
requestButton.setSession(session);
requestButton.setCallback(callback));
requestButton.loadRideInformation();
```
Expand Down Expand Up @@ -249,7 +249,7 @@ The `RideRequestView` is like any other view you'd add to your app. Create a new
RideRequestView rideRequestView = new RideRequestView(context);

//Optionally set Session, will use default session from UberSDK otherwise
//rideRequestView.setSession(session);
//rideRequestView.setSession(session);

rideRequestView.setRideParameters(rideParameters)
rideRequestView.setRideRequestViewCallback(new RideRequestViewErrorCallback() {
Expand All @@ -275,7 +275,7 @@ Session session = loginManager.getSession();
Now create an instance of the `RidesService` using the `Session`

```java
RidesService service = UberRidesApi.with(session).createService();
RidesService service = UberRidesApi.with(session).createService();
```

### Sync vs. Async Calls
Expand Down Expand Up @@ -317,11 +317,11 @@ 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.5.2).
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.5.3).

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).

Specify your configuration parameters in the sample's gradle.properties file, where examples can be found adhering to the format `UBER_CLIENT_ID=insert_your_client_id_here`. These are generated into the BuildConfig during compilation.
Specify your configuration parameters in the sample's gradle.properties file, where examples can be found adhering to the format `UBER_CLIENT_ID=insert_your_client_id_here`. These are generated into the BuildConfig during compilation.

For a more idiomatic storage approach, define these in your home gradle.properties file to keep them out of the git repo.

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.5.2-login_manager";
private static final String USER_AGENT = "core-android-v0.5.3-login_manager";

private final AccessTokenManager accessTokenManager;
private final LoginCallback callback;
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&login_type=WORLD&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.5.2-login_manager";
private static final String INSTALL = "https://m.uber.com/sign-up?client_id=Client1234&user-agent=core-android-v0.5.3-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.5.3-SNAPSHOT
version=0.5.3
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.5.2-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.5.3-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.5.2-ride_request_widget";
private static final String USER_AGENT_RIDE_WIDGET = "rides-android-v0.5.3-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.5.2-button";
private static final String USER_AGENT_BUTTON = "rides-android-v0.5.3-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.5.2-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.5.3-ride_request_view";
@Nullable private AccessTokenSession accessTokenSession;
@NonNull @VisibleForTesting RideParameters rideParameters = new RideParameters.Builder().build();
@Nullable private RideRequestViewCallback rideRequestViewCallback;
Expand Down Expand Up @@ -267,9 +267,9 @@ public void onReceivedError(
}

@Override
public void onReceivedHttpError(
WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
rideRequestWebViewClientCallback.onErrorParsed(RideRequestViewError.CONNECTIVITY_ISSUE);
public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
// This is a no-op necessary for testing as robolectric only supports up
// to API 21 and this call was added in API 23
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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.5.2-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.5.3-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.5.2-ride_request_widget",
assertEquals("rides-android-v0.5.3-ride_request_widget",
activity.rideRequestView.rideParameters.getUserAgent());
}

@Test
public void onLoad_withUserAgentInRideParametersButton_shouldNotGetOverridden() {
String userAgent = "rides-android-v0.5.2-button";
String userAgent = "rides-android-v0.5.3-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 @@ -50,7 +50,9 @@
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
Expand All @@ -72,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.5.2-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.5.3-ride_request_view";

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

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

Expand Down Expand Up @@ -218,10 +220,9 @@ public void whileRideRequestViewRunning_whenWebResourceErrorOccurs_shouldReceive
}

@Test
public void whileRideRequestViewRunning_whenWebHTTPErrorOccurs_shouldReceiveWebError() {
client.onReceivedHttpError(mock(WebView.class), mock(WebResourceRequest.class),
mock(WebResourceResponse.class));
verify(callback, times(1)).onErrorParsed(RideRequestViewError.CONNECTIVITY_ISSUE);
public void whileRideRequestViewRunning_whenWebHTTPErrorOccurs_shouldDoNothing() {
client.onReceivedHttpError(mock(WebView.class), mock(WebResourceRequest.class), mock(WebResourceResponse.class));
verify(callback, never()).onErrorParsed(any(RideRequestViewError.class));
}

@Test
Expand Down

0 comments on commit 7ca6d15

Please sign in to comment.