Skip to content

infrastructure 0.10

Compare
Choose a tag to compare
@osipxd osipxd released this 31 May 19:03
6699360

Lazy Configuration

Breaking change!

RedmadrobotExtension migrated to lazy properties API.
Now all extension fields are properties.
You should use method .set(value) instead of assignment operator = to assign value.

redmadrobot {
    android {
-       minApi = 26
+       minApi.set(26)
    }
}

This change helps us to check the Redmadrobot extension not used before it was configured.

Plugins no more add Kotlin dependencies

Breaking change!

Previously plugins kotlin-library, android-library and application used to add kotlin-stdlib-jdk8 and kotlin-test dependencies by default.
It was a problem because:

  1. Sometimes you don't want to add these dependencies
  2. Or want to add it with different configuration (for example compileOnly instead of implementation)

gradle-infrastructure should add only options valid for all our projects or default options that can be changed if needed.
Default applied dependencies can't be removed if needed, so they should not be applied by default.

Another problem is redmadrobot.kotlinVersion.

Option redmadrobot.kotlinVersion is deprecated since this version and will not take any effect.

We've introduced this option to make it possible to change version of default kotlin dependencies.
This option affects only dependencies added by gradle-infrastructure, not all Kotlin dependencies, and it is confusing.
Moreover, this version does not affect Kotlin Gradle Plugin because it uses version specified in gradle-infrastructure at compilation time.

A more convenient way to align the Kotlin version for all dependencies including transitive ones is to use kotlin-bom:

dependencies {
    // Align versions of all Kotlin components 
    implementation(platform(kotlin("bom", version = "1.5.10")))

    // Now you can add Kotlin components without version
    implementation(kotlin("stdlib-jdk8"))
    testImplementation(kotlin("test-junit5"))
}

Added

  • Specified default location for Detekt baseline: $configsDir/detekt/baseline.xml
  • Added the ability to check the Detekt only on changed files (#40).

Changed

  • Update Gradle 7.0 -> 7.0.2
  • Flag publishing.signArtifacts affects all artifacts not only the main one
  • Method test.useJunit() can take lambda to configure JUnit framework
  • Accessor redmadrobot.android can be used without imports
  • RedmadrobotExtension is extension-aware since now
  • Breaking change! All extensions and constants moved to package com.redmadrobot.build.dsl to make it possible to import all extensions via single import

Fixed

  • Publication not configured when redmadrobot.publish applied before other plugins
  • Look at flag gradlePlugin.isAutomatedPublishing when configuring gradle plugin publication

Dependencies

  • Update Kotlin 1.4.32 -> 1.5.10
  • Update AGP 4.1.3 -> 4.2.1
  • Update Detekt 1.16.0 -> 1.17.1