Add gradle versions plugin
This commit is contained in:
parent
bd11774e92
commit
ff56c2d78b
3 changed files with 22 additions and 1 deletions
|
@ -123,7 +123,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
|
||||||
|
|
||||||
implementation deps.androidx.appCompat
|
implementation deps.androidx.appCompat
|
||||||
implementation deps.androidx.browser
|
implementation deps.androidx.browser
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
apply plugin: "com.github.ben-manes.versions"
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
apply from: "versions.gradle"
|
apply from: "versions.gradle"
|
||||||
apply from: "dependencies.gradle"
|
apply from: "dependencies.gradle"
|
||||||
|
@ -9,6 +11,8 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath deps.androidGradlePlugin
|
classpath deps.androidGradlePlugin
|
||||||
classpath deps.kotlinGradlePlugin
|
classpath deps.kotlinGradlePlugin
|
||||||
|
|
||||||
|
classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +27,16 @@ allprojects {
|
||||||
"-Xlint:-deprecation",
|
"-Xlint:-deprecation",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: com.github.benmanes.gradle.versions.VersionsPlugin
|
||||||
|
|
||||||
|
tasks.named("dependencyUpdates").configure {
|
||||||
|
gradleReleaseChannel = "current"
|
||||||
|
|
||||||
|
rejectVersionIf {
|
||||||
|
isNonStable(it.candidate.version)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|
|
@ -129,9 +129,16 @@ deps.timber = "com.jakewharton.timber:timber:${versions.timber}"
|
||||||
// Repository handler
|
// Repository handler
|
||||||
static def addRepos(RepositoryHandler handler) {
|
static def addRepos(RepositoryHandler handler) {
|
||||||
handler.google()
|
handler.google()
|
||||||
|
handler.gradlePluginPortal()
|
||||||
handler.mavenCentral()
|
handler.mavenCentral()
|
||||||
handler.maven { url "https://jitpack.io" }
|
handler.maven { url "https://jitpack.io" }
|
||||||
handler.maven { url "https://plugins.gradle.org/m2/" }
|
handler.maven { url "https://plugins.gradle.org/m2/" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static def isNonStable(String version) {
|
||||||
|
def stableKeyword = ["a", "alpha", "beta", "final", "ga", "m", "release", "rc"].any { it -> version.toLowerCase().contains(it) }
|
||||||
|
return stableKeyword
|
||||||
|
}
|
||||||
|
|
||||||
|
ext.isNonStable = this.&isNonStable
|
||||||
ext.addRepos = this.&addRepos
|
ext.addRepos = this.&addRepos
|
||||||
|
|
Loading…
Reference in a new issue