@@ -179,6 +179,50 @@ dependencies {
179
179
// It is here in a comment in case MvnRepository's search starts working again...
180
180
// implementation 'com.github.tommyettinger:mvnrepository-client:v2.0.2.4'
181
181
}
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
+ }
182
226
183
227
construo {
184
228
// name of the executable
0 commit comments