Skip to content

Commit

Permalink
[Gradle Release Plugin] - pre tag commit: 'v0.5.0'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyvsmith committed Jun 3, 2016
1 parent 186f1a6 commit aefe514
Show file tree
Hide file tree
Showing 235 changed files with 17,948 additions and 1,179 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
v0.5.0 - 6/2/2016
------------
### Added

#### Single Sign On

Introducing **SSO**. Allows a user to login & authorize your application via the native Uber app. Users no longer have to remember their username & password as long as they are signed into the Uber app.

- Added Uber Application Single Sign On using `LoginManager.login(activity)`
- Added `LoginButton` to ease signing in using Uber account.
- Added `PRIVILEGED` scopes to `Scope`.

#### Support all REST API Endpoints

- Added dependency on [Uber Rides Java SDK](https://github.com/uber/rides-java-sdk) to access the Uber API.

### Changed

#### Split Libraries

Now split into the `core-android` and `rides-android` libraries.

- `core-android` contains common classes and auth related functionality.
- `rides-android` contains only rides related features.

#### RideRequestButton

The RideRequestButton has been updated to show information about your Uber ride.

- Added ETA and Price estimate to `RideRequestButton` if a product ID is set in the RideParameters.

### Breaking

- Moved core functionality and authentication related classes to `core-android` and the Java SDK. Imports require updating.
- Removed `UberSdk.initialize(context, clientId)` and all `UberSdk` setters in favor of `UberSdk.initialize(sessionConfiguration)`
- Removed `LoginManager.loginWithScopes(activity, scopes)` in favor of `LoginManager.login(activity)` after using `new LoginManager(accessTokenManager, callback)`
- Removed `AccessTokenManager.getAccessToken(key)` and `AccessTokenManager.setAccessToken(key, token)` in favor of `new AccessTokenManager(context, key)`
- Removed `LoginManager.onActivityResult(requestCode, resultCode, data, callback)` in favor of `LoginManager.onActivityResult(activity, requestCode, resultCode, data)`

v0.3.2 - 5/12/2016
------------------
### Fixed
Expand Down
236 changes: 179 additions & 57 deletions README.md

Large diffs are not rendered by default.

51 changes: 35 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'net.researchgate:gradle-release:2.3.5'
classpath 'co.riiid:gradle-github-plugin:0.4.2'
classpath 'net.saliman:gradle-cobertura-plugin:2.3.1'
Expand All @@ -22,10 +22,12 @@ allprojects {
apply plugin: 'maven'

["githubToken", "ossrhUsername", "ossrhPassword",
"signing.keyId", "signing.password", "signing.secretKeyRingFile",].each {checkAndDefaultProperty(it)}
"signing.keyId", "signing.password", "signing.secretKeyRingFile",].each {
checkAndDefaultProperty(it)
}

ext.set("unsnapshottedVersion", version.replaceAll("-SNAPSHOT", ""))
ext.set("samples", project(":samples").subprojects.collect {it.path})
ext.set("samples", project(":samples").subprojects.collect { it.path })
ext.set("isReleaseVersion", !version.endsWith("SNAPSHOT"))

repositories {
Expand All @@ -47,15 +49,17 @@ allprojects {

def generateReleaseNotes() {
def changelogSnippet = generateChangelogSnippet()
def model = [title: "Uber Rides Android SDK (Beta) v${unsnapshottedVersion}",
date: DateGroovyMethods.format(new Date(), 'MM/dd/yyyy'),
def model = [title : "Uber Rides Android SDK (Beta) v${unsnapshottedVersion}",
date : DateGroovyMethods.format(new Date(), 'MM/dd/yyyy'),
snippet: changelogSnippet,
assets: project.samples.collect {[
title: project(it).name,
download: githubDownloadPrefix + "v${unsnapshottedVersion}/"
+ project(it).name + "-v${unsnapshottedVersion}.zip",
description: project(it).description,
]}]
assets : project.samples.collect {
[
title : project(it).name,
download : githubDownloadPrefix + "v${unsnapshottedVersion}/"
+ project(it).name + "-v${unsnapshottedVersion}.zip",
description: project(it).description,
]
}]
def engine = new GStringTemplateEngine()
def template = engine.createTemplate(rootProject.file('releasenotes.gtpl')).make(model)
return template.toString()
Expand All @@ -65,7 +69,7 @@ def generateChangelogSnippet() {
def changelog = rootProject.file('CHANGELOG.md').text
def snippet = ""
def stop = false
changelog.eachLine {line, count ->
changelog.eachLine { line, count ->
if (count >= 2) {
stop = stop || line.startsWith("v");
if (!stop) {
Expand Down Expand Up @@ -106,9 +110,11 @@ gradle.taskGraph.beforeTask { Task task ->
}
}

afterReleaseBuild.dependsOn ":sdk:uploadArchives"
task uploadSdks(dependsOn: [":core-android:uploadArchives", ":rides-android:uploadArchives"])

afterReleaseBuild.dependsOn uploadSdks
updateVersion.dependsOn ":githubRelease"
githubRelease.dependsOn project(":samples").subprojects.collect {it.path + ":githubReleaseZip"}
githubRelease.dependsOn project(":samples").subprojects.collect { it.path + ":githubReleaseZip" }

release {
failOnCommitNeeded = false
Expand Down Expand Up @@ -146,24 +152,37 @@ distributions {
include 'releasenotes.gtpl'
include 'settings.gradle'
include 'gradle/'
include 'config'
include 'test-shared/'
}

from(rootDir) {
include 'README.md'
filter { String line ->
line.replaceAll("_version_", unsnapshottedVersion)
}
}

from('core-android') {
filesNotMatching("**/*.png") {
filter { String line ->
line.replaceAll("_version_", unsnapshottedVersion)
}
}
exclude 'build'
exclude '*.iml'
into 'core-android'
}

from('sdk') {
from('rides-android') {
filesNotMatching("**/*.png") {
filter { String line ->
line.replaceAll("_version_", unsnapshottedVersion)
}
}
exclude 'build'
exclude '*.iml'
into 'sdk'
into 'rides-android'
}

from('samples') {
Expand Down
184 changes: 184 additions & 0 deletions core-android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'cobertura'

buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdkVersion 14
versionName version
consumerProguardFiles 'proguard.txt'
}

sourceSets {
test {
java.srcDirs += '../test-shared/test/java/'
}
}
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

signing {
sign configurations.archives
}

project.archivesBaseName = artifactId


def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
return hasProperty('ossrhUsername') ? ossrhUsername : ""
}

def getRepositoryPassword() {
return hasProperty('ossrhPassword') ? ossrhPassword : ""
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

pom.project {
name 'Uber Rides Android SDK (beta)'
packaging 'aar'
artifactId artifactId

description 'The official Android SDK (beta) for the Uber Rides API.'
url 'https://developer.uber.com'

scm {
connection 'scm:git:git@github.com:uber/rides-android-sdk.git'
developerConnection 'scm:git:git@github.com:uber/rides-android-sdk.git'
url 'git@github.com:uber/rides-android-sdk.git'
}

licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}

developers {
developer {
id 'arogal'
name 'Adam Rogal'
email 'arogal@uber.com'
}

developer {
id 'itstexter'
name 'Alex Texter'
email 'texter@uber.com'
}

developer {
id 'tyvsmith'
name 'Ty Smith'
email 'tys@uber.com'
}

developer {
id 'yhartanto'
name 'Yohan Hartanto'
email 'yohan@uber.com'
}
}
}
}
}
}

cobertura {
coverageFormats = ['html', 'xml']
coverageIgnoreTrivial = true
coverageExcludes += [
'.*android\\.support\\.v7\\.appcompat\\.R\\.*',
'.*com\\.uber\\.sdk\\.android\\.core\\.R\\.*',
'.*android\\.support\\.v7\\.appcompat\\.R\\$.*\\.*',
'.*com\\.uber\\.sdk\\.android\\.core\\.R\\$.*\\.*',
'.*BuildConfig.*']
}

dependencies {
compile ('com.uber.sdk:rides:0.5.0') {
//Do not need Google OAuth based logic in Android
exclude module: 'slf4j-log4j12'
exclude module: 'google-oauth-client'
exclude module: 'google-http-client-jackson2'
}

compile 'com.android.support:appcompat-v7:23.0.1'

//Needed for runtime annotation preservation in Moshi
//Will require Java SDK updates to remove safely
compile 'com.google.code.findbugs:jsr305:1.3.9'

testCompile 'junit:junit:4.12'
testCompile 'com.google.guava:guava:18.0'
testCompile 'com.google.http-client:google-http-client-jackson2:1.19.0'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.robolectric:robolectric:3.0'

//Needed for Cobertura checks because of above exclude
testCompile 'com.google.http-client:google-http-client-jackson2:1.19.0'
testCompile 'com.google.oauth-client:google-oauth-client:1.19.0'
testCompile 'org.slf4j:slf4j-log4j12:1.7.5'

cobertura 'com.google.android:android:4.1.1.4'
}
1 change: 1 addition & 0 deletions core-android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artifactId=core-android
30 changes: 30 additions & 0 deletions core-android/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ 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.
-->

<lint>
<issue id="InvalidPackage">
<ignore path="*okio*.jar"/>
<ignore path="*retrofit*.jar"/>
</issue>
</lint>
16 changes: 16 additions & 0 deletions core-android/proguard.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# OkHttp 3
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

#retrofit2
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions

-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
Loading

0 comments on commit aefe514

Please sign in to comment.