forked from gciatto/kt-math
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
48 lines (41 loc) · 1.24 KB
/
settings.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
@file:Suppress("UnstableApiUsage")
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
plugins {
id("com.gradle.enterprise") version "3.17.5"
id("org.danilopianini.gradle-pre-commit-git-hooks") version "2.0.7"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
fun tag(
format: String,
vararg properties: String,
): String = format.format(*properties.map { System.getProperty(it) ?: error("Missing property $it") }.toTypedArray())
val ci = !System.getenv("CI").isNullOrBlank()
val ciTag = if (ci) "CI" else "Local"
val osTag = "OS: " + tag("%s (%s) v. %s", "os.name", "os.arch", "os.version")
val jvmTag = "JVM: " + tag("%s v. %s", "java.vm.name", "java.vm.version")
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
tag(ciTag)
tag(osTag)
tag(jvmTag)
publishOnFailure()
buildScanPublished {
if (ci) {
println("::error title=Gradle scan for $osTag, $jvmTag::$buildScanUri")
}
}
}
}
gitHooks {
commitMsg { conventionalCommits() }
createHooks()
}
rootProject.name = "kt-math"