forked from MeteorDevelopment/meteor-client
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
184 lines (156 loc) · 5.63 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
plugins {
id("fabric-loom") version "1.9-SNAPSHOT"
id("maven-publish")
id("com.gradleup.shadow") version "9.0.0-beta4"
}
base {
archivesName = properties["archives_base_name"] as String
group = properties["maven_group"] as String
version = properties["fapi_version"] as String
}
repositories {
maven {
name = "meteor-maven"
url = uri("https://maven.meteordev.org/releases")
}
maven {
name = "meteor-maven-snapshots"
url = uri("https://maven.meteordev.org/snapshots")
}
maven {
url = uri("https://maven.frohnmeyer-wds.de/artifacts")
}
maven {
name = "vram"
url = uri("https://maven.vram.io/")
}
maven {
name = "ViaVersion"
url = uri("https://repo.viaversion.com")
}
mavenCentral()
exclusiveContent {
forRepository {
maven {
name = "modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
val modInclude: Configuration by configurations.creating
configurations {
// include mods
modImplementation.configure {
extendsFrom(modInclude)
}
include.configure {
extendsFrom(modInclude)
}
}
dependencies {
// Fabric
minecraft("com.mojang:minecraft:${properties["minecraft_version"] as String}")
mappings("net.fabricmc:yarn:${properties["yarn_mappings"] as String}:v2")
modImplementation("net.fabricmc:fabric-loader:${properties["loader_version"] as String}")
// Fabric API
shadow(modImplementation(platform("net.fabricmc.fabric-api:fabric-api-bom:${properties["fapi_version"] as String}"))!!)
modImplementation("net.fabricmc.fabric-api:fabric-api")
shadow("net.fabricmc.fabric-api:fabric-api-base") {
isTransitive = false
}
// Compat fixes
modCompileOnly(fabricApi.module("fabric-renderer-indigo", properties["fapi_version"] as String))
modCompileOnly("maven.modrinth:sodium:${properties["sodium_version"] as String}") { isTransitive = false }
modCompileOnly("maven.modrinth:lithium:${properties["lithium_version"] as String}") { isTransitive = false }
modCompileOnly("maven.modrinth:iris:${properties["iris_version"] as String}") { isTransitive = false }
modCompileOnly("com.viaversion:viafabricplus:${properties["viafabricplus_version"] as String}") { isTransitive = false }
modCompileOnly("com.viaversion:viafabricplus-api:${properties["viafabricplus_version"] as String}") { isTransitive = false }
// Baritone (https://github.com/MeteorDevelopment/baritone)
modCompileOnly("meteordevelopment:baritone:${properties["baritone_version"] as String}-SNAPSHOT")
// Libraries
modInclude("meteordevelopment:orbit:${properties["orbit_version"] as String}")
modInclude("meteordevelopment:starscript:${properties["starscript_version"] as String}")
modInclude("org.reflections:reflections:${properties["reflections_version"] as String}")
modInclude("io.netty:netty-handler-proxy:${properties["netty_version"] as String}") { isTransitive = false }
modInclude("io.netty:netty-codec-socks:${properties["netty_version"] as String}") { isTransitive = false }
modInclude("de.florianmichael:WaybackAuthLib:${properties["waybackauthlib_version"] as String}")
modInclude("io.gitlab.jfronny.libjf:libjf-unsafe-v0:${properties["libjf_version"] as String}")
include("io.gitlab.jfronny.libjf:libjf-base:${properties["libjf_version"] as String}")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${properties["libjf_version"] as String}")
}
loom {
accessWidenerPath = file("src/main/resources/meteor-client.accesswidener")
}
afterEvaluate {
tasks.migrateMappings.configure {
outputDir.set(project.file("src/main/java"))
}
}
tasks {
processResources {
val propertyMap = mapOf(
"version" to project.version,
"minecraft_version" to project.property("minecraft_version"),
"loader_version" to project.property("loader_version")
)
inputs.properties(propertyMap)
filesMatching("fabric.mod.json") {
expand(propertyMap)
}
}
jar {
val licenseSuffix = project.base.archivesName.get()
from("LICENSE") {
rename { "${it}_${licenseSuffix}" }
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
withJavadocJar()
}
withType<JavaCompile> {
options.release = 21
}
shadowJar {
configurations = listOf(project.configurations.shadow.get())
val licenseSuffix = project.base.archivesName.get()
from("LICENSE") {
rename { "${it}_${licenseSuffix}" }
}
destinationDirectory.set(layout.buildDirectory.dir("devlibs"))
dependencies {
exclude {
it.moduleGroup == "org.slf4j"
}
}
}
remapJar {
dependsOn(shadowJar)
inputFile.set(shadowJar.get().archiveFile)
}
javadoc {
with (options as StandardJavadocDocletOptions) {
addStringOption("Xdoclint:none", "-quiet")
addStringOption("encoding", "UTF-8")
addStringOption("charSet", "UTF-8")
}
}
build {
dependsOn("javadocJar")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifactId = "meteor-client"
version = properties["minecraft_version"] as String + "-SNAPSHOT"
}
}
}