diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt index 7696c6b53..3022112ce 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt @@ -55,10 +55,10 @@ private fun Project.buildComposeMetricsParameters(): List { val metricParameters = mutableListOf() val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics") val relativePath = projectDir.relativeTo(rootDir) - + val buildDir = layout.buildDirectory.get().asFile val enableMetrics = (enableMetricsProvider.orNull == "true") if (enableMetrics) { - val metricsFolder = rootProject.buildDir.resolve("compose-metrics").resolve(relativePath) + val metricsFolder = buildDir.resolve("compose-metrics").resolve(relativePath) metricParameters.add("-P") metricParameters.add( "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath @@ -68,7 +68,7 @@ private fun Project.buildComposeMetricsParameters(): List { val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports") val enableReports = (enableReportsProvider.orNull == "true") if (enableReports) { - val reportsFolder = rootProject.buildDir.resolve("compose-reports").resolve(relativePath) + val reportsFolder = buildDir.resolve("compose-reports").resolve(relativePath) metricParameters.add("-P") metricParameters.add( "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt index 70eef1a2d..596c4f579 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt @@ -50,7 +50,7 @@ internal fun Project.configureJacoco( androidComponentsExtension.onVariants { variant -> val testTaskName = "test${variant.name.capitalize()}UnitTest" - + val buildDir = layout.buildDirectory.get().asFile val reportTask = tasks.register("jacoco${testTaskName.capitalize()}Report", JacocoReport::class) { dependsOn(testTaskName) diff --git a/core/datastore/build.gradle.kts b/core/datastore/build.gradle.kts index d6ca7ebcd..b13741b60 100644 --- a/core/datastore/build.gradle.kts +++ b/core/datastore/build.gradle.kts @@ -54,6 +54,7 @@ protobuf { androidComponents.beforeVariants { android.sourceSets.register(it.name) { + val buildDir = layout.buildDirectory.get().asFile java.srcDir(buildDir.resolve("generated/source/proto/${it.name}/java")) kotlin.srcDir(buildDir.resolve("generated/source/proto/${it.name}/kotlin")) } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 62f495dfe..ac72c34e8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca14..0adc8e1a5 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum