Skip to content

Commit 19966bf

Browse files
committed
Build & ship aarch64 linux natives
1 parent 283c0f6 commit 19966bf

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

buildSrc/src/main/groovy/multiloader-loader.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,6 @@ publishMods {
6464
minecraftVersions.add(minecraft_version)
6565
}*/
6666

67-
github {
68-
repository = "ryanhcode/sable"
69-
accessToken = providers.environmentVariable("GITHUB_TOKEN")
70-
tagName = "mc$minecraft_version-$project.version-$project.name"
71-
commitish = "main"
72-
73-
file.unset()
74-
file.unsetConvention()
75-
76-
allowEmptyFiles = true
77-
}
78-
7967
modrinth {
8068
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
8169
projectId = "T9PomCSv"
@@ -91,4 +79,16 @@ publishMods {
9179

9280
embeds("veil")
9381
}
82+
83+
github {
84+
repository = "ryanhcode/sable"
85+
accessToken = providers.environmentVariable("GITHUB_TOKEN")
86+
tagName = "mc$minecraft_version-$project.version-$project.name"
87+
commitish = "main"
88+
89+
file.unset()
90+
file.unsetConvention()
91+
92+
allowEmptyFiles = true
93+
}
9494
}

common/build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import org.apache.tools.ant.taskdefs.condition.Os
2-
import org.gradle.api.internal.tasks.userinput.UserInputHandler
32

43
plugins {
54
id 'multiloader-common'
@@ -66,6 +65,14 @@ tasks.register('compileRustMac', Exec) {
6665
dependsOn createContainersDirectory
6766
}
6867

68+
tasks.register('compileRustLinuxAArch64', Exec) {
69+
group = 'rust'
70+
workingDir rustProjectDir
71+
commandLine dockerCommand
72+
args 'cargo', 'zigbuild', '--release', '--target', 'aarch64-unknown-linux-gnu'
73+
dependsOn createContainersDirectory
74+
}
75+
6976
tasks.register('compileRustLinux', Exec) {
7077
group = 'rust'
7178
workingDir rustProjectDir
@@ -86,7 +93,7 @@ tasks.register('buildRustNatives') {
8693
group = 'build'
8794
description = 'Compiles all Rust natives and moves them to resources.'
8895

89-
dependsOn compileRustMac, compileRustLinux, compileRustWindows
96+
dependsOn compileRustMac, compileRustLinux, compileRustLinuxAArch64, compileRustWindows
9097
finalizedBy copyRustNatives
9198
}
9299

@@ -99,8 +106,10 @@ tasks.register('copyRustNatives', Copy) {
99106
def moves = [
100107
[src: "target/aarch64-apple-darwin/release/libsable_rapier.dylib", dest: "sable_rapier_aarch64_macos.dylib"],
101108
[src: "target/x86_64-unknown-linux-gnu/release/libsable_rapier.so", dest: "sable_rapier_x86_64_linux.so"],
109+
[src: "target/aarch64-unknown-linux-gnu/release/libsable_rapier.so", dest: "sable_rapier_aarch64_linux.so"],
102110
[src: "target/x86_64-pc-windows-gnu/release/sable_rapier.dll", dest: "sable_rapier_x86_64_windows.dll"]
103111
]
112+
104113
moves.forEach { map ->
105114
from(file("$rustProjectDir/${map.src}")) {
106115
rename { map.dest }

common/src/main/rust/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ RUN rustup default $RUST_VERSION
77
RUN rustup target add x86_64-pc-windows-gnu
88
RUN rustup target add aarch64-apple-darwin
99
RUN rustup target add x86_64-unknown-linux-gnu
10+
RUN rustup target add aarch64-unknown-linux-gnu
1011

1112
WORKDIR /

0 commit comments

Comments
 (0)