Skip to content

Commit 86562a2

Browse files
committed
Include the same jarMac/Linux/Win code...
... That we produce in LWJGL3 projects, in Liftoff itself. I don't know if we'll ever use these, but they make sense for the JARs distributed with Construo, since those are platform-specific anyway.
1 parent 6e24468 commit 86562a2

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

build.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,50 @@ dependencies {
179179
// It is here in a comment in case MvnRepository's search starts working again...
180180
// implementation 'com.github.tommyettinger:mvnrepository-client:v2.0.2.4'
181181
}
182+
// Builds a JAR that only includes the files needed to run on macOS, not Windows or Linux.
183+
// The file size for a Mac-only JAR is about 7MB smaller than a cross-platform JAR.
184+
tasks.register("jarMac") {
185+
dependsOn("jar")
186+
group("build")
187+
jar.archiveFileName.set("${appName}-${version}-mac.jar")
188+
jar.exclude("windows/x86/**", "windows/x64/**", "linux/arm32/**", "linux/arm64/**", "linux/x64/**", "**/*.dll", "**/*.so",
189+
'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
190+
dependencies {
191+
jar.exclude("windows/x86/**", "windows/x64/**", "linux/arm32/**", "linux/arm64/**", "linux/x64/**",
192+
'META-INF/INDEX.LIST', 'META-INF/maven/**')
193+
}
194+
}
195+
196+
// Builds a JAR that only includes the files needed to run on Linux, not Windows or macOS.
197+
// The file size for a Linux-only JAR is about 5MB smaller than a cross-platform JAR.
198+
tasks.register("jarLinux") {
199+
dependsOn("jar")
200+
group("build")
201+
jar.archiveFileName.set("${appName}-${version}-linux.jar")
202+
jar.exclude("windows/x86/**", "windows/x64/**", "macos/arm64/**", "macos/x64/**", "**/*.dll", "**/*.dylib",
203+
'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
204+
dependencies {
205+
jar.exclude("windows/x86/**", "windows/x64/**", "macos/arm64/**", "macos/x64/**",
206+
'META-INF/INDEX.LIST', 'META-INF/maven/**')
207+
}
208+
}
209+
210+
// Builds a JAR that only includes the files needed to run on x64 Windows, not Linux or macOS.
211+
// The file size for a Windows-only JAR is about 4MB smaller than a cross-platform JAR.
212+
tasks.register("jarWin") {
213+
dependsOn("jar")
214+
group("build")
215+
jar.archiveFileName.set("${appName}-${version}-win.jar")
216+
jar.exclude("macos/arm64/**", "macos/x64/**", "linux/arm32/**", "linux/arm64/**", "linux/x64/**", "**/*.dylib", "**/*.so",
217+
'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA',
218+
"windows/x86/**", "gdx.dll"
219+
)
220+
dependencies {
221+
jar.exclude("macos/arm64/**", "macos/x64/**", "linux/arm32/**", "linux/arm64/**", "linux/x64/**",
222+
'META-INF/INDEX.LIST', 'META-INF/maven/**',
223+
"windows/x86/**", "gdx.dll")
224+
}
225+
}
182226

183227
construo {
184228
// name of the executable

0 commit comments

Comments
 (0)