generated from CostaFot/android--template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
67 lines (55 loc) · 2.05 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
id("com.github.ben-manes.versions") version "0.29.0"
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
classpath("com.github.ben-manes:gradle-versions-plugin:0.29.0")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.2.0")
classpath("com.google.gms:google-services:4.3.3")
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven(url = "https://jitpack.io")
maven(url = "https://maven.google.com/")
maven(url = "http://dl.bintray.com/piasy/maven")
}
}
tasks.register("clean", Delete::class.java) {
delete(rootProject.buildDir)
}
val dependenciesAndVersions: MutableMap<String, MutableSet<String>> = mutableMapOf()
/*tasks.register("customTask", myplugins.greet.CustomDependencyUpdatesTask::class.java) {
this.resolvedDependencies = dependenciesAndVersions
}*/
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
fun isBetaRc(version: String) = listOf("alpha", "beta", "rc", "cr", "m", "preview", "SNAPSHOT")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*") }
.any { it.matches(version) }
resolutionStrategy {
componentSelection {
all {
if (dependenciesAndVersions.containsKey(candidate.group + ":" + candidate.module))
dependenciesAndVersions[candidate.group + ":" + candidate.module]!!.add(candidate.toString())
else
dependenciesAndVersions[candidate.group + ":" + candidate.module] =
mutableSetOf(candidate.toString())
if (isBetaRc(candidate.version)) {
reject("Release candidate")
}
}
}
}
outputFormatter = "json"
//finalizedBy(tasks.findByName("customTask"))
}