Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SOLVED] am i able to create 3 jars (one for each os linux64, mac, win32)

Featured Replies

Posted

Hello i have a very heavy dependency in my mod (about 150 mb in size) but i am able to shrink it to 51 mb if i will make diffrent jars for diffrent os'es now how do i automate this because i arelady know how to just dumbly put selected jars into my output jar

Edited by lukas2005

  • Author

Solved this by adding this to my build.gradle (at the end)

Spoiler
// Custom tasks
task makeTmpWin32(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'mkdir', 'tmp']
}
task unpackModWin32(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\build\\libs\\'+archivesBaseName+'-'+version+'.jar']
}
task makeTmpMac(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'mkdir', 'tmp']
}
task unpackModMac(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\build\\libs\\'+archivesBaseName+'-'+version+'.jar']
}
task makeTmpLinux64(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'mkdir', 'tmp']
}
task unpackModLinux64(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\build\\libs\\'+archivesBaseName+'-'+version+'.jar']
}
task unpackLibWin32(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\libs\\jxbrowser\\lib\\jxbrowser-win32-'+jxbrowser_version+'.jar']
}
task unpackLibMac(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\libs\\jxbrowser\\lib\\jxbrowser-mac-'+jxbrowser_version+'.jar']
}
task unpackLibLinux64(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-xvf', '..\\libs\\jxbrowser\\lib\\jxbrowser-linux64-'+jxbrowser_version+'.jar']
}
task repackWin32(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-cvf',  '..\\build\\'+archivesBaseName+'-'+version+'-win32.jar', '.']
}
task repackMac(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-cvf',  '..\\build\\'+archivesBaseName+'-'+version+'-mac.jar', '.']
}
task repackLinux64(type:Exec) {
 workingDir = 'tmp'
 commandLine = ['cmd.exe', '/c', 'jar', '-cvf',  '..\\build\\'+archivesBaseName+'-'+version+'-linux64.jar', '.']
}
task removeTmpWin32(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'rmdir', '/S', '/Q','tmp']
}
task removeTmpMac(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'rmdir', '/S', '/Q','tmp']
}
task removeTmpLinux64(type:Exec) {
 commandLine = ['cmd.exe', '/c', 'rmdir', '/S', '/Q','tmp']
}
task packageWin32() {
 dependsOn makeTmpWin32
 dependsOn unpackModWin32
 dependsOn unpackLibWin32
 dependsOn repackWin32
 dependsOn removeTmpWin32
 
 tasks.findByName('unpackModWin32').mustRunAfter 'makeTmpWin32'
 tasks.findByName('unpackLibWin32').mustRunAfter 'unpackModWin32'
 tasks.findByName('repackWin32').mustRunAfter 'unpackLibWin32'
 tasks.findByName('removeTmpWin32').mustRunAfter 'repackWin32'
}
task packageMac() {
 dependsOn makeTmpMac
 dependsOn unpackModMac
 dependsOn unpackLibMac
 dependsOn repackMac
 dependsOn removeTmpMac
 
 tasks.findByName('unpackModMac').mustRunAfter 'makeTmpMac'
 tasks.findByName('unpackLibMac').mustRunAfter 'unpackModMac'
 tasks.findByName('repackMac').mustRunAfter 'unpackLibMac'
 tasks.findByName('removeTmpMac').mustRunAfter 'repackMac'
}
task packageLinux64() {
 dependsOn makeTmpLinux64
 dependsOn unpackModLinux64
 dependsOn unpackLibLinux64
 dependsOn repackLinux64
 dependsOn removeTmpLinux64
 
 tasks.findByName('unpackModLinux64').mustRunAfter 'makeTmpLinux64'
 tasks.findByName('unpackLibLinux64').mustRunAfter 'unpackModLinux64'
 tasks.findByName('repackLinux64').mustRunAfter 'unpackLibLinux64'
 tasks.findByName('removeTmpLinux64').mustRunAfter 'repackLinux64'
}
task buildAll() {
 dependsOn build
 dependsOn packageWin32
 dependsOn packageMac
 dependsOn packageLinux64
 
 tasks.findByName('packageWin32').mustRunAfter 'build'
 tasks.findByName('packageMac').mustRunAfter 'packageWin32'
 tasks.findByName('packageLinux64').mustRunAfter 'packageMac'
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.