Skip to content

Commit 8dc68fc

Browse files
Merge branch 'main' into kotlin
2 parents 440f31c + f332291 commit 8dc68fc

7 files changed

Lines changed: 260 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
distribution: 'temurin'
2121
- uses: gradle/actions/setup-gradle@v6
2222
with:
23-
gradle-version: 9.4.1
23+
gradle-version: 9.5.0
2424
name: Set up Gradle
2525
- name: Add permission
2626
run: chmod +x ./gradlew

.github/workflows/release-to-cf-mr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: gradle/actions/setup-gradle@v6
2424
with:
25-
gradle-version: 9.4.1
25+
gradle-version: 9.5.0
2626
name: Set up Gradle
2727

2828
- name: Add permission
@@ -35,7 +35,7 @@ jobs:
3535
id: changes
3636
uses: simbo/changes-between-tags-action@v1
3737

38-
- uses: c@v3.3.0
38+
- uses: Kir-Antipov/mc-publish@v3.3.0
3939
with:
4040
# Only include this section if you wish to publish
4141
# your assets on Modrinth.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
distribution: 'temurin'
2020
- uses: gradle/actions/setup-gradle@v6
2121
with:
22-
gradle-version: 9.4.1
22+
gradle-version: 9.5.0
2323
name: Set up Gradle
2424
- name: Add permission
2525
run: chmod +x ./gradlew

