-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
75 lines (67 loc) · 2.68 KB
/
build.gradle.kts
File metadata and controls
75 lines (67 loc) · 2.68 KB
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
68
69
70
71
72
73
74
75
// root build.gradle.kts
import java.util.Properties
import java.io.FileInputStream
buildscript {
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
dependencies {
// Conditional remote dependency, when `buildSrc` is absent.
if (! File(getRootDir().absolutePath + "/buildSrc").exists()) {
classpath("io.syslogic:gpr-maintenance-gradle-plugin:1.0.8")
}
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
}
if (System.getenv("JITPACK") != null || System.getenv("GITHUB_ACTIONS") != null) {
project.ext.set("version_name", System.getenv("VERSION"))
println("> version set to " + System.getenv("VERSION"))
}
/** Modules */
allprojects {
// Keystore Settings, loaded from keystore.properties
val keystoreConfig: File = rootProject.file("keystore.properties")
if (keystoreConfig.exists()) {
val keystore = Properties()
val fis = FileInputStream(keystoreConfig)
keystore.load(fis)
project.ext.set("debugStoreFile", file(System.getProperty("user.home") + "/.android/debug.keystore"))
project.ext.set("debugKeystorePass", keystore["debugKeystorePass"])
project.ext.set("debugKeyAlias", keystore["debugKeyAlias"])
project.ext.set("debugKeyPass", keystore["debugKeyPass"])
project.ext.set("releaseStoreFile", file(System.getProperty("user.home") + "/.android/release.keystore"))
project.ext.set("releaseKeystorePass", keystore["releaseKeystorePass"])
project.ext.set("releaseKeyAlias", keystore["releaseKeyAlias"])
project.ext.set("releaseKeyPass", keystore["releaseKeyPass"])
fis.close()
} else {
println("file missing: $keystoreConfig")
}
/** Runtime JAR files in the classpath should have the same version. */
configurations.configureEach {
val list: List<String> = listOf("kotlin-stdlib", "kotlin-stdlib-jdk8", "kotlin-stdlib-common")
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
if (list.contains(requested.name)) {
useVersion(libs.versions.kotlin.get())
}
}
}
}
/** When projects were evaluated */
gradle.projectsEvaluated {
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(
listOf("-Xlint:unchecked", "-Xlint:deprecation")
)
}
}
}
// rootProject > clean
tasks.withType<Delete>().configureEach {
delete(rootProject.fileTree("build"), project.fileTree("build"))
}