Skip to content

Commit

Permalink
[Gradle Release Plugin] - pre tag commit: 'v0.5.4'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Texter committed Sep 29, 2016
1 parent ee8a0ec commit fe0877d
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 52 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
v0.5.4 - TBD
------------
v0.5.4 - 9/29/2016
------------------
### Added

- [Pull #51](https://github.com/uber/rides-android-sdk/pull/51) Adding sandbox hint for widget

### Fixed

- [Issue #44](https://github.com/uber/rides-android-sdk/issues/44) Null pointer exception when selected setPickupToMyLocation
- [Issue #48](https://github.com/uber/rides-android-sdk/issues/48) Typo in Readme.md
- [Issue #54](https://github.com/uber/rides-android-sdk/issues/54) log4j lib still exists in 0.5.3 causing Proguard failing

v0.5.3 - 8/12/2016
------------------
Expand All @@ -14,7 +23,6 @@ v0.5.2 - 7/11/2016

- [Issue #31](https://github.com/uber/rides-android-sdk/issues/31) Multiple warnings "Ignoring InnerClasses attribute for an anonymous inner class" when building project


v0.5.1 - 6/7/2016
-----------------
### Fixed
Expand Down
8 changes: 4 additions & 4 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.3'
compile 'com.uber.sdk:rides-android:0.5.4'
}
```

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

Expand Down Expand Up @@ -157,7 +157,7 @@ RideRequestButtonCallback callback = new RideRequestButtonCallback() {

requestButton.setRideParameters(rideParams);
requestButton.setSession(session);
requestButton.setCallback(callback));
requestButton.setCallback(callback);
requestButton.loadRideInformation();
```

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

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
8 changes: 3 additions & 5 deletions core-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdkVersion 14
versionName version
Expand Down Expand Up @@ -157,9 +155,9 @@ cobertura {
dependencies {
compile ('com.uber.sdk:rides:0.5.2') {
//Do not need Google OAuth based logic in Android
exclude module: 'slf4j-log4j12'
exclude module: 'google-oauth-client'
exclude module: 'google-http-client-jackson2'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'com.google.oauth-client', module: 'google-oauth-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
}

compile 'com.android.support:appcompat-v7:23.0.1'
Expand Down
32 changes: 32 additions & 0 deletions core-android/src/main/java/android/net/http/AndroidHttpClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2016 Uber Technologies, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package android.net.http;

/**
* Apache HTTP Client was deprecated and is no longer part of compile classpath.
* Robolectic still links to it so an empty class is needed for compiling purposes.
*
* See Robolectric <a href="https://github.com/robolectric/robolectric/issues/1862">issue</a> for
* details.
*/
public class AndroidHttpClient { }
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.3-login_manager";
private static final String USER_AGENT = "core-android-v0.5.4-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.3-login_manager";
private static final String INSTALL = "https://m.uber.com/sign-up?client_id=Client1234&user-agent=core-android-v0.5.4-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.4-SNAPSHOT
version=0.5.4
2 changes: 0 additions & 2 deletions rides-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdkVersion 14
versionName version
Expand Down
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.3-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.5.4-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.3-ride_request_widget";
private static final String USER_AGENT_RIDE_WIDGET = "rides-android-v0.5.4-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.3-button";
private static final String USER_AGENT_BUTTON = "rides-android-v0.5.4-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.3-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.5.4-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 @@ -87,11 +87,15 @@ public RideRequestButtonController(
}

public void loadRideInformation(@NonNull RideParameters rideParameters) {
checkNotNull(rideParameters.getPickupLatitude(), "Must set pick up point latitude in " +
"RideParameters.");
if (rideParameters.getPickupLatitude() != null) {
checkNotNull(rideParameters.getPickupLongitude(), "Pickup point latitude is set in " +
"RideParameters but not the longitude.");
}

checkNotNull(rideParameters.getPickupLongitude(), "Must set pick up point longitude in " +
"RideParameters.");
if (rideParameters.getPickupLongitude() != null) {
checkNotNull(rideParameters.getPickupLatitude(), "Pickup point longitude is set in " +
"RideParameters but not the latitude.");
}

if (rideParameters.getDropoffLatitude() != null) {
checkNotNull(rideParameters.getDropoffLongitude(), "Dropoff point latitude is set in " +
Expand All @@ -105,34 +109,38 @@ public void loadRideInformation(@NonNull RideParameters rideParameters) {

cancelAllPending();

if (rideParameters.getDropoffLatitude() != null) {
TimePriceDelegate pendingDelegate = new TimePriceDelegate(rideRequestButtonView, rideRequestButtonCallback);
if (rideParameters.getPickupLatitude() != null) {
if (rideParameters.getDropoffLatitude() != null) {
TimePriceDelegate pendingDelegate = new TimePriceDelegate(rideRequestButtonView, rideRequestButtonCallback);

loadPriceEstimate(
rideParameters.getPickupLatitude().floatValue(),
rideParameters.getPickupLongitude().floatValue(),
rideParameters.getDropoffLatitude().floatValue(),
rideParameters.getDropoffLongitude().floatValue(),
rideParameters.getProductId(),
pendingDelegate);

this.pendingDelegate = pendingDelegate;
} else {
pendingDelegate = new TimeDelegate(rideRequestButtonView, rideRequestButtonCallback);
}

loadPriceEstimate(
loadTimeEstimate(
pendingDelegate,
rideParameters.getPickupLatitude().floatValue(),
rideParameters.getPickupLongitude().floatValue(),
rideParameters.getDropoffLatitude().floatValue(),
rideParameters.getDropoffLongitude().floatValue(),
rideParameters.getProductId(),
pendingDelegate);

this.pendingDelegate = pendingDelegate;
rideParameters.getProductId());
} else {
pendingDelegate = new TimeDelegate(rideRequestButtonView, rideRequestButtonCallback);
rideRequestButtonView.showDefaultView();
}

loadTimeEstimate(
pendingDelegate,
rideParameters.getPickupLatitude().floatValue(),
rideParameters.getPickupLongitude().floatValue(),
rideParameters.getProductId());
}

private void loadTimeEstimate(
@NonNull final TimeDelegate delegate,
final float latitude,
final float longitude,
final @Nullable String productId) {
@Nullable final String productId) {

timeEstimateCall = ridesService.getPickupTimeEstimate(latitude, longitude, productId);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2016 Uber Technologies, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package android.net.http;

/**
* Apache HTTP Client was deprecated and is no longer part of compile classpath.
* Robolectic still links to it so an empty class is needed for compiling purposes.
*
* See Robolectric <a href="https://github.com/robolectric/robolectric/issues/1862">issue</a> for
* details.
*/
public class AndroidHttpClient { }
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.3-deeplink";
private static final String USER_AGENT_DEEPLINK = "rides-android-v0.5.4-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.3-ride_request_widget",
assertEquals("rides-android-v0.5.4-ride_request_widget",
activity.rideRequestView.rideParameters.getUserAgent());
}

@Test
public void onLoad_withUserAgentInRideParametersButton_shouldNotGetOverridden() {
String userAgent = "rides-android-v0.5.3-button";
String userAgent = "rides-android-v0.5.4-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.5.3-ride_request_view";
private static final String USER_AGENT_RIDE_VIEW = "rides-android-v0.5.4-ride_request_view";

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,11 @@ public void testLoadInformation_wheNoPickup() {
valueOf(DROP_OFF_LONGITUDE), DROP_OFF_NICKNAME, DROP_OFF_ADDRESS)
.build();

expectedException.expect(NullPointerException.class);
expectedException.expectMessage("Must set pick up point latitude in RideParameters.");

controller.loadRideInformation(rideParameters);

verify(view).showDefaultView();
verify(view, never()).showEstimate(any(TimeEstimate.class));
verify(view, never()).showEstimate(any(TimeEstimate.class), any(PriceEstimate.class));
}

@Test
Expand All @@ -545,7 +546,8 @@ public void testLoadInformation_wheNoPickupLongitude() {
.build();

expectedException.expect(NullPointerException.class);
expectedException.expectMessage("Must set pick up point longitude in RideParameters.");
expectedException.expectMessage("Pickup point latitude is set in " +
"RideParameters but not the longitude.");

controller.loadRideInformation(rideParameters);
}
Expand All @@ -559,7 +561,8 @@ public void testLoadInformation_wheNoPickupLatitude() {
.build();

expectedException.expect(NullPointerException.class);
expectedException.expectMessage("Must set pick up point latitude in RideParameters.");
expectedException.expectMessage("Pickup point longitude is set in " +
"RideParameters but not the latitude.");

controller.loadRideInformation(rideParameters);
}
Expand Down

0 comments on commit fe0877d

Please sign in to comment.