Skip to content

Releases: RedMadRobot/gradle-infrastructure

v0.19.1

31 Jul 14:19
0c0e1ca
Compare
Choose a tag to compare

Fixes

  • Fixed package of the extension SigningConfig.fromProperties.
    dslcom.redmadrobot.build.dsl

v0.19

26 Jul 09:12
e39f2f1
Compare
Choose a tag to compare

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 level Error.
    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 your build.gradle.kts should be enough:
    kotlin {
        jvmToolchain(17)
    }
    You can also configure automatic toolchains downloading.
  • 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:
    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 in gradle.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 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:
    val warningsAsErrors = findProperty("warningsAsErrors") == "true" || isRunningOnCi
    tasks.withType<KotlinJvmCompile>().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 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.9

Dependencies

Dependency Minimal version
Gradle 7.48.0
Kotlin Gradle Plugin 1.7.101.9.0
Android Gradle Plugin 7.4.08.4.0

infrastructure-kotlin:

infrastructure-android:

  • Android Gradle Plugin 7.4.28.5.1
  • Remove android-cache-fix-gradle-plugin from dependencies
  • Remove com.android.tools:common from dependencies

infrastructure-detekt:

v0.18.1

18 Apr 04:29
fb93711
Compare
Choose a tag to compare
  • Fix compatibility with Gradle lower than 8.0 (#127)
  • Update Gradle to 8.1

Full Changelog: v0.18...v0.18.1

v0.18

07 Mar 10:22
20252f5
Compare
Choose a tag to compare

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:

  1. Add AGP and KGP to top-level build.gradle.kts with apply 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
    }
  2. If you have buildSrc or some other module containing build logic, you can add AGP and KGP to dependencies 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 from 32 to 33
  • 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. Use resourceConfigurations.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:

infrastructure-android:

infrastructure-detekt:

Full Changelog: v0.17...v0.18

v0.17

29 Jul 19:21
2837c07
Compare
Choose a tag to compare

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 from 21 to 23 (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 for com.redmadrobot.detekt plugin (#104)

Dependencies

Full Changelog: v0.16.2...v0.17

infrastructure 0.16.2

17 Jun 11:21
5ff9de9
Compare
Choose a tag to compare

Fixed

  • Defaults from parent project are not applied to project (#107)

Full Changelog: v0.16.1...v0.16.2

infrastructure 0.16.1

17 Jun 07:20
b06f08e
Compare
Choose a tag to compare

Added

  • Ability to disable automatic repositories adding using project property redmadrobot.add.repositories (#104)

Fixed

  • Extension test will no longer expose internal type TestOptionsImpl (#105)

Full Changelog: v0.16...v0.16.1

infrastructure 0.16

25 Apr 08:02
f3d1f70
Compare
Choose a tag to compare

Added

  • publish: Check if a publication can be configured automatically for the project
  • android: Add files from proguard/ directory to consumerProguardFiles in android-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 in android-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 on Project

Housekeeping

  • Added @InternalGradleInfrastructureApi annotation to all API that not intended for public use
  • Added missing KDocs for all public classes

Dependencies

Full Changelog: v0.15...v0.16

infrastructure 0.15

20 Jan 16:01
25b4bee
Compare
Choose a tag to compare

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 on Project 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 or android 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

10 Jan 06:48
f9fb3d2
Compare
Choose a tag to compare

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)