build.gradle

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
plugins {
2+
id 'java'
3+
id 'java-library'
4+
id 'maven-publish'
5+
id 'com.gradleup.shadow' version '9.4.0'
6+
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.4.1'
7+
id 'xyz.wagyourtail.unimined' version '1.4.17-kappa'
8+
id 'net.kyori.blossom' version '2.2.0'
9+
}
10+
11+
import org.jetbrains.gradle.ext.Gradle
12+
13+
apply from: 'gradle/scripts/helpers.gradle'
14+
15+
// Early Assertions
16+
assertProperty 'mod_version'
17+
assertProperty 'root_package'
18+
assertProperty 'mod_id'
19+
assertProperty 'mod_name'
20+
21+
assertSubProperties 'use_access_transformer', 'access_transformer_locations'
22+
assertSubProperties 'is_coremod', 'coremod_includes_mod', 'coremod_plugin_class_name'
23+
assertSubProperties 'use_asset_mover', 'asset_mover_version'
24+
25+
setDefaultProperty 'generate_sources_jar', true, false
26+
setDefaultProperty 'generate_javadocs_jar', true, false
27+
setDefaultProperty 'minecraft_username', true, 'Developer'
28+
setDefaultProperty 'extra_jvm_args', false, ''
29+
30+
version = propertyString('mod_version')
31+
group = propertyString('root_package')
32+
33+
base {
34+
archivesName = propertyString('mod_id')
35+
}
36+
37+
38+
java {
39+
toolchain {
40+
languageVersion = JavaLanguageVersion.of(25)
41+
}
42+
if (propertyBool('generate_sources_jar')) {
43+
withSourcesJar()
44+
}
45+
if (propertyBool('generate_javadocs_jar')) {
46+
withJavadocJar()
47+
}
48+
}
49+
50+
configurations {
51+
contain
52+
implementation.extendsFrom(contain)
53+
modCompileOnly
54+
compileOnly.extendsFrom(modCompileOnly)
55+
modRuntimeOnly
56+
runtimeOnly.extendsFrom(modRuntimeOnly)
57+
}
58+
59+
String remapTaskName = propertyBool('enable_shadow') ? "remapShadowJar" : "remapJar"
60+
61+
unimined.minecraft {
62+
version "1.12.2"
63+
64+
mappings {
65+
mcp("stable", "39-1.12")
66+
}
67+
68+
cleanroom {
69+
if (propertyBool('use_access_transformer')) {
70+
accessTransformer "${rootProject.projectDir}/src/main/resources/${propertyString('access_transformer_locations')}"
71+
}
72+
loader "0.5.6-alpha"
73+
runs.auth.username = minecraft_username
74+
runs.all {
75+
def extraArgs = propertyString('extra_jvm_args')
76+
if (extraArgs != null && !extraArgs.trim().isEmpty()) {
77+
jvmArgs += extraArgs.split { "\\s+" }.toList()
78+
}
79+
if (propertyBool('enable_foundation_debug')) {
80+
systemProperty("foundation.dump", "true")
81+
systemProperty("foundation.verbose", "true")
82+
}
83+
if (propertyBool('is_coremod')) {
84+
systemProperty("fml.coreMods.load", propertyString('coremod_plugin_class_name'))
85+
}
86+
return
87+
}
88+
}
89+
90+
defaultRemapJar = false
91+
92+
String jarTaskName = propertyBool('enable_shadow') ? "shadowJar" : "jar"
93+
94+
remap(tasks.named(jarTaskName).get()) {
95+
mixinRemap {
96+
enableBaseMixin()
97+
enableMixinExtra()
98+
disableRefmap()
99+
}
100+
}
101+
102+
mods {
103+
remap(configurations.modCompileOnly)
104+
remap(configurations.modRuntimeOnly)
105+
}
106+
}
107+
108+
dependencies {
109+
if (propertyBool('use_asset_mover')) {
110+
implementation "com.cleanroommc:assetmover:${propertyString('asset_mover_version')}"
111+
}
112+
if (propertyBool('enable_junit_testing')) {
113+
testImplementation 'org.junit.jupiter:junit-jupiter:6.0.3'
114+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
115+
}
116+
}
117+
118+
apply from: 'gradle/scripts/dependencies.gradle'
119+
120+
processResources {
121+
rename '(.+_at.cfg)', 'META-INF/$1'
122+
}
123+
124+
sourceSets {
125+
main {
126+
blossom {
127+
javaSources {
128+
property('mod_id', propertyString('mod_id'))
129+
property('mod_name', propertyString('mod_name'))
130+
property('mod_version', propertyString('mod_version'))
131+
property('package', "${root_package}.${mod_id}")
132+
}
133+
resources {
134+
property('mod_id', propertyString('mod_id'))
135+
property('mod_name', propertyString('mod_name'))
136+
property('mod_version', propertyString('mod_version'))
137+
property('mod_description', propertyString('mod_description'))
138+
property('mod_authors', propertyStringList('mod_authors', ',').collect {it.strip()}.join('", "'))
139+
property('mod_credits', propertyString('mod_credits'))
140+
property('mod_url', propertyString('mod_url'))
141+
property('mod_update_json', propertyString('mod_update_json'))
142+
property('mod_logo_path', propertyString('mod_logo_path'))
143+
}
144+
}
145+
}
146+
}
147+
148+
idea {
149+
module {
150+
inheritOutputDirs = true
151+
}
152+
project {
153+
settings {
154+
runConfigurations {
155+
'1. Build'(Gradle) {
156+
taskNames = ["build"]
157+
}
158+
'2. Run Client'(Gradle) {
159+
taskNames = ["runClient"]
160+
}
161+
'3. Run Server'(Gradle) {
162+
taskNames = ["runServer"]
163+
}
164+
}
165+
compiler.javac {
166+
afterEvaluate {
167+
javacAdditionalOptions = '-encoding utf8'
168+
moduleJavacAdditionalOptions = [
169+
(project.name + '.main'): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
170+
]
171+
}
172+
}
173+
}
174+
}
175+
}
176+
177+
if (!propertyBool('enable_shadow')) {
178+
shadowJar.enabled = false
179+
}
180+
181+
compileJava {
182+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
183+
}
184+
185+
jar {
186+
archiveClassifier = 'dev'
187+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
188+
if (configurations.contain.size() > 0) {
189+
into('/') {
190+
from configurations.contain
191+
}
192+
}
193+
doFirst {
194+
manifest {
195+
def attribute_map = [:]
196+
attribute_map['ModType'] = "CRL"
197+
if (configurations.contain.size() > 0) {
198+
attribute_map['ContainedDeps'] = configurations.contain.collect { it.name }.join(' ')
199+
attribute_map['NonModDeps'] = true
200+
}
201+
if (propertyBool('is_coremod')) {
202+
attribute_map['FMLCorePlugin'] = propertyString('coremod_plugin_class_name')
203+
if (propertyBool('coremod_includes_mod')) {
204+
attribute_map['FMLCorePluginContainsFMLMod'] = true
205+
}
206+
}
207+
if (propertyBool('use_access_transformer')) {
208+
attribute_map['FMLAT'] = propertyString('access_transformer_locations')
209+
}
210+
attributes(attribute_map)
211+
}
212+
}
213+
finalizedBy(tasks.named(remapTaskName).get())
214+
}
215+
216+
217+
shadowJar {
218+
configurations = [project.configurations.shadow]
219+
archiveClassifier = "shadow"
220+
}
221+
222+
223+
tasks.named(remapTaskName).configure {
224+
doFirst {
225+
logging.captureStandardOutput LogLevel.INFO
226+
}
227+
doLast {
228+
logging.captureStandardOutput LogLevel.QUIET
229+
}
230+
}
231+
232+
compileTestJava {
233+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
234+
}
235+
236+
test {
237+
useJUnitPlatform()
238+
javaLauncher.set(javaToolchains.launcherFor {
239+
languageVersion = JavaLanguageVersion.of(25)
240+
})
241+
if (propertyBool('show_testing_output')) {
242+
testLogging {
243+
showStandardStreams = true
244+
}
245+
}
246+
}
247+
248+
tasks.withType(JavaCompile).configureEach {
249+
options.encoding = 'UTF-8'
250+
}
251+
252+
apply from: 'gradle/scripts/publishing.gradle'
253+
apply from: 'gradle/scripts/extra.gradle'

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
kotlin("jvm") version "2.3.20"
1111
id("com.gradleup.shadow") version "9.4.0"
1212
id("org.jetbrains.gradle.plugin.idea-ext") version "1.4.1"
13-
id("xyz.wagyourtail.unimined") version "1.4.16-kappa"
13+
id("xyz.wagyourtail.unimined") version "1.4.17-kappa"
1414
id("net.kyori.blossom") version "2.2.0"
1515
}
1616

buildSrc/src/main/kotlin/dependencies.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repositories {
2626
mavenLocal() // Must be last for caching to work
2727
}
2828
dependencies {
29-
compileOnly("com.cleanroommc:sponge-mixin:0.20.12+mixin.0.8.7")
29+
compileOnly("com.cleanroommc:sponge-mixin:0.20.13+mixin.0.8.7")
3030
implementation("io.github.chaosunity.forgelin:Forgelin-Continuous:2.3.10.0")
3131
if (propertyBool("enable_lwjglx")) {
3232
compileOnly("com.cleanroommc:lwjglx:1.0.0")

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)