Releases: RedMadRobot/gradle-infrastructure
v0.19.1
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:
v0.18.1
v0.18
Kotlin Gradle Plugin and Android Gradle Plugin removed from transitive dependencies
⚠️ BREAKING CHANGE!
It should be simple to change KGP and APG versions, no matter what versions were used on gradle-infrastructure compilation. Previously it was hard to update gradle-infrastructure without updating AGP and KGP, and also it was hard to downgrade AGP or KGP if it was needed.
Since now, KGP and AGP removed from transitive dependencies, and you should add it to your project manually. You can use two different approaches to do it:
-
Add AGP and KGP to top-level
build.gradle.kts
withapply false
// (root)/build.gradle.kts plugins { // Use `apply false` in the top-level build.gradle file to add a Gradle // plugin as a build dependency but not apply it to the current (root) project. // Here you can specify desired AGP and KGP versions to use. id("com.android.application") version "7.4.2" apply false id("org.jetbrains.kotlin.android") version "1.8.10" apply false }
-
If you have
buildSrc
or some other module containing build logic, you can add AGP and KGP todependencies
of this module:// (root)/buildSrc/build.gradle.kts dependencies { // Here you can specify desired AGP and KGP versions to use. implementation(kotlin("gradle-plugin", version = "1.8.10")) implementation("com.android.tools.build:gradle:7.4.2") }
Minimal required AGP and KGP will always be specified in README.
BREAKING CHANGES
- android: Fixed obfuscation on QA builds with AGP 7.2+ (#120)
- android: Default
targetSdk
changed from32
to33
- android: Don't set
targetSdk
in library modules. This field is deprecated and doesn't take any effect since AGP 7.4 (b/230625468) - android: Removed default
resourceConfigurations
. UseresourceConfigurations.add("ru")
if you want to keep old behavior (#115) - Change default target JVM from 1.8 to 11 (property
redmadrobot.jvmTarget
)
Other changes
- android: Removed workaround for b/215407138 that is fixed in AGP 7.4
- publish: More detailed description for the case when plugin cannot recognize project type (#116)
- Update Gradle to 8.0.2
Dependencies
infrastructure-kotlin:
- Kotlin
1.7.10
→1.8.10
infrastructure-android:
- Android Gradle Plugin
7.2.1
→7.4.2
(:warning: Minimal required AGP version is7.4.0
) - Android cache fix Gradle plugin
2.5.6
→2.7.0
infrastructure-detekt:
Full Changelog: v0.17...v0.18
v0.17
Be careful if you use detekt with type resolution!
This version updates Kotlin to 1.7.10, which is not supported by type resolution mode in detekt.
Detekt will support Kotlin 1.7.10 in 1.22.0
Changed
- android: Default
minSdk
changed from21
to23
(POTENTIALLY BREAKING CHANGE) - android: Change target JDK for plugins from 8 to 11
- Update Gradle to 7.5
Fixed
- Make flag
redmadrobot.add.repositories
work also forcom.redmadrobot.detekt
plugin (#104)
Dependencies
- Kotlin Gradle Plugin
1.6.10
→1.7.10
- Android Gradle Plugin
7.1.3
->7.2.1
- Android cache fix Gradle plugin
2.5.1
→2.5.6
- Detekt
1.20.0
→1.21.0
- JGit
6.1.0
→6.2.0
Full Changelog: v0.16.2...v0.17
infrastructure 0.16.2
Fixed
- Defaults from parent project are not applied to project (#107)
Full Changelog: v0.16.1...v0.16.2
infrastructure 0.16.1
Added
- Ability to disable automatic repositories adding using project property
redmadrobot.add.repositories
(#104)
Fixed
- Extension
test
will no longer expose internal typeTestOptionsImpl
(#105)
Full Changelog: v0.16...v0.16.1
infrastructure 0.16
Added
- publish: Check if a publication can be configured automatically for the project
- android: Add files from
proguard/
directory toconsumerProguardFiles
inandroid-library
modules (#101)
Changed
- android: Default target API changed to 32
- android: Lint results location now configured only for
application
modules.
Lint running will no longer conflict inandroid-library
modules (#102) - publish: Migrate android-library publication to the new publishing API introduced in AGP 7.1
- Revert change from 0.15 when
isRunningOnCi
were made extension onProject
Housekeeping
- Added
@InternalGradleInfrastructureApi
annotation to all API that not intended for public use - Added missing KDocs for all public classes
Dependencies
- Android Gradle Plugin
7.0.4
→7.1.3
- Android cache fix Gradle plugin
2.4.6
→2.5.1
- detekt
1.19.0
→1.20.0
- plugin-publish-plugin
0.19.0
→0.21.0
- JGit
6.0.0
→6.1.0
Full Changelog: v0.15...v0.16
infrastructure 0.15
Added
- Shortcuts for easy access to QA build type:
android { buildTypes { qa { // ... } } }
- Apply Lint settings to android-library modules (#98)
- Configuration caching support (experimental)
- Version catalogs publication via
com.redmadrobot.publish
(#100)
Changed
- Breaking change: property
isRunningOnCi
changed to an extension-property onProject
for configuration caching support - Switch to experimental API added in AGP 7.0.0
- Changed QA build type fallbacks from
[release]
to[debug, release]
Fixed
- Fixed error when trying to override
jvmTarget
orandroid
options in subprojects - Use
jvmTarget
for java target and source compatibility (#93)
Dependencies
- Android Gradle Plugin 7.0.3 -> 7.0.4
- Android cache fix Gradle plugin 2.4.5 -> 2.4.6
Full Changelog: v0.14...v0.15
infrastructure 0.14
Dependencies
- Android Gradle Plugin 4.2.2 -> 7.0.3
- Android cache fix Gradle plugin 2.4.3 -> 2.4.5
- Kotlin 1.5.31 -> 1.6.10
- JGit 5.12.0 -> 6.0.0
Added
- Added workaround for the case when detekt ignores kotlin sources when run on Android project with type resolution (detekt/detekt#4177)