-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
119 lines (97 loc) · 2.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
plugins {
id("application")
id("jacoco")
kotlin("jvm") version "2.0.21"
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "org.protogalaxy"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
val kotlinVersion = "2.0.21"
val okhttpVersion = "4.12.0"
val jacksonVersion = "2.18.0"
val spoonVersion = "11.1.0"
val plantUMLVersion = "1.2024.7"
val coroutinesVersion = "1.9.0"
val slf4jVersion = "2.0.16"
val junitVersion = "5.11.3"
val mockkVersion = "1.13.13"
jacoco {
toolVersion = "0.8.12"
}
// Separate source set for annotations
sourceSets {
create("annotations") {
java.srcDir("src/annotations/java")
}
}
// Build task to create the annotations JAR
tasks.register<Jar>("buildLib") {
archiveClassifier.set("annotations")
from(sourceSets["annotations"].output)
destinationDirectory.set(layout.buildDirectory.dir("libs"))
}
tasks.shadowJar {
manifest {
attributes["Main-Class"] = "org.protogalaxy.fractalfathom.cli.MainKt"
}
// Exclude signature files to prevent SecurityException
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
}
tasks.named<CreateStartScripts>("startScripts") {
dependsOn(tasks.shadowJar)
classpath = files(tasks.shadowJar.get().archiveFile)
}
tasks.named<Zip>("distZip") {
dependsOn(tasks.shadowJar)
}
tasks.named<Tar>("distTar") {
dependsOn(tasks.shadowJar)
}
dependencies {
implementation(platform("com.squareup.okhttp3:okhttp-bom:$okhttpVersion"))
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("com.squareup.okhttp3:okhttp")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("fr.inria.gforge.spoon:spoon-core:$spoonVersion")
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
implementation("net.sourceforge.plantuml:plantuml:$plantUMLVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
// Test dependencies
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.junit.jupiter:junit-jupiter")
}
application {
mainClass.set("org.protogalaxy.fractalfathom.cli.MainKt")
distributions {
main {
contents {
from(tasks.shadowJar) {
into("lib")
}
// Exclude the default JAR file
exclude("lib/${tasks.jar.get().archiveFileName.get()}")
}
}
}
}
tasks.test {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
html.required.set(true)
}
}
kotlin {
jvmToolchain(21)
}