-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
60 lines (55 loc) · 2.28 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
buildscript {
extra["buildConfig"] = mapOf(
"compileSdk" to AndroidConfig.COMPILE_SDK_VERSION,
"minSdk" to AndroidConfig.MIN_SDK_VERSION,
"targetSdk" to AndroidConfig.TARGET_SDK_VERSION,
"buildTools" to AndroidConfig.BUILD_TOOLS_VERSION
)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(buildcfg.Deps.ComAndroidToolsBuild.gradle)
classpath(buildcfg.Deps.ComGithubBenManes.gradleVersionsPlugin)
classpath(buildcfg.Deps.ComGoogle.GMS.googleServices)
classpath(buildcfg.Deps.ComVanniktech.gradleMavenPublishPlugin)
classpath(buildcfg.Deps.OrgJetBrains.Kotlin.kotlinGradlePlugin)
}
}
subprojects {
version = project.property("VERSION_NAME")!!
group = project.property("GROUP")!!
repositories {
google()
mavenCentral()
}
// https://kotlinlang.org/docs/gradle.html#compiler-options
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = buildcfg.Versions.JAVA_VERSION_STR
// Sets up Kotlin’s Java interoperability to strictly follow JSR-305 annotations for increased null safety.
freeCompilerArgs = listOf("-Xjsr305=strict")
// Treat all Kotlin warnings as errors
allWarningsAsErrors = false
}
}
}
apply(plugin = buildcfg.Deps.ComGithubBenManes.gradleVersionsPluginName)
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
checkForGradleUpdate = false
outputFormatter = "plain,html"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
// report only stable versions:
fun isStable(version: String): Boolean {
val stableKeyword = version.toUpperCase() in setOf("RELEASE", "FINAL", "GA")
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
return stableKeyword || regex.matches(version)
}
rejectVersionIf { isStable(this.currentVersion) && !isStable(this.candidate.version) }
// In other words, if the lib uses stable release, we'll get update only on stable versions.
// If the lib uses any non-stable (alpha/beta/RC), we'll get update about the newer non-stable.
}
apply(from = file("$rootDir/gradle/gradleLog.gradle"))