-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
97 lines (83 loc) · 2.67 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
plugins {
antlr
`java-library`
jacoco
application
id("com.diffplug.spotless") version "6.21.0"
`maven-publish`
base
}
group = "net.rptools.advanced-dice"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
antlr("org.antlr:antlr4:4.13.0")
implementation("org.reflections:reflections:0.10.2")
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");
testImplementation("org.mockito:mockito-core:3.3.3");
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2");
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2");
testImplementation("org.junit.jupiter:junit-jupiter-params:5.8.2");
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3");
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_19
}
java {
val mainJavaSourceSet: SourceDirectorySet = sourceSets.getByName("main").java
mainJavaSourceSet.srcDir("build/generated/antlr/main")
println(mainJavaSourceSet.srcDirs)
}
spotless {
java {
target("src/**/*.java")
targetExclude("src/main/gen/*", "src/main/antlr/gen/*")
licenseHeaderFile(file("spotless.license.java"))
googleJavaFormat("1.16.0")
}
format("misc") {
target("**/*.gradle", "**/.gitignore")
// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
indentWithSpaces(2)
}
}
tasks.withType<Test> {
useJUnitPlatform()
//jvmArgs("--enable-preview")
testLogging {
events("passed", "skipped", "failed", "standard_error", "standard_out")
}
}
application {
mainClass.set("net.rptools.maptool.advanceddice.Main")
}
tasks.generateGrammarSource {
maxHeapSize = "64m"
arguments = arguments + listOf(
"-visitor",
"-long-messages",
"-package", "net.rptools.maptool.advanceddice.parser",
"-Xexact-output-dir"
)
// need to specify the exact output directory for the generated files for plugin to work with
// split grammar files
outputDirectory = File("build/generated/antlr/main/net/rptools/maptool/advanceddice/parser")
}
publishing {
publications {
create<MavenPublication>("advanced-dice-rolls") {
from(components["java"])
pom {
groupId = "net.rptools.maptool"
artifactId = "advanced-rolls"
}
}
}
}