diff --git a/CHANGELOG.md b/CHANGELOG.md index c61456d..5a48858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +> [!NOTE] +> This release removes many implicit features that couldn't be configured from outside. +> It is also a part of a process of removing the features that could be easily implemented via [pre-compiled script plugins](https://docs.gradle.org/current/userguide/implementing_gradle_plugins_precompiled.html) (for example, SDK versions and tests configuration). +> It is recommended to migrate these configurations to pre-compiled script plugins. + ### Stable `addSharedSourceSetRoot` extension Experimental extension `addSharedSourceSetRoot(...)` has been replaced with the new stable version: @@ -14,6 +19,19 @@ android { } ``` +### Introduce `SigningConfig.fromProperties` (Experimental) + +It is common practice to store keystore credentials in `.properties` file. +This extension lets you apply configurations from a property file. + +```kotlin +android { + signingConfigs.getByName("debug") { + fromProperties(file("cert/debug.properties")) + } +} +``` + ### :warning: BREAKING CHANGES - **common:** Deprecate `redmadrobot.jvmTarget` with deprecation level `Error`. @@ -26,23 +44,55 @@ android { } ``` You can also configure [automatic toolchains downloading](https://docs.gradle.org/current/userguide/toolchains.html#sub:download_repositories). +- **android:** Don't set default `minSdk` (it was `23`) and `targetSdk` (it was `33`). + It was a poor decision to set defaults for these fields as could implicitly bump an SDK version in a project. + If you want to use `redmadrobot.android` to align SDK versions among all modules, you should set these properties explicitly: + ```kotlin + redmadrobot { + android { + minSdk = 23 + targetSdk = 34 + } + } + ``` - **common:** Disable [automatic repositories adding](https://github.com/RedMadRobot/gradle-infrastructure#automatically-added-repositories) by default. If you rely on this feature, consider declaring required repositories explicitly, or enable it in `gradle.properties`: ```properties redmadrobot.add.repositories=true ``` -- **android:** Default `targetSdk` changed from `33` to `34` +- **android:** Don't apply [`org.gradle.android.cache-fix` plugin](https://github.com/gradle/android-cache-fix-gradle-plugin/) automatically. + This change allows removing android-cache-fix-gradle-plugin from the project dependencies. + See [the plugin documentation](https://github.com/gradle/android-cache-fix-gradle-plugin/?tab=readme-ov-file#applying-the-plugin) to learn how to apply this plugin to your project. +- **android:** Don't apply `proguard-android-optimize.txt` rules by default. + If you need these rules, apply it manually: + ```kotlin + android { + defaultConfig { + proguardFile(getDefaultProguardFile("proguard-android-optimize.txt")) + } + } + ``` - **android:** Do not add `LOCK_ORIENTATION` and `CRASH_REPORTS_ENABLED` variables to `BuildConfig` implicitly +- **kotlin:** Don't set `allWarningsAsErrors` flag implicitly. + It was impossible to disable this feature. + To keep going with the old behavior, add the following code to your build script: + ```kotlin + val warningsAsErrors = findProperty("warningsAsErrors") == "true" || isRunningOnCi + tasks.withType().configureEach { + compilerOptions.allWarningsAsErrors = warningsAsErrors + } + ``` ### Other Changes - **android:** Use `ANDROID_BUILD_TOOLS_VERSION` env variable for `buildToolsVersion` if the option is not configured (#132) +- **android:** Make an extension `Project.collectProguardFiles` public - **android:** Add the option `redmadrobot.android.ndkVersion` to specify NDK version for all android modules - **android:** Remove the workaround for Explicit API enabling as the issue has been [fixed](https://youtrack.jetbrains.com/issue/KT-37652) in Kotlin 1.9 - **android:** Remove disabling of build features `aidl`, `renderScript` and `buildConfig` as they are already disabled by default in new versions of AGP - **kotlin:** Deprecate accessor `kotlinCompile`. It is recommended to use `kotlin.compilerOptions { ... }` to configure compilation instead. -- Update Gradle to `8.8` +- Update Gradle to `8.9` ### Dependencies @@ -56,8 +106,8 @@ infrastructure-kotlin: - [Kotlin](https://kotlinlang.org/docs/whatsnew20.html) `1.8.10` → `2.0.0` infrastructure-android: -- [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin) `7.4.2` → `8.5.0` -- [Android cache fix Gradle plugin](https://github.com/gradle/android-cache-fix-gradle-plugin/releases/tag/v3.0.1) `2.7.0` → `3.0.1` +- [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin) `7.4.2` → `8.5.1` +- Remove `android-cache-fix-gradle-plugin` from dependencies - Remove `com.android.tools:common` from dependencies infrastructure-detekt: diff --git a/README.md b/README.md index cf74bb8..bb7a770 100644 --- a/README.md +++ b/README.md @@ -412,13 +412,6 @@ dependencies { } ``` -### Warnings as errors - -By default, infrastructure plugins enable Kotlin compiler's option `allWarningsAsErrors` (`-Werror`) on CI. -You can change it by defining the `warningsAsErrors` project property. - -[Read more about Gradle project properties][project-properties] - ### Share sources between build variants You can share sources between two build variants. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8c646a4..4e60786 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,8 +5,7 @@ infrastructure = "0.18.1" infrastructure-kotlin = { module = "com.redmadrobot.build:infrastructure-kotlin", version.ref = "infrastructure" } infrastructure-detekt = { module = "com.redmadrobot.build:infrastructure-detekt", version.ref = "infrastructure" } infrastructure-publish = { module = "com.redmadrobot.build:infrastructure-publish", version.ref = "infrastructure" } -androidTools-gradle = "com.android.tools.build:gradle:8.5.0" -androidGradleCacheFix = "gradle.plugin.org.gradle.android:android-cache-fix-gradle-plugin:3.0.1" +androidTools-gradle = "com.android.tools.build:gradle:8.5.1" detektGradle = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6" kotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0" pluginPublish = "com.gradle.publish:plugin-publish-plugin:1.2.1" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..2c35211 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..09523c0 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.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf1..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30d..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/infrastructure-android/build.gradle.kts b/infrastructure-android/build.gradle.kts index a3a2560..9e3dd91 100644 --- a/infrastructure-android/build.gradle.kts +++ b/infrastructure-android/build.gradle.kts @@ -33,7 +33,5 @@ gradlePlugin { dependencies { api(projects.infrastructureKotlin) - compileOnly(libs.androidTools.gradle) // Should be provided by project - - implementation(libs.androidGradleCacheFix) + compileOnly(libs.androidTools.gradle) // Should be provided by a project } diff --git a/infrastructure-android/src/main/kotlin/android/AndroidApplicationPlugin.kt b/infrastructure-android/src/main/kotlin/android/AndroidApplicationPlugin.kt index 721481d..7a7711c 100644 --- a/infrastructure-android/src/main/kotlin/android/AndroidApplicationPlugin.kt +++ b/infrastructure-android/src/main/kotlin/android/AndroidApplicationPlugin.kt @@ -9,7 +9,7 @@ import com.android.build.api.variant.ApplicationVariant import com.redmadrobot.build.StaticAnalyzerSpec import com.redmadrobot.build.android.internal.android import com.redmadrobot.build.android.internal.androidComponents -import com.redmadrobot.build.android.internal.projectProguardFiles +import com.redmadrobot.build.android.internal.ifPresent import com.redmadrobot.build.android.task.MakeDebuggableTask import com.redmadrobot.build.dsl.* import org.gradle.api.Project @@ -36,7 +36,7 @@ public class AndroidApplicationPlugin : BaseAndroidPlugin("com.android.applicati private fun Project.configureApp() = android { defaultConfig { // Collect proguard rules from 'proguard' dir - setProguardFiles(projectProguardFiles() + getDefaultProguardFile("proguard-android-optimize.txt")) + proguardFiles.addAll(collectProguardFiles()) } finalizeQaBuildType() @@ -83,9 +83,7 @@ private fun ApplicationExtension.finalizeApp( androidOptions: AndroidOptions, staticAnalyzerSpec: StaticAnalyzerSpec, ) { - defaultConfig { - targetSdk = androidOptions.targetSdk.get() - } + androidOptions.targetSdk.ifPresent { defaultConfig.targetSdk = it } lint { xmlOutput = staticAnalyzerSpec.reportsDir.file("lint-results.xml").get().asFile diff --git a/infrastructure-android/src/main/kotlin/android/AndroidLibraryPlugin.kt b/infrastructure-android/src/main/kotlin/android/AndroidLibraryPlugin.kt index de8592e..965e3a0 100644 --- a/infrastructure-android/src/main/kotlin/android/AndroidLibraryPlugin.kt +++ b/infrastructure-android/src/main/kotlin/android/AndroidLibraryPlugin.kt @@ -4,7 +4,7 @@ package com.redmadrobot.build.android import com.android.build.api.dsl.LibraryExtension import com.redmadrobot.build.android.internal.android -import com.redmadrobot.build.android.internal.projectProguardFiles +import com.redmadrobot.build.dsl.collectProguardFiles import org.gradle.api.Project import org.jetbrains.kotlin.gradle.dsl.kotlinExtension @@ -20,7 +20,7 @@ public class AndroidLibraryPlugin : BaseAndroidPlugin("com.android.library") { android { defaultConfig { // Add all files from 'proguard' dir - consumerProguardFiles.addAll(projectProguardFiles()) + consumerProguardFiles.addAll(collectProguardFiles()) } buildFeatures { diff --git a/infrastructure-android/src/main/kotlin/android/AndroidOptions.kt b/infrastructure-android/src/main/kotlin/android/AndroidOptions.kt index 8869869..47d11a7 100644 --- a/infrastructure-android/src/main/kotlin/android/AndroidOptions.kt +++ b/infrastructure-android/src/main/kotlin/android/AndroidOptions.kt @@ -6,16 +6,10 @@ import org.gradle.api.tasks.TaskProvider /** Options for android projects. */ public interface AndroidOptions { - /** - * Minimal Android SDK to be used in all android modules. - * By default, SDK 23 is used. - */ + /** Minimal Android SDK to be used in all android modules. */ public val minSdk: Property - /** - * Target Android SDK to be used in all android modules. - * By default, SDK 34 is used. - */ + /** Target Android SDK to be used in all android modules. */ public val targetSdk: Property /** @@ -48,8 +42,5 @@ public interface AndroidOptions { */ public val testTasksFilter: Property<(TaskProvider<*>) -> Boolean> - public companion object { - internal const val DEFAULT_MIN_API = 23 - internal const val DEFAULT_TARGET_API = 34 - } + public companion object } diff --git a/infrastructure-android/src/main/kotlin/android/AndroidOptionsImpl.kt b/infrastructure-android/src/main/kotlin/android/AndroidOptionsImpl.kt index a57dd4c..3a63d28 100644 --- a/infrastructure-android/src/main/kotlin/android/AndroidOptionsImpl.kt +++ b/infrastructure-android/src/main/kotlin/android/AndroidOptionsImpl.kt @@ -20,10 +20,8 @@ internal abstract class AndroidOptionsImpl @Inject constructor( init { minSdk - .convention(AndroidOptions.DEFAULT_MIN_API) .finalizeValueOnRead() targetSdk - .convention(AndroidOptions.DEFAULT_TARGET_API) .finalizeValueOnRead() compileSdk .convention(targetSdk.map(Int::toString)) diff --git a/infrastructure-android/src/main/kotlin/android/BaseAndroidPlugin.kt b/infrastructure-android/src/main/kotlin/android/BaseAndroidPlugin.kt index ed57181..b1bde5a 100644 --- a/infrastructure-android/src/main/kotlin/android/BaseAndroidPlugin.kt +++ b/infrastructure-android/src/main/kotlin/android/BaseAndroidPlugin.kt @@ -6,7 +6,6 @@ import com.redmadrobot.build.StaticAnalyzerSpec import com.redmadrobot.build.android.internal.* import com.redmadrobot.build.internal.InternalGradleInfrastructureApi import com.redmadrobot.build.internal.addRepositoriesIfNeed -import com.redmadrobot.build.kotlin.internal.configureKotlin import com.redmadrobot.build.kotlin.internal.setTestOptions import org.gradle.api.Plugin import org.gradle.api.Project @@ -32,18 +31,12 @@ public abstract class BaseAndroidPlugin internal constructor( internal abstract fun Project.configure(configPlugin: AndroidConfigPlugin) - @OptIn(InternalGradleInfrastructureApi::class) private fun Project.applyBaseAndroidPlugin(pluginId: String, configPlugin: AndroidConfigPlugin) { apply { plugin(pluginId) plugin("kotlin-android") - - // Apply fix for Android caching problems - // See https://github.com/gradle/android-cache-fix-gradle-plugin - plugin("org.gradle.android.cache-fix") } - configureKotlin() configureAndroid() androidComponents { finalizeDsl { extension -> @@ -76,13 +69,10 @@ private fun CommonExtension.applyAndroidOptions( options: AndroidOptions, staticAnalyzerSpec: StaticAnalyzerSpec, ) { - setCompileSdkVersion(options.compileSdk.get()) + options.compileSdk.ifPresent { setCompileSdkVersion(it) } options.buildToolsVersion.ifPresent { buildToolsVersion = it } options.ndkVersion.ifPresent { ndkVersion = it } - - defaultConfig { - minSdk = options.minSdk.get() - } + options.minSdk.ifPresent { defaultConfig.minSdk = it } testOptions { unitTests.all { it.setTestOptions(options.test) } @@ -94,7 +84,7 @@ private fun CommonExtension.applyAndroidOptions( } } -/** Universal function to set compile SDK even if it is preview version. */ +/** Universal function to set compile SDK even if it is a preview version. */ private fun CommonExtension.setCompileSdkVersion(version: String) { val intVersion = version.toIntOrNull() if (intVersion != null) { @@ -104,7 +94,7 @@ private fun CommonExtension.setCompileSdkVersion(version: String) { } } -/** Filter unit tests to be run with 'test' task. */ +/** Filter unit tests to be run with the 'test' task. */ private fun Project.filterTestTaskDependencies(options: AndroidOptions) { afterEvaluate { tasks.named("test") { diff --git a/infrastructure-android/src/main/kotlin/android/internal/Proguard.kt b/infrastructure-android/src/main/kotlin/android/internal/Proguard.kt deleted file mode 100644 index 0a41caa..0000000 --- a/infrastructure-android/src/main/kotlin/android/internal/Proguard.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.redmadrobot.build.android.internal - -import org.gradle.api.Project -import java.io.File - -/** Collects proguard rules from 'proguard' dir. */ -internal fun Project.projectProguardFiles(): List { - return fileTree("proguard") - .files - .filter { it.extension == "pro" } -} diff --git a/infrastructure-android/src/main/kotlin/android/internal/Provider.kt b/infrastructure-android/src/main/kotlin/android/internal/Provider.kt index 2dec641..2f971a3 100644 --- a/infrastructure-android/src/main/kotlin/android/internal/Provider.kt +++ b/infrastructure-android/src/main/kotlin/android/internal/Provider.kt @@ -2,6 +2,6 @@ package com.redmadrobot.build.android.internal import org.gradle.api.provider.Property -internal fun Property.ifPresent(action: (T) -> Unit) { +internal inline fun Property.ifPresent(action: (T) -> Unit) { if (isPresent) action(get()) } diff --git a/infrastructure-android/src/main/kotlin/dsl/ProjectProguardFiles.kt b/infrastructure-android/src/main/kotlin/dsl/ProjectProguardFiles.kt new file mode 100644 index 0000000..6e3916e --- /dev/null +++ b/infrastructure-android/src/main/kotlin/dsl/ProjectProguardFiles.kt @@ -0,0 +1,11 @@ +package com.redmadrobot.build.dsl + +import org.gradle.api.Project +import java.io.File + +/** Collects proguard rules from the specified [path]. */ +public fun Project.collectProguardFiles(path: String = "proguard"): List { + return fileTree(path) + .files + .filter { it.extension == "pro" } +} diff --git a/infrastructure-android/src/main/kotlin/dsl/Signing.kt b/infrastructure-android/src/main/kotlin/dsl/Signing.kt new file mode 100644 index 0000000..6b79cf3 --- /dev/null +++ b/infrastructure-android/src/main/kotlin/dsl/Signing.kt @@ -0,0 +1,29 @@ +package dsl + +import com.android.build.api.dsl.SigningConfig +import org.gradle.api.Incubating +import java.io.File +import java.util.* + +/** + * Applies signature configuration from the specified [propertiesFile]. + * + * The file content should have the following format: + * ``` + * store_file=[relative path to keystore file] + * store_password=[keystore password] + * key_alias=[the alias of the needed key] + * key_password=[the password for the specified alias] + * ``` + */ +@Incubating +public fun SigningConfig.fromProperties(propertiesFile: File) { + val directory = propertiesFile.parentFile + val properties = Properties() + propertiesFile.inputStream().use(properties::load) + + storeFile = File(directory, properties.getProperty("store_file")) + storePassword = properties.getProperty("store_password") + keyAlias = properties.getProperty("key_alias") + keyPassword = properties.getProperty("key_password") +} diff --git a/infrastructure-kotlin/build.gradle.kts b/infrastructure-kotlin/build.gradle.kts index 82cff85..52eac75 100644 --- a/infrastructure-kotlin/build.gradle.kts +++ b/infrastructure-kotlin/build.gradle.kts @@ -25,5 +25,5 @@ gradlePlugin { dependencies { api(projects.infrastructureCommon) - compileOnlyApi(libs.kotlinGradle) // Should be provided by project + compileOnlyApi(libs.kotlinGradle) // Should be provided by a project } diff --git a/infrastructure-kotlin/src/main/kotlin/kotlin/KotlinLibraryPlugin.kt b/infrastructure-kotlin/src/main/kotlin/kotlin/KotlinLibraryPlugin.kt index db7db84..63a5329 100644 --- a/infrastructure-kotlin/src/main/kotlin/kotlin/KotlinLibraryPlugin.kt +++ b/infrastructure-kotlin/src/main/kotlin/kotlin/KotlinLibraryPlugin.kt @@ -2,7 +2,6 @@ package com.redmadrobot.build.kotlin import com.redmadrobot.build.internal.InternalGradleInfrastructureApi import com.redmadrobot.build.internal.addRepositoriesIfNeed -import com.redmadrobot.build.kotlin.internal.configureKotlin import com.redmadrobot.build.kotlin.internal.setTestOptions import org.gradle.api.Plugin import org.gradle.api.Project @@ -12,7 +11,7 @@ import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.kotlinExtension /** - * Plugin that applies default configurations for Kotlin library project. + * Plugin that applies default configurations for a Kotlin library project. * Should be applied in place of `kotlin` plugin. * * Tied to `com.redmadrobot.kotlin-library` plugin ID. @@ -31,7 +30,6 @@ public class KotlinLibraryPlugin : Plugin { // Enable Explicit API mode for libraries by default kotlinExtension.explicitApi() - configureKotlin() configureKotlinTest(configPlugin.testOptions) configureRepositories() } diff --git a/infrastructure-kotlin/src/main/kotlin/kotlin/internal/Kotlin.kt b/infrastructure-kotlin/src/main/kotlin/kotlin/internal/Kotlin.kt deleted file mode 100644 index 92f4a63..0000000 --- a/infrastructure-kotlin/src/main/kotlin/kotlin/internal/Kotlin.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.redmadrobot.build.kotlin.internal - -import com.redmadrobot.build.dsl.isRunningOnCi -import com.redmadrobot.build.internal.InternalGradleInfrastructureApi -import com.redmadrobot.build.internal.findBooleanProperty -import org.gradle.api.Project -import org.gradle.kotlin.dsl.* - -@InternalGradleInfrastructureApi -public fun Project.configureKotlin() { - val warningsAsErrors = getWarningsAsErrorsProperty() - kotlinCompile { - compilerOptions { - allWarningsAsErrors = warningsAsErrors - freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") - } - } -} - -/** Use property value if it exists or fallback to true if running on CI. */ -@OptIn(InternalGradleInfrastructureApi::class) -private fun Project.getWarningsAsErrorsProperty(): Boolean { - return findBooleanProperty("warningsAsErrors") ?: isRunningOnCi -} diff --git a/samples/android-application-multi/buildSrc/build.gradle.kts b/samples/android-application-multi/buildSrc/build.gradle.kts index c74557d..781e848 100644 --- a/samples/android-application-multi/buildSrc/build.gradle.kts +++ b/samples/android-application-multi/buildSrc/build.gradle.kts @@ -4,5 +4,5 @@ plugins { dependencies { implementation(kotlin("gradle-plugin", version = "2.0.0")) - implementation("com.android.tools.build:gradle:8.5.0") + implementation("com.android.tools.build:gradle:8.5.1") } diff --git a/samples/android-application-multi/gradle/wrapper/gradle-wrapper.jar b/samples/android-application-multi/gradle/wrapper/gradle-wrapper.jar index e644113..2c35211 100644 Binary files a/samples/android-application-multi/gradle/wrapper/gradle-wrapper.jar and b/samples/android-application-multi/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/android-application-multi/gradle/wrapper/gradle-wrapper.properties b/samples/android-application-multi/gradle/wrapper/gradle-wrapper.properties index a441313..09523c0 100644 --- a/samples/android-application-multi/gradle/wrapper/gradle-wrapper.properties +++ b/samples/android-application-multi/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/android-application-multi/gradlew b/samples/android-application-multi/gradlew index b740cf1..f5feea6 100755 --- a/samples/android-application-multi/gradlew +++ b/samples/android-application-multi/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/samples/android-application-multi/gradlew.bat b/samples/android-application-multi/gradlew.bat index 25da30d..9d21a21 100644 --- a/samples/android-application-multi/gradlew.bat +++ b/samples/android-application-multi/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/samples/android-application/build.gradle.kts b/samples/android-application/build.gradle.kts index 5c18445..25f2a2d 100644 --- a/samples/android-application/build.gradle.kts +++ b/samples/android-application/build.gradle.kts @@ -1,7 +1,15 @@ plugins { // Specify needed versions of AGP and KGP - id("com.android.application") version "8.5.0" apply false + id("com.android.application") version "8.5.1" apply false kotlin("android") version "2.0.0" apply false id("com.redmadrobot.android-config") version "0.19-SNAPSHOT" } + +// Common configurations for all modules +redmadrobot { + android { + minSdk = 21 + targetSdk = 34 + } +} diff --git a/samples/android-application/gradle/wrapper/gradle-wrapper.jar b/samples/android-application/gradle/wrapper/gradle-wrapper.jar index e644113..2c35211 100644 Binary files a/samples/android-application/gradle/wrapper/gradle-wrapper.jar and b/samples/android-application/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/android-application/gradle/wrapper/gradle-wrapper.properties b/samples/android-application/gradle/wrapper/gradle-wrapper.properties index a441313..09523c0 100644 --- a/samples/android-application/gradle/wrapper/gradle-wrapper.properties +++ b/samples/android-application/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/android-application/gradlew b/samples/android-application/gradlew index b740cf1..f5feea6 100755 --- a/samples/android-application/gradlew +++ b/samples/android-application/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/samples/android-application/gradlew.bat b/samples/android-application/gradlew.bat index 25da30d..9d21a21 100644 --- a/samples/android-application/gradlew.bat +++ b/samples/android-application/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ##########################################################################