Skip to content

Commit

Permalink
android/android-interop-testing/examples: upgrade android plugin
Browse files Browse the repository at this point in the history
This resolves #5523

While bumping `com.android.tools.build:gradle:3.1.2` to `3.3.0`, some other plugins/artifacts/maven repo/buildscripts have to be updated:

- gradle (wrapper) need to upgrade to 4.10.x
- protobuf gradle plugin need to bump a version compatible with gradle version.
- need add `google()` and `jcenter()` repos for android (otherwise `com.android.tools.build:aapt2:3.3.0x` and `trove4j` will not be found resp.)
- need to accept license for Android "build-tools;28.0.3" in kokoro env.
  • Loading branch information
dapengzhang0 committed Apr 2, 2019
1 parent 30038fd commit 755a227
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.5'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
Expand Down
4 changes: 2 additions & 2 deletions android-interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.6"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
Expand All @@ -36,6 +36,8 @@ android {
}

repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ subprojects {
protoc_lite: "com.google.protobuf:protoc-gen-javalite:3.0.0",
protobuf_nano: "com.google.protobuf.nano:protobuf-javanano:${protobufNanoVersion}",
protoc_nano: "com.google.protobuf:protoc:3.5.1-1",
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.5',
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.8',
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
lang: "org.apache.commons:commons-lang3:3.5",

Expand Down
2 changes: 2 additions & 0 deletions buildscripts/kokoro/android-interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export CXXFLAGS=-I/tmp/protobuf/include
export LD_LIBRARY_PATH=/tmp/protobuf/lib
export OS_NAME=$(uname)

echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;28.0.3"

# Proto deps
buildscripts/make_dependencies.sh

Expand Down
2 changes: 2 additions & 0 deletions buildscripts/kokoro/android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export CXXFLAGS=-I/tmp/protobuf/include
export LD_LIBRARY_PATH=/tmp/protobuf/lib
export OS_NAME=$(uname)

echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;28.0.3"

# Proto deps
buildscripts/make_dependencies.sh

Expand Down
1 change: 1 addition & 0 deletions buildscripts/kokoro/linux_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ readonly GRPC_JAVA_DIR="$(cd "$(dirname "$0")"/../.. && pwd)"

# grpc-android requires the Android SDK, so build outside of Docker and
# use --include-build for its grpc-core dependency
echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;28.0.3"
LOCAL_MVN_TEMP=$(mktemp -d)
pushd "$GRPC_JAVA_DIR/android"
../gradlew uploadArchives \
Expand Down
4 changes: 2 additions & 2 deletions examples/android/clientcache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions examples/android/helloworld/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions examples/android/routeguide/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier gradle versions
id 'com.google.protobuf' version '0.8.5'
id 'com.google.protobuf' version '0.8.8'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
Expand Down
2 changes: 1 addition & 1 deletion examples/example-alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier gradle versions
id 'com.google.protobuf' version '0.8.5'
id 'com.google.protobuf' version '0.8.8'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier gradle versions
id 'com.google.protobuf' version '0.8.5'
id 'com.google.protobuf' version '0.8.8'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
Expand Down
4 changes: 2 additions & 2 deletions examples/example-kotlin/android/helloworld/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 3 additions & 1 deletion examples/example-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version'1.3.10'
id 'com.google.protobuf' version '0.8.5'
id 'com.google.protobuf' version '0.8.8'

// Generate IntelliJ IDEA's .idea & .iml project files
// Starting with 0.8.4 of protobuf-gradle-plugin, *.proto and the gen output files are added
Expand All @@ -14,6 +14,8 @@ plugins {
}

repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
Expand Down
2 changes: 2 additions & 0 deletions examples/example-kotlin/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pluginManagement {
repositories {
google()
jcenter()
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/example-tls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// Provide convenience executables for trying out the examples.
id 'application'
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier gradle versions
id 'com.google.protobuf' version '0.8.5'
id 'com.google.protobuf' version '0.8.8'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
Expand Down
Binary file modified examples/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 755a227

Please sign in to comment.