Skip to content

Commit

Permalink
Require at least Gradle 6.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Jun 1, 2021
1 parent 2a52173 commit eb6dffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion api/app-versioning.api
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public final class io/github/reactivecircus/appversioning/AppVersioningExtension

public final class io/github/reactivecircus/appversioning/AppVersioningPlugin : org/gradle/api/Plugin {
public static final field Companion Lio/github/reactivecircus/appversioning/AppVersioningPlugin$Companion;
public static final field MIN_AGP_VERSION Ljava/lang/String;
public fun <init> ()V
public synthetic fun apply (Ljava/lang/Object;)V
public fun apply (Lorg/gradle/api/Project;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import java.util.concurrent.atomic.AtomicBoolean
@Suppress("UnstableApiUsage")
class AppVersioningPlugin : Plugin<Project> {
override fun apply(project: Project) {
val gradleVersion = VersionNumber.parse(project.gradle.gradleVersion)
check(gradleVersion >= VersionNumber.parse(MIN_GRADLE_VERSION)) {
"Android App Versioning Gradle Plugin requires Gradle $MIN_GRADLE_VERSION or later. Detected Gradle version is $gradleVersion."
}
val agpVersion = VersionNumber.parse(ANDROID_GRADLE_PLUGIN_VERSION)
check(agpVersion >= VersionNumber.parse(MIN_AGP_VERSION)) {
"Android App Versioning Gradle Plugin requires Android Gradle Plugin $MIN_AGP_VERSION or later. Detected AGP version is $agpVersion."
Expand Down Expand Up @@ -121,7 +125,8 @@ class AppVersioningPlugin : Plugin<Project> {
}

companion object {
const val MIN_AGP_VERSION = "4.2.1"
private const val MIN_GRADLE_VERSION = "6.8"
private const val MIN_AGP_VERSION = "4.2.1"
}
}

Expand Down

0 comments on commit eb6dffe

Please sign in to comment.