Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
AGP_VERSION: ${{ matrix.agp-version }}
strategy:
matrix:
agp-version: [ 7.3.1, 7.4.2, 8.0.2, 8.1.4, 8.2.2, 8.3.2, 8.4.2, 8.5.2, 8.6.1, 8.7.3, 8.8.2, 8.9.2, 8.10.1, 8.11.0-alpha10, 8.12.0-alpha02 ]
agp-version: [ 8.0.2, 8.1.4, 8.2.2, 8.3.2, 8.4.2, 8.5.2, 8.6.1, 8.7.3, 8.8.2, 8.9.2, 8.10.1, 8.11.0-alpha10, 8.12.0-alpha02 ]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Unreleased

No changes yet.
### Changed
- Minimum Android Gradle Plugin version is now **8.0.0**.
- Remove `compileOnly` dependency on `com.android.tools:common` to support future version of AGP.

## 1.4.0

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ This [blogpost](https://dev.to/ychescale9/git-based-android-app-versioning-with-

## Android Gradle Plugin version compatibility

The minimum version of Android Gradle Plugin required is **7.0.0-beta04**.
The minimum version of Android Gradle Plugin required is **8.0.0**.

Version `1.4.0` of the plugin is the final version that's compatible with AGP **7.x** and below.

Version `0.4.0` of the plugin is the final version that's compatible with AGP **4.0** and **4.1**.

Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ val test by tasks.getting(Test::class) {
val fixtureAgpVersion: Provider<String> = providers
.environmentVariable("AGP_VERSION")
.orElse(providers.gradleProperty("AGP_VERSION"))
.orElse(libs.versions.agp.asProvider())
.orElse(libs.versions.agp)

dependencies {
compileOnly(libs.agp.build)
compileOnly(libs.agp.common)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(libs.testParameterInjector)
Expand Down
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
kotlin = "2.1.20"
binaryCompabilityValidator = "0.15.1"
agp = "8.10.1"
agp-common = "31.10.1"
detekt = "1.23.7"
mavenPublish = "0.31.0"
junit = "4.13.2"
Expand All @@ -14,7 +13,6 @@ toolchainsResolver = "0.10.0"
plugin-detektFormatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

agp-build = { module = "com.android.tools.build:gradle", version.ref = "agp" }
agp-common = { module = "com.android.tools:common", version.ref = "agp-common" }
junit = { module = "junit:junit", version.ref = "junit" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
testParameterInjector = { group = "com.google.testparameterinjector", name = "test-parameter-injector", version.ref = "testParameterInjector" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.reactivecircus.appversioning

import com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import com.android.build.api.variant.ApplicationVariant
import com.android.build.gradle.AppPlugin
Expand All @@ -13,7 +12,6 @@ import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.withType
import org.gradle.language.nativeplatform.internal.BuildType
import java.io.File
import java.lang.module.ModuleDescriptor.Version
import java.util.Locale
import java.util.concurrent.atomic.AtomicBoolean

Expand All @@ -23,14 +21,6 @@ import java.util.concurrent.atomic.AtomicBoolean
class AppVersioningPlugin : Plugin<Project> {

override fun apply(project: Project) {
val gradleVersion = Version.parse(project.gradle.gradleVersion)
check(gradleVersion >= Version.parse(MIN_GRADLE_VERSION)) {
"Android App Versioning Gradle Plugin requires Gradle $MIN_GRADLE_VERSION or later. Detected Gradle version is $gradleVersion."
}
val agpVersion = Version.parse(ANDROID_GRADLE_PLUGIN_VERSION)
check(agpVersion >= Version.parse(MIN_AGP_VERSION)) {
"Android App Versioning Gradle Plugin requires Android Gradle Plugin $MIN_AGP_VERSION or later. Detected AGP version is $agpVersion."
}
val androidAppPluginApplied = AtomicBoolean(false)
val pluginDisabled = AtomicBoolean(false)
val appVersioningExtension = project.extensions.create("appVersioning", AppVersioningExtension::class.java)
Expand Down Expand Up @@ -157,10 +147,7 @@ class AppVersioningPlugin : Plugin<Project> {
return replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }
}

companion object {
private const val MIN_GRADLE_VERSION = "6.8"
private const val MIN_AGP_VERSION = "7.0.0-beta04"
}
companion object
}

private const val APP_VERSIONING_TASK_GROUP = "versioning"
Expand Down