v0.19
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 (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:
android {
// The old way (Deprecated)
addSharedSourceSetRoot("debug", "qa")
// The new way
sourceSets.addSharedSourceSetRoot("debug", "qa")
}
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.
android {
signingConfigs.getByName<SigningConfig>("debug") {
fromProperties(file("cert/debug.properties"))
}
}
⚠️ BREAKING CHANGES
- common: Deprecate
redmadrobot.jvmTarget
with deprecation levelError
.
Use JVM Toolchains instead to specify JVM target.
Kotlin, Android Gradle Plugin, detekt and many other tools have support for this mechanism,
In most cases, adding this into yourbuild.gradle.kts
should be enough:You can also configure automatic toolchains downloading.kotlin { jvmToolchain(17) }
- android: Don't set default
minSdk
(it was23
) andtargetSdk
(it was33
).
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 useredmadrobot.android
to align SDK versions among all modules, you should set these properties explicitly:redmadrobot { android { minSdk = 23 targetSdk = 34 } }
- common: Disable automatic repositories adding by default.
If you rely on this feature, consider declaring required repositories explicitly, or enable it ingradle.properties
:redmadrobot.add.repositories=true
- android: Don't apply
org.gradle.android.cache-fix
plugin automatically.
This change allows removing android-cache-fix-gradle-plugin from the project dependencies.
See the plugin documentation 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:android { defaultConfig { proguardFile(getDefaultProguardFile("proguard-android-optimize.txt")) } }
- android: Do not add
LOCK_ORIENTATION
andCRASH_REPORTS_ENABLED
variables toBuildConfig
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:val warningsAsErrors = findProperty("warningsAsErrors") == "true" || isRunningOnCi tasks.withType<KotlinJvmCompile>().configureEach { compilerOptions.allWarningsAsErrors = warningsAsErrors }
Other Changes
- android: Use
ANDROID_BUILD_TOOLS_VERSION
env variable forbuildToolsVersion
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 in Kotlin 1.9
- android: Remove disabling of build features
aidl
,renderScript
andbuildConfig
as they are already disabled by default in new versions of AGP - kotlin: Deprecate accessor
kotlinCompile
.
It is recommended to usekotlin.compilerOptions { ... }
to configure compilation instead. - Update Gradle to
8.9
Dependencies
Dependency | Minimal version |
---|---|
Gradle | 7.4 → 8.0 |
Kotlin Gradle Plugin | 1.7.10 → 1.9.0 |
Android Gradle Plugin | 7.4.0 → 8.4.0 |
infrastructure-kotlin:
- Kotlin
1.8.10
→2.0.0
infrastructure-android:
- Android 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: