Skip to content

Commit 80e497b

Browse files
authored
Merge pull request #16 from uber/ts/add-travis
Add Travis support and fix minor versioning issues
2 parents a9d719b + 4269e00 commit 80e497b

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: java
2+
3+
jdk:
4+
- oraclejdk7
5+
- openjdk7

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
v0.5.1 - 6/7/2016
1+
v0.5.2 - TBD
22
------------
3+
4+
v0.5.1 - 6/7/2016
5+
-----------------
36
### Fixed
47
- [Issue #14](https://github.com/uber/rides-java-sdk/issues/14) Adjust RefreshAuthenticator to ignore Invalid scope
58

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Uber Rides Java SDK (Beta)
1+
# Uber Rides Java SDK (Beta) [![Build Status](https://travis-ci.org/uber/rides-java-sdk.svg?branch=master)](https://travis-ci.org/uber/rides-java-sdk)
22
This SDK helps your Java App make HTTP requests to the Uber Rides API.
33

44
## Setup
55

66
### Installing
77

88
#### Before you begin
9-
Register your app in the [Uber developer dashboard](https://developer.uber.com/dashboard). Notice that the app gets a client ID, secret, and server token required for authenticating with the API.
9+
Register your app in the [Uber developer dashboard](https://developer.uber.com/dashboard). Notice that the app gets a client ID, secret, and server token required for authenticating with the API.
1010

1111
Note: Using Android? Be sure to checkout the [Uber Android SDK](github.com/uber/rides-android-sdk) in addition, which has native authentication mechanisms.
1212

@@ -44,7 +44,7 @@ ServerTokenSession session = new ServerTokenSession(config));
4444
```
4545
#### Create a session using the OAuth 2 flow
4646
In an OAuth session, the app first asks the user to authorize and then exchanges the authorization code for an access token from Uber.
47-
Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.
47+
Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.
4848

4949
**Step 1**. Create an OAuth2Credentials object with your client ID, client secret, scopes, and a redirect callback URI to capture the user’s authorization code.
5050
```java
@@ -54,13 +54,13 @@ SessionConfiguration config = new SessionConfiguration.Builder()
5454
.setScopes(yourScopes)
5555
.setRedirectUri(redirectUri)
5656
.build();
57-
57+
5858
OAuth2Credentials credentials = new OAuth2Credentials.Builder()
5959
.setSessionConfiguration(config)
6060
.build();
61-
61+
6262
```
63-
**Step 2**. Navigate the user to the authorization URL from the OAuth2Credentials object.
63+
**Step 2**. Navigate the user to the authorization URL from the OAuth2Credentials object.
6464
```java
6565
String authorizationUrl = credentials.getAuthorizationUrl();
6666
```

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,22 @@ gradle.taskGraph.beforeTask { Task task ->
155155
}
156156
}
157157

158+
task updateChangelog() << {
159+
def newVersion = findProperty("version").replaceAll('-SNAPSHOT', '')
160+
def changelog = rootProject.file('CHANGELOG.md')
161+
def changelogText = changelog.text
162+
if (!changelogText.startsWith("v${newVersion} -")) {
163+
def updatedChangelog = "v${newVersion} - TBD\n"
164+
def dashesCount = updatedChangelog.length()-1
165+
updatedChangelog += "-"*dashesCount + "\n\n"
166+
167+
changelog.write(updatedChangelog + changelogText)
168+
}
169+
}
170+
158171
afterReleaseBuild.dependsOn ':sdk:uploadArchives'
159172
updateVersion.dependsOn ':githubRelease'
173+
commitNewVersion.dependsOn ':updateChangelog'
160174
githubRelease.dependsOn project(':samples').subprojects.collect { it.path + ':githubReleaseZip' }
161175

162176
release {
@@ -195,6 +209,7 @@ distributions {
195209
include 'releasenotes.gtpl'
196210
include 'settings.gradle'
197211
include 'gradle/'
212+
include '.travis.yml'
198213
}
199214

200215
from(rootDir) {

sdk/src/main/java/com/uber/sdk/rides/client/internal/ApiInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class ApiInterceptor implements Interceptor {
3434
static final String HEADER_ACCESS_TOKEN = "Authorization";
3535

3636

37-
static final String LIB_VERSION = "0.5.1";
37+
static final String LIB_VERSION = "0.5.2";
3838
static final String HEADER_ACCEPT_LANGUAGE = "Accept-Language";
3939
static final String HEADER_USER_AGENT = "X-Uber-User-Agent";
4040

0 commit comments

Comments
 (0)