Update to AGP 7.3.0 stable

Enables Gradle configuration cache.
Fix "no name set for build-config" warning.
Fix printing of test APKs due to AGP 7.3 changes

Change-Id: I65ec0cb9eba3d047417fc512ffeb66d378ba0c75
pull/305/head
Wojtek Kaliciński 2 years ago
parent 4683918cc7
commit 4c64a05897

@ -34,7 +34,7 @@ jobs:
uses: gradle/gradle-build-action@v2
- name: Check spotless
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --stacktrace
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
- name: Check lint
run: ./gradlew lintDebug --stacktrace

@ -38,7 +38,15 @@ internal fun Project.configurePrintApksTask(extension: AndroidComponentsExtensio
if (variant is HasAndroidTest) {
val loader = variant.artifacts.getBuiltArtifactsLoader()
val artifact = variant.androidTest?.artifacts?.get(SingleArtifact.APK)
val testSources = variant.androidTest?.sources?.java?.all
val javaSources = variant.androidTest?.sources?.java?.all
val kotlinSources = variant.androidTest?.sources?.kotlin?.all
val testSources = if (javaSources != null && kotlinSources != null) {
javaSources.zip(kotlinSources) { javaDirs, kotlinDirs ->
javaDirs + kotlinDirs
}
} else javaSources ?: kotlinSources
if (artifact != null && testSources != null) {
tasks.register(
"${variant.name}PrintTestApk",
@ -70,7 +78,9 @@ internal abstract class PrintApkLocationTask : DefaultTask() {
@TaskAction
fun taskAction() {
val hasFiles = sources.orNull?.any { directory ->
directory.asFileTree.files.any { it.isFile }
directory.asFileTree.files.any {
it.isFile && it.parentFile.path.contains("build${File.separator}generated").not()
}
} ?: throw RuntimeException("Cannot check androidTest sources")
// Don't print APK location if there are no androidTest source files

@ -28,4 +28,5 @@ dependencyResolutionManagement {
}
}
rootProject.name = "build-logic"
include(":convention")

@ -21,8 +21,8 @@ org.gradle.configureondemand=false
# Enable caching between builds.
org.gradle.caching=true
# TODO: enable this when moving to AGP 7.3
#org.gradle.unsafe.configuration-cache=true
# Enable configuration caching between builds.
org.gradle.unsafe.configuration-cache=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK

@ -1,7 +1,7 @@
[versions]
accompanist = "0.24.8-beta"
androidDesugarJdkLibs = "1.1.5"
androidGradlePlugin = "7.2.2" # TODO: when changing this to 7.3 resolve TODO in gradle.properties
androidGradlePlugin = "7.3.0"
androidxActivity = "1.5.1"
androidxAppCompat = "1.5.1"
androidxCompose = "1.3.0-beta02"

@ -88,7 +88,7 @@ done
if [[ -n "$run_checks" ]]; then
# pre-push usually executes in the repository root, but just to be safe...
cd "$(git rev-parse --show-toplevel)"
./gradlew --init-script gradle/init.gradle.kts check
./gradlew --init-script gradle/init.gradle.kts --no-configuration-cache check
exit $?
fi

Loading…
Cancel
Save