Skip to content

Commit 9438e17

Browse files
committed
U fixed scripts permission when bundle as tarball/zipball
1 parent 1f1b0c6 commit 9438e17

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/main/java/io/github/fvarrui/javapackager/gradle/CreateTarball.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ else if (Platform.linux.equals(platform)) {
6060
copySpec.include(appFolder.getName() + "/**");
6161
copySpec.exclude(appFolder.getName() + "/" + executable.getName());
6262
copySpec.exclude(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
63+
copySpec.exclude(appFolder.getName() + "/scripts/*");
6364
});
6465
tarTask.from(appFolder.getParentFile(), copySpec -> {
6566
copySpec.include(appFolder.getName() + "/" + executable.getName());
6667
copySpec.include(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
68+
copySpec.include(appFolder.getName() + "/scripts/*");
6769
copySpec.setFileMode(0755);
6870
});
6971

@@ -80,12 +82,14 @@ else if (Platform.mac.equals(platform)) {
8082
copySpec.exclude(appFile.getName() + "/Contents/MacOS/" + executable.getName());
8183
copySpec.exclude(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
8284
copySpec.exclude(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
85+
copySpec.exclude(appFile.getName() + "/Contents/Resources/scripts/*");
8386

8487
});
8588
tarTask.from(appFolder, copySpec -> {
8689
copySpec.include(appFile.getName() + "/Contents/MacOS/" + executable.getName());
8790
copySpec.include(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
8891
copySpec.include(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
92+
copySpec.include(appFile.getName() + "/Contents/Resources/scripts/*");
8993
copySpec.setFileMode(0755);
9094
});
9195

src/main/java/io/github/fvarrui/javapackager/gradle/CreateZipball.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ else if (Platform.linux.equals(platform)) {
5858
copySpec.include(appFolder.getName() + "/**");
5959
copySpec.exclude(appFolder.getName() + "/" + executable.getName());
6060
copySpec.exclude(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
61+
copySpec.exclude(appFolder.getName() + "/scripts/*");
6162
});
6263
zipTask.from(appFolder.getParentFile(), copySpec -> {
6364
copySpec.include(appFolder.getName() + "/" + executable.getName());
6465
copySpec.include(appFolder.getName() + "/" + jreDirectoryName + "/bin/*");
66+
copySpec.include(appFolder.getName() + "/scripts/*");
6567
copySpec.setFileMode(0755);
6668
});
6769

@@ -78,12 +80,13 @@ else if (Platform.mac.equals(platform)) {
7880
copySpec.exclude(appFile.getName() + "/Contents/MacOS/" + executable.getName());
7981
copySpec.exclude(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
8082
copySpec.exclude(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
81-
83+
copySpec.exclude(appFile.getName() + "/Contents/Resources/scripts/*");
8284
});
8385
zipTask.from(appFolder, copySpec -> {
8486
copySpec.include(appFile.getName() + "/Contents/MacOS/" + executable.getName());
8587
copySpec.include(appFile.getName() + "/Contents/MacOS/universalJavaApplicationStub");
8688
copySpec.include(appFile.getName() + "/Contents/PlugIns/" + jreDirectoryName + "/Contents/Home/bin/*");
89+
copySpec.include(appFile.getName() + "/Contents/Resources/scripts/*");
8790
copySpec.setFileMode(0755);
8891
});
8992

src/main/resources/mac/assembly.xml.vtl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#if ($info.bundleJre)
1616
<exclude>Contents/PlugIns/${info.jreDirectoryName}/Contents/Home/bin/*</exclude>
1717
<exclude>Contents/PlugIns/${info.jreDirectoryName}/Contents/Home/lib/jspawnhelper</exclude>
18+
#end
19+
#if ($info.scripts.bootstrap)
1820
<exclude>Contents/Resources/scripts/*</exclude>
1921
#end
2022
</excludes>
@@ -28,6 +30,8 @@
2830
#if ($info.bundleJre)
2931
<include>Contents/PlugIns/${info.jreDirectoryName}/Contents/Home/bin/*</include>
3032
<include>Contents/PlugIns/${info.jreDirectoryName}/Contents/Home/lib/jspawnhelper</include>
33+
#end
34+
#if ($info.scripts.bootstrap)
3135
<include>Contents/Resources/scripts/*</include>
3236
#end
3337
</includes>

0 commit comments

Comments
 (0)