[#169] Android Gradle Plugin 7.1

Besides bumping the version, we can now integrate this plugin the same way we do the others.  The version is now declared in the settings.gradle.kts.

The change is a bit noisy, due to needing to move our repository restrictions around.
This commit is contained in:
Carter Jernigan 2022-01-25 15:11:52 -05:00
parent d46cf8187c
commit 40950a0377
7 changed files with 94 additions and 94 deletions

View File

@ -2,7 +2,6 @@ plugins {
id("com.android.application")
kotlin("android")
id("kotlin-parcelize")
id("androidx.navigation.safeargs")
id("zcash.android-build-conventions")
id("com.github.triplet.play")
}

View File

@ -3,51 +3,6 @@ buildscript {
lockMode.set(LockMode.STRICT)
lockAllConfigurations()
}
repositories {
val isRepoRestrictionEnabled = true
maven("https://dl.google.com/dl/android/maven2/") { //google()
if (isRepoRestrictionEnabled) {
content {
includeGroup("androidx.navigation")
includeGroup("com.android.tools")
includeGroup("com.google.testing.platform")
includeGroupByRegex("androidx.*")
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.android\\.tools.*")
}
}
}
maven("https://plugins.gradle.org/m2/") { // gradlePluginPortal()
if (isRepoRestrictionEnabled) {
content {
excludeGroup("androidx.navigation")
excludeGroup("com.android.tools")
excludeGroup("com.google.testing.platform")
excludeGroupByRegex("androidx.*")
excludeGroupByRegex("com\\.android.*")
excludeGroupByRegex("com\\.android\\.tools.*")
}
}
}
maven("https://repo.maven.apache.org/maven2/") { // mavenCentral()
if (isRepoRestrictionEnabled) {
content {
excludeGroup("androidx.navigation")
excludeGroup("com.android.tools")
excludeGroup("com.google.testing.platform")
excludeGroupByRegex("androidx.*")
excludeGroupByRegex("com\\.android.*")
excludeGroupByRegex("com\\.android\\.tools.*")
}
}
}
}
dependencies {
classpath("com.android.tools.build:gradle:${properties["ANDROID_GRADLE_PLUGIN_VERSION"]}")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${properties["ANDROIDX_NAVIGATION_VERSION"]}")
}
}
plugins {

View File

@ -1,43 +1,51 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
androidx.databinding:databinding-common:7.0.4=classpath
androidx.databinding:databinding-compiler-common:7.0.4=classpath
androidx.navigation:navigation-safe-args-generator:2.3.5=classpath
androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5=classpath
com.android.databinding:baseLibrary:7.0.4=classpath
com.android.tools.analytics-library:crash:30.0.4=classpath
com.android.tools.analytics-library:protos:30.0.4=classpath
com.android.tools.analytics-library:shared:30.0.4=classpath
com.android.tools.analytics-library:tracker:30.0.4=classpath
androidx.databinding:databinding-common:7.1.0=classpath
androidx.databinding:databinding-compiler-common:7.1.0=classpath
com.android.databinding:baseLibrary:7.1.0=classpath
com.android.tools.analytics-library:crash:30.1.0=classpath
com.android.tools.analytics-library:protos:30.1.0=classpath
com.android.tools.analytics-library:shared:30.1.0=classpath
com.android.tools.analytics-library:tracker:30.1.0=classpath
com.android.tools.build.jetifier:jetifier-core:1.0.0-beta09=classpath
com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09=classpath
com.android.tools.build:aapt2-proto:7.0.4-7396180=classpath
com.android.tools.build:aaptcompiler:7.0.4=classpath
com.android.tools.build:apksig:7.0.4=classpath
com.android.tools.build:apkzlib:7.0.4=classpath
com.android.tools.build:builder-model:7.0.4=classpath
com.android.tools.build:builder-test-api:7.0.4=classpath
com.android.tools.build:builder:7.0.4=classpath
com.android.tools.build:bundletool:1.6.0=classpath
com.android.tools.build:gradle-api:7.0.4=classpath
com.android.tools.build:gradle:7.0.4=classpath
com.android.tools.build:manifest-merger:30.0.4=classpath
com.android.tools.build:aapt2-proto:7.1.0-7984345=classpath
com.android.tools.build:aaptcompiler:7.1.0=classpath
com.android.tools.build:apksig:7.1.0=classpath
com.android.tools.build:apkzlib:7.1.0=classpath
com.android.tools.build:builder-model:7.1.0=classpath
com.android.tools.build:builder-test-api:7.1.0=classpath
com.android.tools.build:builder:7.1.0=classpath
com.android.tools.build:bundletool:1.8.0=classpath
com.android.tools.build:gradle-api:7.1.0=classpath
com.android.tools.build:gradle:7.1.0=classpath
com.android.tools.build:manifest-merger:30.1.0=classpath
com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api=classpath
com.android.tools.ddms:ddmlib:30.0.4=classpath
com.android.tools.layoutlib:layoutlib-api:30.0.4=classpath
com.android.tools.lint:lint-model:30.0.4=classpath
com.android.tools.utp:android-device-provider-gradle-proto:30.0.4=classpath
com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.4=classpath
com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.4=classpath
com.android.tools:annotations:30.0.4=classpath
com.android.tools:common:30.0.4=classpath
com.android.tools:dvlib:30.0.4=classpath
com.android.tools:repository:30.0.4=classpath
com.android.tools:sdk-common:30.0.4=classpath
com.android.tools:sdklib:30.0.4=classpath
com.android:signflinger:7.0.4=classpath
com.android:zipflinger:7.0.4=classpath
com.android.tools.ddms:ddmlib:30.1.0=classpath
com.android.tools.layoutlib:layoutlib-api:30.1.0=classpath
com.android.tools.lint:lint-model:30.1.0=classpath
com.android.tools.utp:android-device-provider-ddmlib-proto:30.1.0=classpath
com.android.tools.utp:android-device-provider-gradle-proto:30.1.0=classpath
com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.1.0=classpath
com.android.tools.utp:android-test-plugin-host-coverage-proto:30.1.0=classpath
com.android.tools.utp:android-test-plugin-host-retention-proto:30.1.0=classpath
com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.1.0=classpath
com.android.tools:annotations:30.1.0=classpath
com.android.tools:common:30.1.0=classpath
com.android.tools:dvlib:30.1.0=classpath
com.android.tools:repository:30.1.0=classpath
com.android.tools:sdk-common:30.1.0=classpath
com.android.tools:sdklib:30.1.0=classpath
com.android:signflinger:7.1.0=classpath
com.android:zipflinger:7.1.0=classpath
com.fasterxml.jackson.core:jackson-annotations:2.11.1=classpath
com.fasterxml.jackson.core:jackson-core:2.11.1=classpath
com.fasterxml.jackson.core:jackson-databind:2.11.1=classpath
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.1=classpath
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.11.1=classpath
com.fasterxml.jackson.module:jackson-module-kotlin:2.11.1=classpath
com.fasterxml.woodstox:woodstox-core:6.2.1=classpath
com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.39.0=classpath
com.github.ben-manes:gradle-versions-plugin:0.39.0=classpath
com.github.gundy:semver4j:0.16.4=classpath
@ -57,12 +65,11 @@ com.google.j2objc:j2objc-annotations:1.3=classpath
com.google.jimfs:jimfs:1.1=classpath
com.google.protobuf:protobuf-java-util:3.10.0=classpath
com.google.protobuf:protobuf-java:3.10.0=classpath
com.google.testing.platform:core-proto:0.0.8-alpha04=classpath
com.google.testing.platform:core-proto:0.0.8-alpha07=classpath
com.googlecode.json-simple:json-simple:1.1=classpath
com.googlecode.juniversalchardet:juniversalchardet:1.0.3=classpath
com.squareup:javapoet:1.12.1=classpath
com.squareup:javapoet:1.10.0=classpath
com.squareup:javawriter:2.5.0=classpath
com.squareup:kotlinpoet:1.7.2=classpath
com.sun.activation:javax.activation:1.2.0=classpath
com.sun.istack:istack-commons-runtime:3.0.8=classpath
com.sun.xml.fastinfoset:FastInfoset:1.2.16=classpath
@ -107,13 +114,16 @@ org.apache.commons:commons-compress:1.20=classpath
org.apache.httpcomponents:httpclient:4.5.6=classpath
org.apache.httpcomponents:httpcore:4.4.10=classpath
org.apache.httpcomponents:httpmime:4.5.6=classpath
org.bitbucket.b_c:jose4j:0.7.0=classpath
org.bouncycastle:bcpkix-jdk15on:1.56=classpath
org.bouncycastle:bcprov-jdk15on:1.56=classpath
org.checkerframework:checker-qual:3.5.0=classpath
org.codehaus.mojo:animal-sniffer-annotations:1.17=classpath
org.codehaus.woodstox:stax2-api:4.2.1=classpath
org.glassfish.jaxb:jaxb-runtime:2.3.2=classpath
org.glassfish.jaxb:txw2:2.3.2=classpath
org.jdom:jdom2:2.0.6=classpath
org.jetbrains.dokka:dokka-core:1.4.32=classpath
org.jetbrains.intellij.deps:trove4j:1.0.20181211=classpath
org.jetbrains.kotlin:kotlin-android-extensions:1.6.10=classpath
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.6.10=classpath
@ -141,21 +151,25 @@ org.jetbrains.kotlin:kotlin-tooling-metadata:1.6.10=classpath
org.jetbrains.kotlin:kotlin-util-io:1.6.10=classpath
org.jetbrains.kotlin:kotlin-util-klib:1.6.10=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1=classpath
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.1.0=classpath
org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0=classpath
org.jetbrains:annotations:13.0=classpath
org.jetbrains:markdown-jvm:0.2.1=classpath
org.jetbrains:markdown:0.2.1=classpath
org.json:json:20180813=classpath
org.jsoup:jsoup:1.13.1=classpath
org.jvnet.staxex:stax-ex:1.8.1=classpath
org.ow2.asm:asm-analysis:7.0=classpath
org.ow2.asm:asm-commons:7.0=classpath
org.ow2.asm:asm-tree:7.0=classpath
org.ow2.asm:asm-util:7.0=classpath
org.ow2.asm:asm:7.0=classpath
org.ow2.asm:asm-analysis:9.1=classpath
org.ow2.asm:asm-commons:9.1=classpath
org.ow2.asm:asm-tree:9.1=classpath
org.ow2.asm:asm-util:9.1=classpath
org.ow2.asm:asm:9.1=classpath
org.slf4j:slf4j-api:1.7.30=classpath
org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2=classpath
xerces:xercesImpl:2.12.0=classpath
xml-apis:xml-apis:1.4.01=classpath
xmlpull:xmlpull:1.1.3.1=classpath
xpp3:xpp3:1.1.4c=classpath
empty=

View File

@ -14,7 +14,7 @@ Start by making sure the command line with Gradle works first, because **all the
1. Install JVM 11 or greater on your system. Our setup has been tested with Java 11-17. For Windows or Linux, be sure that the `JAVA_HOME` environment variable points to the right Java version. Note: If you switch from a newer to an older JVM version, you may see an error like the following `> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "~/.android/debug.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available`. A solution is to delete the debug keystore and allow it to be re-generated.
1. Android Studio has an embedded JVM, although running Gradle tasks from the command line requires a separate JVM to be installed. Our Gradle scripts are configured to use toolchains to automatically install the correct JVM version. _Note: The ktlintFormat task will fail on Apple Silicon unless a Java 11 virtual machine is installed manually._
1. Install Android Studio and the Android SDK
1. Download the [Android Studio Bumblebee Beta](https://developer.android.com/studio/preview) (we're using the Beta version, due to its improved integration with Jetpack Compose)
1. Download the [Android Studio](https://developer.android.com/studio/)
1. Note: Do not open the project in Android Studio yet. That happens in a subsequent step below. At this stage, we're just using Android Studio to install the Android SDK
1. TODO: Fill in step-by-step instructions for setting up a new environment and installing the Android SDK from within Android Studio
1. Check out the code. _Use the command line (instead of Android Studio) to check out the code. This will ensure that your command line environment is set up correctly and avoids a few pitfalls with trying to use Android Studio directly. Android Studio's built-in git client is not as robust as standalone clients_

View File

@ -58,7 +58,7 @@ ANDROID_COMPILE_SDK_VERSION=31
ANDROID_NDK_VERSION=23.0.7599858
ANDROID_GRADLE_PLUGIN_VERSION=7.0.4
ANDROID_GRADLE_PLUGIN_VERSION=7.1.0
DETEKT_VERSION=1.19.0
GRADLE_VERSIONS_PLUGIN_VERSION=0.39.0
KTLINT_VERSION=0.43.1

View File

@ -2,17 +2,50 @@ enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement {
repositories {
val isRepoRestrictionEnabled = true
google {
if (isRepoRestrictionEnabled) {
content {
includeGroup("androidx.navigation")
includeGroup("com.android.tools")
includeGroup("com.google.testing.platform")
includeGroupByRegex("androidx.*")
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.android\\.tools.*")
}
}
}
gradlePluginPortal {
if (isRepoRestrictionEnabled) {
content {
excludeGroup("androidx.navigation")
excludeGroup("com.android.tools")
excludeGroup("com.google.testing.platform")
excludeGroupByRegex("androidx.*")
excludeGroupByRegex("com\\.android.*")
excludeGroupByRegex("com\\.android\\.tools.*")
}
}
}
}
plugins {
val androidGradlePluginVersion = extra["ANDROID_GRADLE_PLUGIN_VERSION"].toString()
val detektVersion = extra["DETEKT_VERSION"].toString()
val gradleVersionsPluginVersion = extra["GRADLE_VERSIONS_PLUGIN_VERSION"].toString()
val kotlinVersion = extra["KOTLIN_VERSION"].toString()
val playPublisherVersion = extra["PLAY_PUBLISHER_PLUGIN_VERSION_MATCHER"].toString()
kotlin("jvm") version (kotlinVersion)
kotlin("multiplatform") version (kotlinVersion)
id("com.android.application") version (androidGradlePluginVersion) apply (false)
id("com.android.library") version (androidGradlePluginVersion) apply (false)
id("com.github.ben-manes.versions") version (gradleVersionsPluginVersion) apply (false)
id("com.github.triplet.play") version (playPublisherVersion) apply (false)
id("io.gitlab.arturbosch.detekt") version (detektVersion) apply (false)
kotlin("android") version (kotlinVersion) apply (false)
kotlin("jvm") version (kotlinVersion)
kotlin("multiplatform") version (kotlinVersion)
}
}

View File

@ -2,7 +2,6 @@ plugins {
id("com.android.library")
kotlin("android")
id("kotlin-parcelize")
id("androidx.navigation.safeargs")
id("zcash.android-build-conventions")
}