Skip to content

Commit 518a8c3

Browse files
committed
switched to Kotlin Gradle build files
1 parent d5bba97 commit 518a8c3

6 files changed

+142
-151
lines changed

.idea/jarRepositories.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinScripting.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

-149
This file was deleted.

build.gradle.kts

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
object V {
2+
const val wala = "1.5.0"
3+
const val aspectj = "1.9.1"
4+
const val klaxon = "3.0.11"
5+
const val junit = "5.6.0"
6+
const val log4j2 = "2.11.1"
7+
const val funktionale = "1.2"
8+
const val commonsCSV = "1.6"
9+
const val commonsIO = "2.6"
10+
const val asm = "7.0"
11+
const val picocli = "3.9.2"
12+
// const val kotlinxCoroutines = "1.1.1"
13+
const val jgrapht = "1.3.0"
14+
const val jmh = "1.21"
15+
const val shadow = "5.0.0"
16+
const val jmhGradle = "0.5.0"
17+
const val eclipseJDT = "3.18.0"
18+
}
19+
20+
plugins {
21+
kotlin("jvm") version "1.3.70"
22+
application
23+
id("com.github.johnrengelman.shadow") version "5.0.0"
24+
id("me.champeau.gradle.jmh") version "0.5.0"
25+
}
26+
27+
group = "ch.uzh.ifi.seal"
28+
version = "1.0-SNAPSHOT"
29+
30+
application {
31+
// applicationDefaultJvmArgs = listOf("-Xms6G", "-Xmx8G")
32+
mainClassName = "ch.uzh.ifi.seal.bencher.MainKt"
33+
}
34+
35+
repositories {
36+
mavenCentral()
37+
jcenter()
38+
}
39+
40+
dependencies {
41+
implementation(kotlin("stdlib-jdk8"))
42+
implementation(kotlin("reflect"))
43+
// implementation(group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: V.kotlinxCoroutines)
44+
implementation(group = "info.picocli", name = "picocli", version = V.picocli)
45+
implementation(group = "com.beust", name = "klaxon", version = V.klaxon)
46+
implementation(group = "org.funktionale", name = "funktionale-all", version = V.funktionale)
47+
implementation(group = "com.ibm.wala", name = "com.ibm.wala.core", version = V.wala)
48+
implementation(group = "org.apache.logging.log4j", name = "log4j-api", version = V.log4j2)
49+
implementation(group = "org.apache.logging.log4j", name = "log4j-core", version = V.log4j2)
50+
implementation(group = "org.ow2.asm", name = "asm", version = V.asm)
51+
implementation(group = "org.apache.commons", name = "commons-csv", version = V.commonsCSV)
52+
implementation(group = "commons-io", name = "commons-io", version = V.commonsIO)
53+
implementation(group = "org.jgrapht", name = "jgrapht-core", version = V.jgrapht)
54+
implementation(group = "org.openjdk.jmh", name = "jmh-core", version = V.jmh)
55+
implementation(group = "org.eclipse.jdt", name = "org.eclipse.jdt.core", version = V.eclipseJDT)
56+
jmh(group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version = V.jmh)
57+
58+
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-api", version = V.junit)
59+
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-params", version = V.junit)
60+
testImplementation(kotlin("test"))
61+
testRuntimeOnly(group = "org.junit.jupiter", name = "junit-jupiter-engine", version = V.junit)
62+
}
63+
64+
fun splitWith(c: Char, clargs: String): List<String> {
65+
var inC = false
66+
var ret = mutableListOf<String>()
67+
var curr = ""
68+
69+
clargs.forEach { i ->
70+
if (i == c) {
71+
inC = !inC
72+
} else if (i == ' ' && !inC) {
73+
ret.add(curr)
74+
curr = ""
75+
} else {
76+
curr += i
77+
}
78+
}
79+
80+
if (curr != "") {
81+
ret.add(curr)
82+
}
83+
84+
return ret
85+
}
86+
87+
tasks {
88+
defaultTasks("run")
89+
90+
named<JavaExec>("run") {
91+
val clargs = System.getProperty("args")
92+
if (clargs != null) {
93+
args(when {
94+
clargs.contains("\"") -> splitWith('"', clargs)
95+
clargs.contains("\'") -> splitWith('\'', clargs)
96+
else -> clargs.split(" ")
97+
})
98+
}
99+
}
100+
101+
test {
102+
useJUnitPlatform()
103+
}
104+
105+
compileKotlin {
106+
kotlinOptions {
107+
jvmTarget = "1.8"
108+
}
109+
}
110+
111+
compileTestKotlin {
112+
kotlinOptions {
113+
jvmTarget = "1.8"
114+
}
115+
}
116+
117+
jmhJar {
118+
duplicatesStrategy = DuplicatesStrategy.WARN
119+
// set jmh jar name
120+
//[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]
121+
//TODO add classifier to JAR
122+
// archiveClassifier = "jmh"
123+
}
124+
125+
jmh {
126+
jmhVersion = V.jmh
127+
duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE
128+
}
129+
}

settings.gradle

-2
This file was deleted.

settings.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = "bencher"
2+

0 commit comments

Comments
 (0)