-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
65 lines (52 loc) · 1.44 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
import java.nio.file.Files
import java.nio.file.Paths
import kotlin.io.path.listDirectoryEntries
plugins {
id("java")
id("java-library")
id("application")
id("me.champeau.jmh") version "0.7.2"
}
group = "org.togetherjava"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
api("org.openjdk.jmh:jmh-core:1.37")
annotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:1.37")
compileOnly("org.projectlombok:lombok:1.18.36")
annotationProcessor("org.projectlombok:lombok:1.18.36")
api("org.reflections:reflections:0.10.2")
}
application {
mainClass = "org.togetherjava.aoc.Aoc"
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("--enable-preview")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
jmh {
warmupIterations = 2
iterations = 2
fork = 2
}
tasks.register("deleteCachedInputs") {
group = "AOC"
description = "Deletes all cached AOC inputs"
doLast {
val inputFolder = Paths.get(System.getProperty("user.home"), ".together-java", "aoc", "inputs")
inputFolder.listDirectoryEntries().forEach { f ->
if(Files.deleteIfExists(f)) {
println("Sucessfully deleted " + f.toAbsolutePath().toString())
}
}
}
}