forked from ReplayMod/remap
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
122 lines (101 loc) · 3.11 KB
/
build.gradle.kts
File metadata and controls
122 lines (101 loc) · 3.11 KB
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
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.1.20"
`maven-publish`
application
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "xyz.wagyourtail.unimined"
version = "1.0.5"
version = if (project.hasProperty("version_snapshot")) version as String + "-SNAPSHOT" else version as String
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
kotlin {
jvmToolchain(8)
}
application {
mainClass.set("com.replaymod.gradle.remap.MainKt")
}
base {
archivesName.set("source-remap")
}
repositories {
mavenCentral()
maven("https://repo.spongepowered.org/repository/maven-public/")
}
val testA by sourceSets.creating
val testB by sourceSets.creating
dependencies {
shadow(api("org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20")!!)
shadow(implementation(kotlin("stdlib"))!!)
shadow(api("org.cadixdev:lorenz:0.5.0")!!)
runtimeOnly("net.java.dev.jna:jna:5.10.0") // don't strictly need this but IDEA spams log without
// CLI
shadow(implementation("net.sourceforge.argparse4j:argparse4j:0.9.0")!!)
shadow(implementation("net.fabricmc:mapping-io:0.5.0")!!)
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
testImplementation("io.kotest:kotest-assertions-core:4.6.3")
testRuntimeOnly(testA.output)
testRuntimeOnly(testB.output)
testRuntimeOnly("org.spongepowered:mixin:0.8.4")
}
tasks.jar {
from(sourceSets.main.get().output)
manifest {
attributes(
"Implementation-Title" to base.archivesName.get(),
"Implementation-Version" to project.version,
"Main-Class" to application.mainClass.get()
)
}
}
tasks.shadowJar {
from(sourceSets.main.get().output)
configurations = listOf(
project.configurations.shadow.get()
)
manifest {
attributes(
"Implementation-Title" to base.archivesName.get(),
"Implementation-Version" to project.version,
"Main-Class" to application.mainClass.get()
)
}
}
tasks.test {
useJUnitPlatform()
javaLauncher = javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
tasks.withType<KotlinCompile> {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_8)
apiVersion.set(KotlinVersion.KOTLIN_1_8)
}
}
publishing {
repositories {
maven {
name = "WagYourMaven"
url = if (project.hasProperty("version_snapshot")) {
project.uri("https://maven.wagyourtail.xyz/snapshots/")
} else {
project.uri("https://maven.wagyourtail.xyz/releases/")
}
credentials {
username = project.findProperty("mvn.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("mvn.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create("maven", MavenPublication::class) {
from(components["java"])
}
}
}