forked from SagerNet/SagerNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
56 lines (50 loc) · 1.78 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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
apply(from = "${rootProject.projectDir}/repositories.gradle.kts")
apply(plugin = "com.github.ben-manes.versions")
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
val regex = listOf(
"alpha", "beta", "rc", "cr", "m", "preview", "b", "ea"
).map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-+]*") }
resolutionStrategy {
componentSelection {
all {
val rejected = regex.any {
it.matches(candidate.version)
} && regex.all {
!it.matches(
currentVersion
)
}
if (rejected) {
reject("Release candidate")
}
}
}
}
// optional parameters
checkForGradleUpdate = false
outputFormatter = "json"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}
subprojects {
// skip uploading the mapping to Crashlytics
tasks.whenTaskAdded {
if (name.contains("uploadCrashlyticsMappingFile")) enabled = false
}
}
tasks.named<Wrapper>("wrapper") {
distributionType = Wrapper.DistributionType.ALL
doLast {
val sha256 = java.net.URL("$distributionUrl.sha256")
.openStream()
.use { it.reader().readText().trim() }
file("gradle/wrapper/gradle-wrapper.properties").appendText("distributionSha256Sum=$sha256")
}
}