-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
101 lines (81 loc) · 2.75 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
antlr
`java-library`
eclipse
jacoco
application
id("com.diffplug.gradle.spotless") version "4.3.0"
id("com.github.johnrengelman.shadow") version "5.2.0"
}
group = "net.rptools.scriptparser"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
antlr("org.antlr:antlr4:4.7.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.4.0")
implementation("org.reflections", "reflections", "0.9.11")
implementation("org.apache.commons", "commons-text", "1.6")
implementation("org.apache.commons", "commons-text", "1.6")
implementation("com.github.jknack:handlebars:4.1.2")
implementation("org.apache.logging.log4j", "log4j-api", "2.11.0");
implementation("org.apache.logging.log4j", "log4j-1.2-api", "2.11.0");
implementation("com.google.inject:guice:4.2.3")
implementation("com.google.inject.extensions:guice-assistedinject:4.2.3")
implementation("com.google.inject.extensions:guice-testlib:4.2.3")
implementation("commons-cli:commons-cli:1.4")
implementation("com.google.code.gson", "gson", "2.8.6");
testCompile("org.mockito:mockito-core:3.3.3");
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_14
}
tasks.generateGrammarSource {
maxHeapSize = "64m"
arguments = arguments + listOf("-visitor", "-long-messages")
outputDirectory = file("${project.buildDir}/generated-src/antlr/main/net/rptools/mtscript/parser".toString());
}
spotless {
java {
target("src/**/*.java")
targetExclude("src/main/gen/*", "src/main/antlr/gen/*")
licenseHeaderFile(file("build-resources/spotless.license.java"))
googleJavaFormat("1.8")
// https://github.com/diffplug/spotless/blob/master/PADDEDCELL.md
}
format("misc") {
target("**/*.gradle", "**/.gitignore")
// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
// https://github.com/diffplug/spotless/blob/master/PADDEDCELL.md
}
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs("--enable-preview")
testLogging {
events("passed", "skipped", "failed", "standard_error", "standard_out")
}
}
jacoco {
toolVersion = "0.8.5"
reportsDir = file("build/reports/jacoco")
}
application {
mainClassName = "net.rptools.mtscript.Main"
}
tasks.withType<ShadowJar>() {
manifest {
attributes["Main-Class"] = "net.rptools.mtscript.Main"
}
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("--enable-preview")
}
tasks.withType<JavaExec> {
jvmArgs("--enable-preview")
}