Releases: RedMadRobot/gradle-infrastructure
infrastructure 0.13
Change plugins naming convention
Breaking change!
Plugins group changed from redmadrobot
to com.redmadrobot
.
This change allows us to publish infrastructure plugins to Gradle Plugins Portal and make it easier to add plugins to project.
Changing resolutionStrategy
in settings.gradle.kts
is not needed anymore.
To make migration easier, it is allowed to apply plugins with deprecated IDs if you've specified resolutionStrategy
, but it will throw a warning to console.
Switch to multi-modular structure
Breaking change!
Why multi-modular structure?
Until now plugins' structure inside module infrastructure
was looking like this:
Plugin root-project
was used to add configurations for all others plugins.
With such structure all plugins should know about root-project
plugin to access configs, and root-project
should also know about all plugins to hold their configs.
It is possible only if all plugins are declared in the same module with root-project
.
So it was the main stopping factor from breaking infrastructure
to several independent modules.
Multi-modular structure gives important benefits to us:
- Allows modules to be updated independently, allowing users to pick what version of each module they want to use.
- Makes
infrastructure
more scalable.
Because it is not more required to changeroot-project
when adding a new plugin. - Enables to use only "what you want" and don't bring extra dependencies to project.
Since now plugins are separated to modules:
Plugin root-project
is deprecated now and will be removed in further versions.
Extensions are added to project via *-config
plugins (exception is detekt
plugin, so it is designed to be applied to root project).
If you want to get the same behavior as applying root-project
, you can apply all config plugins to the root project:
apply {
id("com.redmadrobot.android-config") version "0.13"
id("com.redmadrobot.publish-config") version "0.13"
id("com.redmadrobot.detekt") version "0.13"
}
Configs behavior changes
*-config
plugins can be applied to any project.
Config from inner project will inherit options from outer project.- Options
redmadrobot.android.test
are inherited fromredmadrobot.test
Dependencies
- Kotlin 1.5.30 -> 1.5.31
- Detekt 1.18.1 -> 1.19.0
Added
- Added repository extension
jitpack()
(#82)
Changed
- Breaking change! Repositories
ossrh
andossrhSnapshots
now use hosts01.oss.sonatype.org
by default.
To keep legacy hostoss.sonatype.org
, useossrh(LEGACY)
instead. - Breaking change! Directory with ProGuard rules now intended to be in
application
project instead of root project. - Default
targetSdk
changed from 30 to 31. - Gradle updated to 7.3.1
Fixed
- Non-Kotlin modules are excluded from checking that the module contains detekt #81
infrastructure 0.12.2
Fixed
- Fixed proguard file detection which was broken after file extensions check was added by @osipxd in #84
Full Changelog: v0.12.1...v0.12.2
infrastructure 0.12.1
Fixed
- Fixed regex to create
detekt[Variant]All
,detektBaseline[Variant]All
when infrastructure root project differs from Gradle root project.
infrastructure 0.12
Dependencies
- Kotlin Gradle Plugin 1.5.20 -> 1.5.30
- Android Gradle Plugin 4.2.1 -> 4.2.2
- Android cache fix Gradle plugin 2.4.0 -> 2.4.3
- detekt 1.17.1 -> 1.18.1
Added
- Plugin
redmadrobot.root-project
now can be applied to any project that should be considered as "root" project for gradle-infrastructure.
It may be useful for projects where you need to apply gradle-infrastructure only to particular subprojects. - Added Detekt tasks
detekt[Variant]All
with type resolution - Added the
detektBaselineAll
task to create a baseline file for Detekt rules. - Added
detektBaseline[Variant]All
tasks to create a baseline file for Detekt rules with type resolution. - Added option
redmadrobot.jvmTarget
to specify target JVM for Kotlin and Java compilers. - Added option
redmadrobot.android.testTasksFilter
to filter tasks that should be run on ':test'.
Changed
- Android libraries' publication moved back to
infrastructure
frominfrastructure-android
. - Use only files with extension
.pro
fromproguard
directory as inputs for R8.
Housekeeping
- Kotlin API version changed from 1.3 to 1.4
- Gradle 7.1.1 -> 7.2
infrastructure 0.11
Dependencies
- Kotlin Gradle Plugin 1.5.10 -> 1.5.20
- JGit 5.11.0 -> 5.12.0
Added
- Added ability to configure
compileSdk
separately fromtargetSdk
- Added ability to configure
buildToolsVersion
for all android modules
Housekeeping
- Update Gradle 7.0.2 -> 7.1.1
- Added KDoc comments to the all plugins
infrastructure 0.10
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:
- Sometimes you don't want to add these dependencies
- Or want to add it with different configuration (for example
compileOnly
instead ofimplementation
)
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
infrastructure 0.9
infrastructure-android
Module infrastructure
no more depends on AGP and doesn't require the google()
repository to be applied.
Plugins redmadrobot.application
and redmadrobot.android-library
was moved to infrastructure-android
module.
You should specify it in settings.gradle.kts to be able to use it:
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "redmadrobot") {
- useModule("com.redmadrobot.build:infrastructure:${requested.version}")
+ useModule("com.redmadrobot.build:infrastructure-android:${requested.version}")
}
}
}
Breaking change!
If you useredmadrobot.android
in the root project, you should add the following import:import com.redmadrobot.build.extension.android
QA build type name
BUILD_TYPE_STAGING
superseded with BUILD_TYPE_QA
.
To keep backward compatibility you can configure QA build type name using project property in gradle.properties
:
redmadrobot.android.build.type.qa=staging
Added
- Apply android-cache-fix plugin to android projects (#44)
Changed
- Updated Gradle 6.8.3 -> 7.0
- Completely removed
jcenter
from repositories (#36)
Fixed
- Flag
warningsAsErrors
now should work.
It is enabled by default on CI.
infrastructure 0.8.2
JCenter only for exclusive content
JCenter is at the end of life and should mot be used anymore.
Now jcenter()
used in gradle-infrastructure
only for exclusive content that not migrated to Maven Central yet.
You can get errors like this:
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.xwray:groupie:2.7.2
Searched in the following locations:
- ...
Required by:
project :app > com.xwray:groupie:2.7.2
To avoid these errors, declare jcenter
repository in your build script and configure it to be used only for missing dependencies.
repositories {
jcenter {
content {
// It is useful to add a link to the issue about migration from JCenter
// https://github.com/lisawray/groupie/issues/384
includeModule("com.xwray", "groupie")
}
}
}
Housekeeping
- Detekt 1.15.0 -> 1.16.0
- Kotlin 1.4.31 -> 1.4.32
- AGP 4.1.2 -> 4.1.3
infrastructure 0.8.1
Fixed
- Add back
jcenter()
fordetekt-formatting
Housekeeping
- Kotlin updated to 1.4.31
infrastructure 0.8
POM Configuration
Now you can configure common for all modules POM properties in redmadrobot.publishing
extension.
There are extension-functions to cover common configuration use-cases.
redmadrobot {
publishing {
pom {
// Configure <url>, <scm> and <issueManagement> tags for GitHub project by it's name
setGitHubProject("RedMadRobot/gradle-infrastructure")
licenses {
mit() // Add MIT license
}
developers {
// Shorthand to add a developer
developer(id = "jdoe", name = "John Dow", email = "john@doe.com")
}
}
}
}
Use publishing
extension in module build script to configure POM for this module.
Take publication name from PUBLICATION_NAME
constant.
publishing {
publications {
getByName<MavenPublication>(PUBLICATION_NAME) {
pom {
// Configure POM here
}
}
}
}
// or even shorter
publishing.publications.getByName<MavenPublication>(PUBLICATION_NAME) {
pom {
// Configure POM here
}
}
Added
- Add javadoc publication for kotlin libraries and gradle plugins
Fixed
- Fixed gradle plugins signing