File tree Expand file tree Collapse file tree 6 files changed +29
-3
lines changed
java/io/github/fvarrui/javapackager Expand file tree Collapse file tree 6 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class LinuxConfig implements Serializable {
1515 private boolean generateRpm = true ;
1616 private File pngFile ;
1717 private File xpmFile ;
18+ private boolean wrapJar = true ;
1819
1920 public boolean isGenerateDeb () {
2021 return generateDeb ;
@@ -47,11 +48,19 @@ public File getXpmFile() {
4748 public void setXpmFile (File xpmFile ) {
4849 this .xpmFile = xpmFile ;
4950 }
51+
52+ public boolean isWrapJar () {
53+ return wrapJar ;
54+ }
55+
56+ public void setWrapJar (boolean wrapJar ) {
57+ this .wrapJar = wrapJar ;
58+ }
5059
5160 @ Override
5261 public String toString () {
5362 return "LinuxConfig [generateDeb=" + generateDeb + ", generateRpm=" + generateRpm + ", pngFile=" + pngFile
54- + ", xpmFile=" + xpmFile + "]" ;
63+ + ", xpmFile=" + xpmFile + ", wrapJar=" + wrapJar + " ]" ;
5564 }
5665
5766 /**
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ protected File doApply(Packager packager) throws Exception {
133133
134134 }
135135
136- // removes jre/legal folder
136+ // removes jre/legal folder as it causes problems when codesigning from Mac OS
137137 File legalFolder = new File (destinationFolder , "legal" );
138138 if (legalFolder .exists ()) {
139139 FileUtils .removeFolder (legalFolder );
@@ -144,6 +144,10 @@ protected File doApply(Packager packager) throws Exception {
144144 } else {
145145 Logger .infoUnindent ("JRE bundling skipped!" );
146146 }
147+
148+ // updates bundle jre property value, as this artifact generator could disable this option
149+ // (e.g. when bundling a jre from a different platform than the current one)
150+ packager .bundleJre (bundleJre );
147151
148152 return destinationFolder ;
149153 }
Original file line number Diff line number Diff line change @@ -65,7 +65,12 @@ public File doCreateApp() throws Exception {
6565 Logger .info ("Startup script generated in " + startupFile .getAbsolutePath ());
6666
6767 // concats linux startup.sh script + generated jar in executable (binary)
68- FileUtils .concat (executable , startupFile , jarFile );
68+ if (getLinuxConfig ().isWrapJar ())
69+ FileUtils .concat (executable , startupFile , jarFile );
70+ else {
71+ FileUtils .copyFileToFile (startupFile , executable );
72+ FileUtils .copyFileToFolder (jarFile , appFolder );
73+ }
6974
7075 // sets execution permissions
7176 executable .setExecutable (true , false );
Original file line number Diff line number Diff line change 1313 <exclude>${info . executable . name }</ exclude>
1414#if ($info.bundleJre )
1515 <exclude>${info . jreDirectoryName }/ bin/* </ exclude>
16+ <exclude>${info . jreDirectoryName }/ lib/ jspawnhelper</ exclude>
1617#end
1718 </ excludes>
1819 </ fileSet>
2324 <include>${info . executable . name }</ include>
2425#if ($info.bundleJre )
2526 <include>${info . jreDirectoryName }/ bin/* </ include>
27+ <include>${info . jreDirectoryName }/ lib/ jspawnhelper</ include>
2628#end
2729 </ includes>
2830 <fileMode>0755 </ fileMode>
Original file line number Diff line number Diff line change 5353#end
5454#end
5555
56+ #if ($info.linuxConfig.wrapJar )
5657BINARY= "$SCRIPTPATH / ${info . executable . name }"
58+ #else
59+ BINARY= "$SCRIPTPATH / ${info . jarFile . name }"
60+ #end
5761
5862#if ($info.envPath )
5963export PATH= ${info . envPath }
Original file line number Diff line number Diff line change 1414 <exclude>Contents/ MacOS/ universalJavaApplicationStub</ exclude>
1515#if ($info.bundleJre )
1616 <exclude>Contents/ PlugIns/ ${info . jreDirectoryName }/ Contents/ Home/ bin/* </ exclude>
17+ <exclude>Contents/ PlugIns/ ${info . jreDirectoryName }/ Contents/ Home/ lib/ jspawnhelper</ exclude>
1718#end
1819 </ excludes>
1920 </ fileSet>
2526 <include>Contents/ MacOS/ universalJavaApplicationStub</ include>
2627#if ($info.bundleJre )
2728 <include>Contents/ PlugIns/ ${info . jreDirectoryName }/ Contents/ Home/ bin/* </ include>
29+ <include>Contents/ PlugIns/ ${info . jreDirectoryName }/ Contents/ Home/ lib/ jspawnhelper</ include>
2830#end
2931 </ includes>
3032 <fileMode>0755 </ fileMode>
You can’t perform that action at this time.
0 commit comments