forked from sourcegrade/jagr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
77 lines (68 loc) · 1.96 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.shadow)
alias(libs.plugins.style)
}
dependencies {
runtimeOnly(project("jagr-core"))
implementation(project("jagr-launcher"))
implementation(libs.clikt)
}
application {
mainClass.set("org.sourcegrade.jagr.MainKt")
}
tasks {
val runDir = File("build/run")
named<JavaExec>("run") {
doFirst {
error("Use runShadow instead")
}
}
named<JavaExec>("runShadow") {
doFirst {
runDir.mkdirs()
}
workingDir = runDir
}
jar {
enabled = false
}
shadowJar {
transform(Log4j2PluginsCacheFileTransformer::class.java)
from("gradlew") {
into("org/gradle")
}
from("gradlew.bat") {
into("org/gradle")
}
from("gradle/wrapper/gradle-wrapper.properties") {
into("org/gradle")
}
archiveFileName.set("Jagr-${project.version}.jar")
}
}
val projectVersion = file("version").readLines().first()
project.extra["apiVersion"] = projectVersion.replace("\\.[1-9]\\d*-SNAPSHOT|\\.0|\\.\\d*\$".toRegex(), "")
allprojects {
apply(plugin = "org.sourcegrade.style")
group = "org.sourcegrade"
version = projectVersion
project.findProperty("buildNumber")
?.takeIf { version.toString().contains("SNAPSHOT") }
?.also { version = version.toString().replace("SNAPSHOT", "RC$it") }
tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = "17"
targetCompatibility = "17"
}
}
}