From 0847e2b49f4bd8f94752c70d11c0cde922bc1fd5 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Mon, 8 May 2023 08:41:47 -0700 Subject: [PATCH] android,binder,cronet: .aar file when publishing (#10138) (#10144) --- android/build.gradle | 14 +++++++++----- binder/build.gradle | 14 +++++++++----- buildscripts/kokoro/android.sh | 2 +- buildscripts/kokoro/unix.sh | 8 ++++++++ cronet/build.gradle | 14 +++++++++----- settings.gradle | 1 - 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 89c43751351..e08c6cdefbd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,6 @@ plugins { id "maven-publish" id "com.android.library" - id "digital.wup.android-maven-publish" } description = 'gRPC: Android' @@ -23,6 +22,12 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { abortOnError true } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } repositories { @@ -73,10 +78,9 @@ tasks.register("sourcesJar", Jar) { publishing { publications { maven { - from components.android - - artifact javadocJar - artifact sourcesJar + afterEvaluate { + from components.release + } } } } diff --git a/binder/build.gradle b/binder/build.gradle index b43d2b650d5..1ba46d93347 100644 --- a/binder/build.gradle +++ b/binder/build.gradle @@ -1,7 +1,6 @@ plugins { id "maven-publish" id "com.android.library" - id "digital.wup.android-maven-publish" } description = 'gRPC BinderChannel' @@ -38,6 +37,12 @@ android { multiDexEnabled true } lintOptions { abortOnError false } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } repositories { @@ -129,10 +134,9 @@ tasks.register("sourcesJar", Jar) { publishing { publications { maven { - from components.android - - artifact javadocJar - artifact sourcesJar + afterEvaluate { + from components.release + } } } } diff --git a/buildscripts/kokoro/android.sh b/buildscripts/kokoro/android.sh index 927d532e7ac..df997bf3e8b 100755 --- a/buildscripts/kokoro/android.sh +++ b/buildscripts/kokoro/android.sh @@ -20,7 +20,7 @@ cat <> gradle.properties # https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory # Increased due to java.lang.OutOfMemoryError: Metaspace failures, "JVM heap # space is exhausted", and to increase build speed -org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1024m EOF echo y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;28.0.3" diff --git a/buildscripts/kokoro/unix.sh b/buildscripts/kokoro/unix.sh index 38566e0bb59..1e6af6cfc8a 100755 --- a/buildscripts/kokoro/unix.sh +++ b/buildscripts/kokoro/unix.sh @@ -31,6 +31,14 @@ fi # ARCH is x86_64 unless otherwise specified. ARCH="${ARCH:-x86_64}" +cat <> gradle.properties +# defaults to -Xmx512m -XX:MaxMetaspaceSize=256m +# https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory +# Increased due to java.lang.OutOfMemoryError: Metaspace failures, "JVM heap +# space is exhausted", and to increase build speed +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1024m +EOF + ARCH="$ARCH" buildscripts/make_dependencies.sh # Set properties via flags, do not pollute gradle.properties diff --git a/cronet/build.gradle b/cronet/build.gradle index 042f276d29e..7efcd4fdaa1 100644 --- a/cronet/build.gradle +++ b/cronet/build.gradle @@ -2,7 +2,6 @@ plugins { id "maven-publish" id "com.android.library" - id "digital.wup.android-maven-publish" } description = "gRPC: Cronet Android" @@ -35,6 +34,12 @@ android { } testOptions { unitTests { includeAndroidResources = true } } lintOptions { disable 'InvalidPackage' } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { @@ -83,10 +88,9 @@ task sourcesJar(type: Jar) { publishing { publications { maven { - from components.android - - artifact javadocJar - artifact sourcesJar + afterEvaluate { + from components.release + } } } } diff --git a/settings.gradle b/settings.gradle index 5a0fd56a5b3..2bce28fc221 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,6 @@ pluginManagement { id "com.google.cloud.tools.jib" version "3.3.1" id "com.google.osdetector" version "1.7.1" id "com.google.protobuf" version "0.9.1" - id "digital.wup.android-maven-publish" version "3.6.3" id "me.champeau.gradle.japicmp" version "0.3.0" id "me.champeau.jmh" version "0.6.8" id "net.ltgt.errorprone" version "3.0.1"