-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
59 lines (52 loc) · 1.85 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
import com.masselis.tpmsadvanced.emulator.EmulatorExtension
import com.masselis.tpmsadvanced.emulator.EmulatorPlugin
import com.masselis.tpmsadvanced.github.GithubExtension
import com.masselis.tpmsadvanced.github.GithubPlugin
import kotlinx.serialization.SerializationException
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
plugins {
gitflow
}
gitflow {
version = libs.versions.app.map { StricSemanticVersion(it) }
developBranch = "origin/develop"
releaseBranch = version.map { "origin/release/${it}" }
hotfixBranch = version.map { "origin/hotfix/${it}" }
mainBranch = "origin/main"
}
val keys = try {
file("secrets/keys.json")
.inputStream()
.use {
@Suppress("OPT_IN_USAGE")
Json.decodeFromStream<Keys>(it)
}
.also { println("Project secrets decrypted") }
.also { extra.set("keys", it) }
} catch (_: SerializationException) {
println("Project secrets encrypted")
null
}
if (keys != null) {
apply<GithubPlugin>()
configure<GithubExtension> {
githubToken = keys.githubToken
currentReleaseTag = gitflow.currentReleaseTag
lastReleaseCommitSha = gitflow.lastReleaseCommitSha
}
}
if (isCI) {
// Why working with a custom emulator gradle plugin while gradle-managed devices exist into the
// AGP ? Because gradle-managed emulators are bound to the lifecycle of the gradle task which
// executes the tests. Because of this, its impossible to fetch screenshots in the end of the
// tests since the emulator is stopped and deleted once the tests are done.
apply<EmulatorPlugin>()
configure<EmulatorExtension> {
emulatorPackage = libs.versions.garunner.emulator.get()
}
}
task<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
subprojects { apply(plugin = "detekt") }