-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
148 lines (128 loc) · 4.48 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
object V {
const val arrow = "1.2.1"
const val asm = "9.6"
const val commonsCSV = "1.10.0"
const val commonsIO = "2.14.0"
const val eclipseJDT = "3.35.0"
const val jacoco = "0.8.10"
const val jgrapht = "1.5.2"
const val jmetal = "6.2"
const val jmh = "1.37"
const val junit = "5.10.0"
const val jvmTarget = "17"
const val klaxon = "5.6"
const val log4j2 = "2.20.0"
const val picocli = "4.7.5"
const val wala = "1.6.2"
}
plugins {
kotlin("jvm") version "1.9.10"
application
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1"
id("me.champeau.jmh") version "0.7.1"
}
group = "ch.uzh.ifi.seal"
version = "0.5.0"
application {
// applicationDefaultJvmArgs = listOf("-Xms6G", "-Xmx8G")
mainClass.set("ch.uzh.ifi.seal.bencher.MainKt")
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
// implementation(group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: V.kotlinxCoroutines)
implementation(group = "info.picocli", name = "picocli", version = V.picocli)
implementation(group = "com.beust", name = "klaxon", version = V.klaxon)
implementation(group = "io.arrow-kt", name = "arrow-core", version = V.arrow)
implementation(group = "com.ibm.wala", name = "com.ibm.wala.core", version = V.wala)
implementation(group = "org.apache.logging.log4j", name = "log4j-api", version = V.log4j2)
implementation(group = "org.apache.logging.log4j", name = "log4j-core", version = V.log4j2)
implementation(group = "org.ow2.asm", name = "asm", version = V.asm)
implementation(group = "org.apache.commons", name = "commons-csv", version = V.commonsCSV)
implementation(group = "commons-io", name = "commons-io", version = V.commonsIO)
implementation(group = "org.jgrapht", name = "jgrapht-core", version = V.jgrapht)
implementation(group = "org.openjdk.jmh", name = "jmh-core", version = V.jmh)
implementation(group = "org.eclipse.jdt", name = "org.eclipse.jdt.core", version = V.eclipseJDT)
implementation(group = "org.uma.jmetal", name = "jmetal-core",version = V.jmetal)
implementation(group = "org.uma.jmetal", name = "jmetal-algorithm",version = V.jmetal)
implementation(group = "org.jacoco", name = "org.jacoco.core", version = V.jacoco)
implementation(group = "org.jacoco", name = "org.jacoco.report", version = V.jacoco)
jmh(group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version = V.jmh)
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-api", version = V.junit)
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-params", version = V.junit)
testImplementation(kotlin("test"))
testRuntimeOnly(group = "org.junit.jupiter", name = "junit-jupiter-engine", version = V.junit)
}
fun splitWith(c: Char, clargs: String): List<String> {
var inC = false
val ret = mutableListOf<String>()
var curr = ""
clargs.forEach { i ->
if (i == c) {
inC = !inC
} else if (i == ' ' && !inC) {
ret.add(curr)
curr = ""
} else {
curr += i
}
}
if (curr != "") {
ret.add(curr)
}
return ret
}
tasks {
defaultTasks("run")
named<JavaExec>("run") {
val clargs = System.getProperty("args")
if (clargs != null) {
args(when {
clargs.contains("\"") -> splitWith('"', clargs)
clargs.contains("\'") -> splitWith('\'', clargs)
else -> clargs.split(" ")
})
}
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions {
jvmTarget = V.jvmTarget
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = V.jvmTarget
}
}
compileJmhKotlin {
kotlinOptions {
jvmTarget = V.jvmTarget
}
}
jmhJar {
duplicatesStrategy = DuplicatesStrategy.WARN
// set jmh jar name
//[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]
archiveClassifier.set("jmh")
}
jmh {
jmhVersion.set(V.jmh)
duplicateClassesStrategy.set(DuplicatesStrategy.EXCLUDE)
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "$group"
artifactId = rootProject.name
version = version
from(components["java"])
}
}
}