-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
130 lines (103 loc) · 3.21 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
plugins {
application
id("com.google.cloud.tools.jib") version "3.1.4"
}
group = "com.github.firmwehr"
version = "SNAPSHOT"
repositories {
mavenLocal()
mavenCentral()
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}
dependencyLocking {
lockAllConfigurations()
}
application {
mainClass.set("com.github.firmwehr.gentle.GentleCompiler")
applicationDefaultJvmArgs = listOf("--enable-preview", "-Xss16m", "-Dspeedcenter.true")
}
buildDir = File("_build")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
sourceSets {
create("integrationTest") {
java {
srcDir("src/test/integrationTest")
}
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
val integrationTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.implementation.get())
extendsFrom(configurations.testImplementation.get())
extendsFrom(configurations.testRuntimeOnly.get())
}
val integrationTest = task<Test>("integrationTest") {
description = "Runs integration tests."
group = "verification"
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")
}
jib {
from.image = "eclipse-temurin:17"
to {
image = "ghcr.io/firmwehr/gentle:latest"
// here be dragons
System.getenv("IMAGE_TAGS")?.apply {
tags = split("[,\\n]".toRegex())
.map { it.split(":")[1] }
.toCollection(mutableSetOf())
}
container {
environment = mapOf("GENTLE_ENABLE_LOG" to "true")
jvmFlags = application.applicationDefaultJvmArgs.toList()
}
}
}
dependencies {
// logging
implementation("org.fusesource.jansi:jansi:2.4.0")
// annotations
compileOnly("org.jetbrains", "annotations", "22.0.0")
// commons stuff
implementation("com.google.guava:guava:31.0.1-jre")
implementation("commons-io:commons-io:2.11.0")
// Command line parsing
val jbock = "5.12"
implementation("io.github.jbock-java:jbock:$jbock")
annotationProcessor("io.github.jbock-java:jbock-compiler:$jbock")
val fiascii = "bef150f1f0665d718d96631a68e30917d579ce63"
implementation("com.github.firmwehr:FiAscii:$fiascii")
annotationProcessor("com.github.firmwehr:FiAscii:$fiascii")
// Persistent collections
implementation("org.javimmutable:javimmutable-collections:3.2.1")
// https://mvnrepository.com/artifact/net.java.dev.jna/jna
implementation("net.java.dev.jna:jna:4.5.2")
implementation("com.github.Firmwehr:jFirm:62c1a55f72")
implementation("org.buildobjects:jproc:2.6.2")
// junit
val junitVersion = "5.8.1"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.assertj:assertj-core:3.21.0")
}
// set encoding for all compilation passes
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("--enable-preview")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
jvmArgs("--enable-preview", "-Xss16m")
}
tasks.getByName<Test>("integrationTest") {
useJUnitPlatform()
jvmArgs("--enable-preview", "-Xss16m")
}