Add gradle versions plugin

This commit is contained in:
Adolfo Santiago 2022-02-19 07:02:00 +01:00
parent bd11774e92
commit ff56c2d78b
No known key found for this signature in database
GPG key ID: 244D6F9A317B4A65
3 changed files with 22 additions and 1 deletions

View file

@ -123,7 +123,7 @@ android {
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation deps.androidx.appCompat
implementation deps.androidx.browser

View file

@ -1,3 +1,5 @@
apply plugin: "com.github.ben-manes.versions"
buildscript {
apply from: "versions.gradle"
apply from: "dependencies.gradle"
@ -9,6 +11,8 @@ buildscript {
dependencies {
classpath deps.androidGradlePlugin
classpath deps.kotlinGradlePlugin
classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
}
}
@ -23,6 +27,16 @@ allprojects {
"-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) {

View file

@ -129,9 +129,16 @@ deps.timber = "com.jakewharton.timber:timber:${versions.timber}"
// Repository handler
static def addRepos(RepositoryHandler handler) {
handler.google()
handler.gradlePluginPortal()
handler.mavenCentral()
handler.maven { url "https://jitpack.io" }
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