-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
73 lines (59 loc) · 1.75 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import de.skyrising.mc.scanner.gen.generateRandomTicksKt
plugins {
kotlin("jvm") version "1.8.0"
kotlin("plugin.serialization") version "1.8.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
application
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
implementation("it.unimi.dsi:fastutil:8.5.8")
implementation("net.sf.jopt-simple:jopt-simple:6.0-alpha-3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("org.jetbrains.kotlin:kotlin-scripting-common")
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm")
//implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies")
//implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies-maven")
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm-host")
testImplementation(kotlin("test"))
}
application {
mainClassName = "de.skyrising.mc.scanner.ScannerKt"
}
tasks {
named<ShadowJar>("shadowJar") {
classifier = ""
mergeServiceFiles()
minimize {
exclude(dependency("org.jetbrains.kotlin:.*"))
}
dependsOn(distTar, distZip)
}
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
val generatedKotlinDir = project.buildDir.resolve("generated/kotlin")
tasks.create("generateSources") {
doFirst {
generateRandomTicksKt().writeTo(generatedKotlinDir)
}
}
tasks.compileKotlin {
dependsOn("generateSources")
}
sourceSets {
main {
java {
srcDir(generatedKotlinDir)
}
}
}