Skip to content

Commit af0ab22

Browse files
authored
Merge pull request #5 from tildejustin/1.16.1
upgradle and java 8 compat
2 parents b03e779 + c65e5ab commit af0ab22

12 files changed

Lines changed: 140 additions & 140 deletions

File tree

.github/workflows/test.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
name: "test"
2-
1+
name: test
32
on:
43
push:
4+
# ignores tags
5+
branches:
6+
- "**"
57
pull_request:
8+
workflow_dispatch:
69

710
jobs:
8-
test:
9-
runs-on: "ubuntu-latest"
11+
build:
12+
runs-on: ubuntu-latest
1013
steps:
11-
- name: Checkout sources
12-
uses: actions/checkout@v2
13-
- name: Set up JDK 17
14-
uses: actions/setup-java@v1
14+
- name: checkout repository
15+
uses: actions/checkout@v4
16+
- name: validate gradle wrapper
17+
uses: gradle/wrapper-validation-action@v2
18+
- name: setup java
19+
uses: actions/setup-java@v4
1520
with:
16-
java-version: 17
17-
- name: Build artifacts
18-
run: ./gradlew build
21+
distribution: "temurin"
22+
java-version: 21
23+
- name: build
24+
run: |
25+
chmod +x ./gradlew
26+
./gradlew build

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# gradle
2-
32
.gradle/
43
build/
54
out/
65
classes/
76

87
# eclipse
9-
108
*.launch
119

1210
# idea
13-
1411
.idea/
1512
*.iml
1613
*.ipr
1714
*.iws
1815

1916
# vscode
20-
2117
.settings/
2218
.vscode/
2319
bin/
2420
.classpath
2521
.project
2622

2723
# macos
28-
2924
*.DS_Store
3025

3126
# fabric
32-
3327
run/
28+
29+
# java
30+
hs_err_*.log
31+
replay_*.log
32+
*.hprof
33+
*.jfr

build.gradle

Lines changed: 32 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,60 @@
11
plugins {
2-
id 'fabric-loom' version '1.0-SNAPSHOT'
3-
id 'maven-publish'
4-
id 'org.ajoberstar.grgit' version '4.1.0'
2+
alias libs.plugins.fabric.loom
3+
id "maven-publish"
54
}
6-
def getVersionMetadata() {
7-
// CI builds version numbers
8-
def build_id = System.getenv("RELEASE_NUMBER")
9-
if (build_id != null) {
10-
return build_id + ".0.0"
11-
}
12-
13-
// Development builds
14-
if (grgit == null) {
15-
return "dev"
16-
}
175

18-
// Named development builds
19-
def id = grgit.head().abbreviatedId
20-
if (!grgit.status().clean) {
21-
id += "-dirty"
22-
}
6+
version = "$mod_version+$target_version"
7+
group = maven_group
238

24-
return "rev.${id}"
9+
base {
10+
archivesName = archives_name
2511
}
2612

27-
archivesBaseName = "${project.mod_id}-${project.supported_versions}"
28-
version = "${getVersionMetadata()}"
29-
group = project.maven_group
3013
repositories {
31-
// Add repositories to retrieve artifacts from in here.
32-
// You should only use this when depending on other mods because
33-
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
34-
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
35-
// for more information about repositories.
14+
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
15+
maven { url "https://jitpack.io" }
16+
}
17+
18+
loom {
19+
decompilers {
20+
vineflower {
21+
options.putAll(["mark-corresponding-synthetics": "1", "ind": " "])
22+
}
23+
}
24+
mixin {
25+
useLegacyMixinAp = false
26+
}
3627
}
3728

3829
dependencies {
39-
// To change the versions see the gradle.properties file
40-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
41-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
42-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
30+
minecraft libs.minecraft
31+
mappings variantOf(libs.yarn.mappings) { classifier "v2" }
32+
modImplementation libs.fabric.loader
33+
vineflowerDecompilerClasspath libs.vineflower
4334
}
4435

4536
processResources {
46-
inputs.property "mod_id", project.mod_id
47-
inputs.property "version", project.version
48-
filteringCharset "UTF-8"
49-
50-
filesMatching("fabric.mod.json") {
51-
expand "mod_id": project.mod_id, "version": project.version
37+
filesMatching "fabric.mod.json", {
38+
expand "version": version
5239
}
5340
}
5441

5542
tasks.withType(JavaCompile).configureEach {
56-
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
57-
// it.options.release = 17
43+
it.options.encoding = "UTF-8"
44+
if (JavaVersion.current().isJava9Compatible()) it.options.release.set(8)
5845
}
5946

6047
java {
61-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
62-
// if it is present.
63-
// If you remove this line, sources will not be generated.
64-
withSourcesJar()
48+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
6549
}
6650

6751
jar {
68-
from("LICENSE") {
69-
rename { "${it}_${project.archivesBaseName}" }
70-
}
52+
from "LICENSE"
7153
}
7254

73-
// configure the maven publication
7455
publishing {
75-
publications {
76-
mavenJava(MavenPublication) {
77-
artifact(remapJar) {
78-
builtBy remapJar
79-
}
80-
artifact(sourcesJar) {
81-
builtBy remapSourcesJar
82-
}
83-
}
84-
}
85-
86-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
87-
repositories {
88-
// Add repositories to publish to here.
89-
// Notice: This block does NOT have the same function as the block in the top level.
90-
// The repositories here will be used for publishing your artifact, not for
91-
// retrieving dependencies.
56+
publications.create("mavenJava", MavenPublication) {
57+
from components.java
9258
}
59+
repositories {}
9360
}

gradle.properties

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx2G
1+
org.gradle.jvmargs = -Xmx2G
2+
org.gradle.parallel = true
3+
org.gradle.caching = true
34

4-
# Fabric Properties
5-
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.16.1
7-
yarn_mappings=1.16.1+build.21
8-
loader_version=0.12.12
9-
10-
# Mod Properties
11-
mod_version=1.3.0
12-
maven_group=me.wurgo
13-
archives_base_name=antiresourcereload
14-
15-
# MCSR
16-
mod_id=antiresourcereload
17-
supported_versions=1.16.1
5+
mod_version = 4.0.1
6+
target_version = 1.16.1
7+
archives_name = antiresourcereload
8+
maven_group = me.wurgo

gradle/libs.versions.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[versions]
2+
minecraft = "1.16.1"
3+
yarn_mappings = "1.16.1.build.19"
4+
fabric_loader = "0.15.7"
5+
loom = "1.5-SNAPSHOT"
6+
vineflower = "1.10.0-SNAPSHOT"
7+
8+
[libraries]
9+
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
10+
yarn_mappings = { module = "com.github.redlime:yarn", version.ref = "yarn_mappings" }
11+
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
12+
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
13+
14+
[plugins]
15+
fabric_loom = { id = "fabric-loom", version.ref = "loom" }

gradle/wrapper/gradle-wrapper.jar

-15.7 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 33 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)