-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
57 lines (47 loc) ยท 1.41 KB
/
build.gradle.kts
File metadata and controls
57 lines (47 loc) ยท 1.41 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
import java.util.Properties
plugins {
kotlin("jvm") version "2.1.0" apply false
kotlin("plugin.serialization") version "2.1.0" apply false
}
// Git ํ๊ทธ์์ ๋ฒ์ ์ถ์ถ ๋๋ SNAPSHOT ์ฌ์ฉ
fun getProjectVersion(): String {
return try {
val process = ProcessBuilder("git", "describe", "--tags", "--exact-match", "HEAD")
.directory(rootDir)
.start()
if (process.waitFor() == 0) {
process.inputStream.bufferedReader().readText().trim().removePrefix("v")
} else {
// ํ๊ทธ๊ฐ ์๋ ๊ฒฝ์ฐ SNAPSHOT
"1.0.0-SNAPSHOT"
}
} catch (e: Exception) {
"1.0.0-SNAPSHOT"
}
}
allprojects {
group = "com.commitchronicle"
version = getProjectVersion()
repositories {
mavenCentral()
}
}
subprojects {
plugins.withId("org.jetbrains.kotlin.jvm") {
configure<org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension> {
jvmToolchain(8)
sourceSets.all {
languageSettings {
languageVersion = "1.6"
apiVersion = "1.6"
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
}
}