From eb55b7d0e4c769e4b981fbfd0e6697fb2b8003eb Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Thu, 1 Aug 2024 15:10:47 +0200 Subject: [PATCH 1/5] build: Configure repositories --- buildSrc/settings.gradle.kts | 8 ++++---- settings.gradle.kts | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index b57d1fe..e03909c 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -8,14 +8,14 @@ pluginManagement { @Suppress("UnstableApiUsage") dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { google { content { - includeGroupByRegex("com\\.android.*") - includeGroupByRegex("com\\.google.*") - includeGroupByRegex("androidx.*") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + includeGroupAndSubgroups("androidx") } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 9b39368..e186382 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,13 +1,28 @@ pluginManagement { repositories { - google() + google { + content { + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + includeGroupAndSubgroups("androidx") + } + } gradlePluginPortal() } } @Suppress("UnstableApiUsage") dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + repositories { + google { + content { + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + includeGroupAndSubgroups("androidx") + } + } mavenCentral() } From 6fb3907a669aa0150f6b65c65899ac4ecf2b48bd Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Thu, 1 Aug 2024 15:24:54 +0200 Subject: [PATCH 2/5] build: gradle-infrastructure 0.19.1 --- buildSrc/build.gradle.kts | 9 ++------- buildSrc/settings.gradle.kts | 2 +- .../src/main/kotlin/convention.detekt.gradle.kts | 10 ---------- buildSrc/src/main/kotlin/convention.jvm.gradle.kts | 14 ++++++++++++++ .../kotlin/convention.library.android.gradle.kts | 14 +++++++++++--- .../kotlin/convention.library.kotlin.gradle.kts | 7 ++++++- .../main/kotlin/convention.library.ktx.gradle.kts | 8 +++----- gears/gears-compose/build.gradle.kts | 6 ++---- settings.gradle.kts | 9 +++++++-- 9 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 buildSrc/src/main/kotlin/convention.jvm.gradle.kts diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 444e72f..1375f3d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -2,13 +2,8 @@ plugins { `kotlin-dsl` } -tasks.withType { - kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString() -} - -java { - targetCompatibility = JavaVersion.VERSION_11 - sourceCompatibility = JavaVersion.VERSION_11 +kotlin { + jvmToolchain(11) } dependencies { diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index e03909c..4674cb1 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -24,7 +24,7 @@ dependencyResolutionManagement { } versionCatalogs { - val version = "2024.04.10" + val version = "2024.08.01" create("rmr") { from("com.redmadrobot.versions:versions-redmadrobot:$version") } diff --git a/buildSrc/src/main/kotlin/convention.detekt.gradle.kts b/buildSrc/src/main/kotlin/convention.detekt.gradle.kts index aeb9fb0..135d26e 100644 --- a/buildSrc/src/main/kotlin/convention.detekt.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.detekt.gradle.kts @@ -1,17 +1,7 @@ -import io.gitlab.arturbosch.detekt.Detekt -import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask - plugins { id("io.gitlab.arturbosch.detekt") } -tasks.withType().configureEach { - jvmTarget = JavaVersion.VERSION_11.toString() -} -tasks.withType().configureEach { - jvmTarget = JavaVersion.VERSION_11.toString() -} - dependencies { //noinspection UseTomlInstead detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.6") diff --git a/buildSrc/src/main/kotlin/convention.jvm.gradle.kts b/buildSrc/src/main/kotlin/convention.jvm.gradle.kts new file mode 100644 index 0000000..8323d88 --- /dev/null +++ b/buildSrc/src/main/kotlin/convention.jvm.gradle.kts @@ -0,0 +1,14 @@ +import com.redmadrobot.build.dsl.isRunningOnCi +import org.jetbrains.kotlin.gradle.dsl.kotlinExtension +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile + +kotlinExtension.jvmToolchain(11) + +// Treat all warnings as errors on CI +val warningsAsErrors = findProperty("warningsAsErrors") == "true" || isRunningOnCi + +tasks.withType().configureEach { + compilerOptions { + allWarningsAsErrors = warningsAsErrors + } +} diff --git a/buildSrc/src/main/kotlin/convention.library.android.gradle.kts b/buildSrc/src/main/kotlin/convention.library.android.gradle.kts index d447089..5db3dd9 100644 --- a/buildSrc/src/main/kotlin/convention.library.android.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.library.android.gradle.kts @@ -1,9 +1,17 @@ plugins { - id("com.redmadrobot.android-library") + id("com.android.library") + kotlin("android") + id("org.gradle.android.cache-fix") + id("convention.jvm") id("convention.publishing") id("convention.detekt") } -redmadrobot { - android.minSdk = 19 +android { + compileSdk = 34 + defaultConfig.minSdk = 19 +} + +kotlin { + explicitApi() } diff --git a/buildSrc/src/main/kotlin/convention.library.kotlin.gradle.kts b/buildSrc/src/main/kotlin/convention.library.kotlin.gradle.kts index ff378c7..dd34c14 100644 --- a/buildSrc/src/main/kotlin/convention.library.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.library.kotlin.gradle.kts @@ -1,5 +1,10 @@ plugins { - id("com.redmadrobot.kotlin-library") + kotlin("jvm") + id("convention.jvm") id("convention.publishing") id("convention.detekt") } + +kotlin { + explicitApi() +} diff --git a/buildSrc/src/main/kotlin/convention.library.ktx.gradle.kts b/buildSrc/src/main/kotlin/convention.library.ktx.gradle.kts index b99182f..20b01ff 100644 --- a/buildSrc/src/main/kotlin/convention.library.ktx.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.library.ktx.gradle.kts @@ -1,11 +1,9 @@ -import com.redmadrobot.build.dsl.kotlinCompile - plugins { id("convention.library.android") } -kotlinCompile { - kotlinOptions { - moduleName = "redmadrobot.${project.name}" +kotlin { + compilerOptions { + "redmadrobot.${project.name}" } } diff --git a/gears/gears-compose/build.gradle.kts b/gears/gears-compose/build.gradle.kts index 124121e..ff830c5 100644 --- a/gears/gears-compose/build.gradle.kts +++ b/gears/gears-compose/build.gradle.kts @@ -5,13 +5,11 @@ plugins { version = "0.1.0" description = "A set of gears for compose" -redmadrobot { - android.minSdk = 21 -} - android { namespace = "$group.compose" + defaultConfig.minSdk = 21 + buildFeatures { compose = true } diff --git a/settings.gradle.kts b/settings.gradle.kts index e186382..e539fbb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("UnstableApiUsage", "StringLiteralDuplication") + pluginManagement { repositories { google { @@ -11,7 +13,10 @@ pluginManagement { } } -@Suppress("UnstableApiUsage") +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + dependencyResolutionManagement { repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS @@ -27,7 +32,7 @@ dependencyResolutionManagement { } versionCatalogs { - val version = "2024.04.10" + val version = "2024.08.01" create("rmr") { from("com.redmadrobot.versions:versions-redmadrobot:$version") } From 0fc11983b78ba4d7f7da780439649425e4f6a201 Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Thu, 1 Aug 2024 16:52:02 +0200 Subject: [PATCH 3/5] build: Update compose compiler --- buildSrc/build.gradle.kts | 2 +- gears/gears-compose/build.gradle.kts | 9 +-------- gradle/libs.versions.toml | 6 ++---- viewmodelevents/viewmodelevents-compose/build.gradle.kts | 9 +-------- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 1375f3d..9d70531 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -13,5 +13,5 @@ dependencies { implementation(stack.gradle.android.cacheFixGradlePlugin) implementation(stack.kotlin.gradlePlugin) implementation(stack.detekt.gradlePlugin) - implementation(libs.android.gradlePlugin) + implementation(stack.android.tools.build.gradle) } diff --git a/gears/gears-compose/build.gradle.kts b/gears/gears-compose/build.gradle.kts index ff830c5..94aa0f1 100644 --- a/gears/gears-compose/build.gradle.kts +++ b/gears/gears-compose/build.gradle.kts @@ -1,5 +1,6 @@ plugins { convention.library.android + alias(stack.plugins.kotlin.compose) } version = "0.1.0" @@ -9,14 +10,6 @@ android { namespace = "$group.compose" defaultConfig.minSdk = 21 - - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } } dependencies { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1302371..87d03c8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,11 @@ [versions] -androidGradlePlugin = "8.4.1" assertj-core = "3.25.1" androidx-arch-core = "2.2.0" -viewbinding = "8.4.1" -publish-plugin = "0.28.0" +viewbinding = "8.5.1" +publish-plugin = "0.29.0" [libraries] androidx-viewbinding = { module = "androidx.databinding:viewbinding", version.ref = "viewbinding" } assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" } androidx-arch-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "androidx-arch-core"} -android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" } publish-gradlePlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish-plugin" } diff --git a/viewmodelevents/viewmodelevents-compose/build.gradle.kts b/viewmodelevents/viewmodelevents-compose/build.gradle.kts index 813fe4c..e5738ca 100644 --- a/viewmodelevents/viewmodelevents-compose/build.gradle.kts +++ b/viewmodelevents/viewmodelevents-compose/build.gradle.kts @@ -1,19 +1,12 @@ plugins { convention.library.android + alias(stack.plugins.kotlin.compose) } description = "ViewModelEvents extensions for compose" android { namespace = "$group.compose" - - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } } dependencies { From 85845273ce027277d16104e50a2817ac454c4b73 Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Thu, 1 Aug 2024 17:30:20 +0200 Subject: [PATCH 4/5] android: Change minSdk from 19 to 21 --- .../src/main/kotlin/convention.library.android.gradle.kts | 2 +- gears/gears-compose/build.gradle.kts | 2 -- ktx/core-ktx/CHANGELOG.md | 3 +++ ktx/fragment-args-ktx/CHANGELOG.md | 3 +++ ktx/fragment-ktx/CHANGELOG.md | 4 ++++ ktx/lifecycle-livedata-ktx/CHANGELOG.md | 1 + ktx/resources-ktx/CHANGELOG.md | 1 + ktx/viewbinding-ktx/CHANGELOG.md | 4 ++++ 8 files changed, 17 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/convention.library.android.gradle.kts b/buildSrc/src/main/kotlin/convention.library.android.gradle.kts index 5db3dd9..fee1f3d 100644 --- a/buildSrc/src/main/kotlin/convention.library.android.gradle.kts +++ b/buildSrc/src/main/kotlin/convention.library.android.gradle.kts @@ -9,7 +9,7 @@ plugins { android { compileSdk = 34 - defaultConfig.minSdk = 19 + defaultConfig.minSdk = 21 } kotlin { diff --git a/gears/gears-compose/build.gradle.kts b/gears/gears-compose/build.gradle.kts index 94aa0f1..2a86146 100644 --- a/gears/gears-compose/build.gradle.kts +++ b/gears/gears-compose/build.gradle.kts @@ -8,8 +8,6 @@ description = "A set of gears for compose" android { namespace = "$group.compose" - - defaultConfig.minSdk = 21 } dependencies { diff --git a/ktx/core-ktx/CHANGELOG.md b/ktx/core-ktx/CHANGELOG.md index 7042078..815fa92 100644 --- a/ktx/core-ktx/CHANGELOG.md +++ b/ktx/core-ktx/CHANGELOG.md @@ -1,5 +1,8 @@ ## Unreleased +### Changes + +- `minSdk` version changed 19 → 21 - **SharedPreferences**: Removed nullable accessors with default parameter - **Context**: Added `Context.findActivity()` and `Context.findWindow()` extensions diff --git a/ktx/fragment-args-ktx/CHANGELOG.md b/ktx/fragment-args-ktx/CHANGELOG.md index 3dc0052..a8c5e8d 100644 --- a/ktx/fragment-args-ktx/CHANGELOG.md +++ b/ktx/fragment-args-ktx/CHANGELOG.md @@ -1,5 +1,8 @@ ## Unreleased +### Changes + +- `minSdk` version changed 19 → 21 - **Bundle**: Removed nullable accessors with default parameter - **Bundle**: Accessors for `Serializable` and `Parcelizable` are turned into inline-functions diff --git a/ktx/fragment-ktx/CHANGELOG.md b/ktx/fragment-ktx/CHANGELOG.md index 50a7ac0..9cf5558 100644 --- a/ktx/fragment-ktx/CHANGELOG.md +++ b/ktx/fragment-ktx/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased +### Changes + +- `minSdk` version changed 19 → 21 + ## [1.3.6-0] (2021-10-02) ### Dependencies diff --git a/ktx/lifecycle-livedata-ktx/CHANGELOG.md b/ktx/lifecycle-livedata-ktx/CHANGELOG.md index dc09a5a..b342011 100644 --- a/ktx/lifecycle-livedata-ktx/CHANGELOG.md +++ b/ktx/lifecycle-livedata-ktx/CHANGELOG.md @@ -2,6 +2,7 @@ ### Changes +- `minSdk` version changed 19 → 21 - **Breaking change!** `EventQueue` has been moved to a separate module and renamed to `ViewModelEvents`. See the appropriate [documentation](../../viewmodelevents/README.md) ### Dependencies diff --git a/ktx/resources-ktx/CHANGELOG.md b/ktx/resources-ktx/CHANGELOG.md index 9dd5601..6a59c0e 100644 --- a/ktx/resources-ktx/CHANGELOG.md +++ b/ktx/resources-ktx/CHANGELOG.md @@ -2,6 +2,7 @@ ### Changed +- `minSdk` version changed 19 → 21 - **Breaking change**: `Text` moved to a separate library [com.redmadrobot.textvalue](https://github.com/RedMadRobot/TextValue). ## [1.3.1-0] (2021-10-03) diff --git a/ktx/viewbinding-ktx/CHANGELOG.md b/ktx/viewbinding-ktx/CHANGELOG.md index b0609f9..003d746 100644 --- a/ktx/viewbinding-ktx/CHANGELOG.md +++ b/ktx/viewbinding-ktx/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased +### Changes + +- `minSdk` version changed 19 → 21 + ### Dependencies - androidx.fragment 1.3.5 -> 1.3.6 From 4c95da0491bc73118b39b215aa659280634dafba Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Thu, 1 Aug 2024 17:31:15 +0200 Subject: [PATCH 5/5] gears: Fix modules description --- gears/gears-compose/README.md | 5 +++-- gears/gears-compose/build.gradle.kts | 2 +- gears/gears-kotlin/README.md | 5 +++-- gears/gears-kotlin/build.gradle.kts | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gears/gears-compose/README.md b/gears/gears-compose/README.md index ca6c959..1afb7d0 100644 --- a/gears/gears-compose/README.md +++ b/gears/gears-compose/README.md @@ -1,7 +1,10 @@ # gears-compose + [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/gears-compose?style=flat-square)][mavenCentral] [![License](https://img.shields.io/github/license/RedMadRobot/gears-android?style=flat-square)][license] +A set of gears for Jetpack Compose. + --- @@ -12,8 +15,6 @@ -A set of gears for compose. - ## Installation Add the dependency: diff --git a/gears/gears-compose/build.gradle.kts b/gears/gears-compose/build.gradle.kts index 2a86146..040c0bb 100644 --- a/gears/gears-compose/build.gradle.kts +++ b/gears/gears-compose/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } version = "0.1.0" -description = "A set of gears for compose" +description = "A set of gears for Jetpack Compose" android { namespace = "$group.compose" diff --git a/gears/gears-kotlin/README.md b/gears/gears-kotlin/README.md index 219bcee..075e7e1 100644 --- a/gears/gears-kotlin/README.md +++ b/gears/gears-kotlin/README.md @@ -1,7 +1,10 @@ # gears-kotlin + [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square)][mavenCentral] [![License](https://img.shields.io/github/license/RedMadRobot/gears-android?style=flat-square)][license] +A set of gears for Kotlin. + --- @@ -12,8 +15,6 @@ -A set of gears for kotlin. - ## Installation Add the dependency: diff --git a/gears/gears-kotlin/build.gradle.kts b/gears/gears-kotlin/build.gradle.kts index 9feb1c7..28dbff1 100644 --- a/gears/gears-kotlin/build.gradle.kts +++ b/gears/gears-kotlin/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } version = "0.1.0" -description = "A set of gears for kotlin" +description = "A set of gears for Kotlin" dependencies { api(kotlin("stdlib"))