Skip to content

Commit 8d95456

Browse files
Merge pull request #4 from ksrgtech/copilot/merge-until1-12-2-and-master-upstream
2 parents d791e10 + a2aa3b9 commit 8d95456

115 files changed

Lines changed: 2015 additions & 171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-1.12.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/build-1.18.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

.github/workflows/build-all.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Build All Versions
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
# 1.12.2 Forge builds
21+
- version: "1.12.2"
22+
os: macos-14
23+
platform: macos
24+
# temurin does not provide JDK 8 series via their API: perhaps it's their bug?
25+
java_distribution: 'corretto'
26+
java_version: '8'
27+
build_script: build_lib_for_mac.sh
28+
gradle_cmd: ./gradlew
29+
mod_type: forge
30+
31+
# 1.18.2 Forge builds
32+
- version: "1.18.2"
33+
os: ubuntu-22.04
34+
platform: linux
35+
java_distribution: 'temurin'
36+
java_version: '17'
37+
build_script: build_lib_for_x11.sh
38+
native_deps: build-essential libx11-dev libxtst-dev
39+
gradle_cmd: ./gradlew
40+
mod_type: forge
41+
42+
- version: "1.18.2"
43+
os: macos-14
44+
platform: macos
45+
java_distribution: 'temurin'
46+
java_version: '17'
47+
build_script: build_lib_for_mac.sh
48+
native_deps: ''
49+
gradle_cmd: ./gradlew
50+
mod_type: forge
51+
52+
- version: "1.18.2"
53+
os: windows-2022
54+
platform: windows
55+
java_distribution: 'temurin'
56+
java_version: '17'
57+
build_script: build_lib_for_win.sh
58+
native_deps: ''
59+
gradle_cmd: ./gradlew
60+
mod_type: forge
61+
62+
# 1.18.2 Fabric builds
63+
- version: "1.18.2"
64+
os: ubuntu-22.04
65+
platform: linux
66+
java_distribution: 'temurin'
67+
java_version: '17'
68+
build_script: build_lib_for_x11.sh
69+
native_deps: build-essential libx11-dev libxtst-dev
70+
gradle_cmd: ./gradlew
71+
mod_type: fabric
72+
73+
- version: "1.18.2"
74+
os: macos-14
75+
platform: macos
76+
java_distribution: 'temurin'
77+
java_version: '17'
78+
build_script: build_lib_for_mac.sh
79+
native_deps: ''
80+
gradle_cmd: ./gradlew
81+
mod_type: fabric
82+
83+
- version: "1.18.2"
84+
os: windows-2022
85+
platform: windows
86+
java_distribution: 'temurin'
87+
java_version: '17'
88+
build_script: build_lib_for_win.sh
89+
native_deps: ''
90+
gradle_cmd: ./gradlew
91+
mod_type: fabric
92+
93+
env:
94+
VERSION: ${{ matrix.version }}
95+
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Set up JDK ${{ matrix.java_version }}
100+
uses: actions/[email protected]
101+
with:
102+
distribution: ${{ matrix.java_distribution }}
103+
java-version: ${{ matrix.java_version }}
104+
cache: 'gradle'
105+
106+
- name: Install build dependencies (Linux)
107+
if: matrix.platform == 'linux'
108+
run: |
109+
sudo apt-get update
110+
sudo apt-get install -y ${{ matrix.native_deps }}
111+
112+
- name: Set up MinGW (Windows)
113+
if: matrix.platform == 'windows'
114+
uses: msys2/setup-msys2@v2
115+
with:
116+
update: true
117+
# msys2 has own PATH on its own
118+
install: >-
119+
mingw-w64-x86_64-toolchain
120+
make
121+
git
122+
123+
- name: Build native library (Windows)
124+
if: matrix.platform == 'windows'
125+
shell: msys2 {0}
126+
run: ./${{ matrix.build_script }}
127+
128+
- name: Build native library (Linux/macOS)
129+
if: matrix.platform != 'windows'
130+
shell: bash
131+
run: ./${{ matrix.build_script }}
132+
133+
- name: Build 1.12.2 mod
134+
if: matrix.version == '1.12.2'
135+
shell: bash
136+
run: |
137+
cd ${{ matrix.version }}
138+
${{ matrix.gradle_cmd }} build --no-daemon
139+
140+
- name: Build 1.18.2 mod (Linux/macOS/Windows)
141+
if: matrix.version == '1.18.2'
142+
shell: bash
143+
run: |
144+
cd ${{ matrix.version }}/${{ matrix.mod_type }}
145+
${{ matrix.gradle_cmd }} build --no-daemon
146+
147+
# TODO(kisaragi): cache build artifacts
148+
149+
- name: Upload 1.12.2 artifacts
150+
if: matrix.version == '1.12.2'
151+
uses: actions/upload-artifact@v4
152+
with:
153+
name: ${{ matrix.version }}-${{ matrix.mod_type }}-${{ matrix.platform }}
154+
path: ${{ matrix.version }}/build/libs/*.jar
155+
156+
- name: Upload 1.18.2 artifacts
157+
if: matrix.version == '1.18.2'
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: ${{ matrix.version }}-${{ matrix.mod_type }}-${{ matrix.platform }}
161+
path: ${{ matrix.version }}/${{ matrix.mod_type }}/build/libs/*.jar

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ libcocoainput/build
2424

2525
!fabric
2626
!forge
27+
!1.12.2
28+
!1.18.2

1.12.2/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Gradle files
2+
.gradle
3+
build/
4+
!gradle-wrapper.jar
5+
6+
# IDE files
7+
.idea/
8+
*.iml
9+
*.ipr
10+
*.iws
11+
.settings/
12+
.project
13+
.classpath
14+
bin/
15+
16+
# OS files
17+
.DS_Store
18+
Thumbs.db

1.12.2/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# The 1.12.2 implementation
2+
3+
## Supported loader
4+
5+
- [x] Minecraft Forge
6+
7+
## Supported platform
8+
9+
- [ ] Windows
10+
- [ ] Linux
11+
- [x] macOS
12+
13+
## Supported JDK
14+
15+
- 8.x
16+
17+
Other version causes a confusing error, which is triggered by the ForgeGradle's TaskApplyBinPatches:
18+
19+
```
20+
Caused by: java.lang.ClassNotFoundException: java.util.jar.Pack200
21+
```
22+
23+
You should set JAVA_HOME before build, especially if you are on systems which have multiple JDK installations.

0 commit comments

Comments
 (0)