-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle.kts
executable file
·62 lines (53 loc) · 1.83 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
ext {
this["compileVersion"] = 29
this["minVersion"] = 16
this["targetVersion"] = 29
this["buildTools"] = "29.0.1"
this["tests"] = HashMap<String, Any>().apply {
this["support-runner"] = "com.android.support.test:runner:1.0.2"
}
this["appcompat"] = "com.android.support:appcompat-v7:28.0.0"
this["androidx"] = "androidx.appcompat:appcompat:1.0.2"
this["gson"] = "com.google.code.gson:gson:2.8.5"
}
val commonConfigure = project.file(".scripts/common_configure.gradle.kts")
val publishProject = project.file(".scripts/publish.gradle.kts")
val localMode = project.findProperty("brouter.localMode") == "true"
subprojects {
repositories {
if (localMode) {
mavenLocal()
}
google()
jcenter()
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
apply(from = commonConfigure)
if (!name.contains("-stub-") && name.startsWith("brouter-")) {
apply(from = publishProject)
}
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}
tasks.register("publishAll") {
val appcompat = System.getProperty("brouter.appcompat") == "true"
val compats = setOf("brouter-api-appcompat", "brouter-apt-appcompat", "brouter-core-appcompat")
group = "publishing"
subprojects {
if (name.startsWith("brouter-") && !name.contains("stub")) {
if (localMode) {
dependsOn(tasks.named("publishBintrayPublicationToMavenLocal"))
} else {
if (!appcompat || name in compats) {
dependsOn(tasks.named("bintrayUpload"))
}
if (!appcompat && name == "brouter-gradle-plugin") {
dependsOn(tasks.named("publishPlugins"))
}
}
}
}
}