-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
75 lines (62 loc) · 1.62 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
plugins {
id("java-library")
id("maven-publish")
id("checkstyle")
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "com.github.burningtnt"
version = "0.9.0"
description = "An analysis tool specifically developed for Minecraft: Java Edition"
java {
withSourcesJar()
}
repositories {
mavenCentral()
}
val javadocJar = tasks.create<Jar>("javadocJar") {
group = "build"
archiveClassifier.set("javadoc")
}
tasks.compileJava {
listOf(
"jdk.attach/sun.tools.attach"
).forEach { string ->
this.options.compilerArgs.add("--add-exports")
this.options.compilerArgs.add("${string}=ALL-UNNAMED")
}
}
checkstyle {
sourceSets = mutableSetOf()
}
tasks.getByName("build") {
dependsOn(tasks.getByName("checkstyleMain") {
group = "build"
})
dependsOn(tasks.getByName("checkstyleTest") {
group = "build"
})
dependsOn(tasks.getByName<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
manifest {
attributes(
"Main-Class" to "net.burningtnt.jstackmc.Main",
"Add-Opens" to listOf(
"jdk.attach/sun.tools.attach"
).joinToString(" ")
)
}
})
}
dependencies {
compileOnly("org.jetbrains:annotations:24.0.1")
testImplementation(project)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
}
}
}