Skip to content

Commit 1be1347

Browse files
committed
Moved include and exclude definition for DMG JRE
1 parent 1db4f9d commit 1be1347

File tree

3 files changed

+24
-39
lines changed

3 files changed

+24
-39
lines changed

src/com/inet/gradle/setup/dmg/AbstractOSXApplicationBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected void bundleJre() {
191191
Runtime runtime = new Runtime( jreDir );
192192
if ( task instanceof Dmg ) {
193193
List<String> include = ((Dmg)task).getJreIncludes();
194-
List<String> exclude = ((Dmg)task).getJreExclude();
194+
List<String> exclude = ((Dmg)task).getJreExcludes();
195195

196196
runtime.appendIncludes( include.toArray( new String[include.size()] ) );
197197
runtime.appendExcludes( exclude.toArray( new String[exclude.size()] ) );

src/com/inet/gradle/setup/dmg/Dmg.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,25 @@ public class Dmg extends AbstractUnixSetupTask {
4949

5050
private List<PreferencesLink> preferencesLink = new ArrayList<>();
5151

52-
private List<String> jreIncludes = Arrays.asList( "bin/java" );
53-
54-
private List<String> jreExclude = new ArrayList<>();
52+
private List<String> jreIncludes = Arrays.asList( new String[] {
53+
"lib/",
54+
"COPYRIGHT",
55+
"LICENSE",
56+
"README",
57+
"THIRDPARTYLICENSEREADME-JAVAFX.txt",
58+
"THIRDPARTYLICENSEREADME.txt",
59+
"Welcome.html"
60+
});
61+
62+
private List<String> jreExcludes = Arrays.asList( new String[] {
63+
"lib/deploy/",
64+
"lib/deploy.jar",
65+
"lib/javaws.jar",
66+
"lib/libdeploy.dylib",
67+
"lib/libnpjp2.dylib",
68+
"lib/plugin.jar",
69+
"lib/security/javaws.policy"
70+
});
5571

5672
/**
5773
* Create the task.
@@ -297,15 +313,15 @@ public void setJreIncludes( List<String> jreIncludes ) {
297313
* Get a list of string - defining files - that should be excluded from the bundled JRE
298314
* @return the jreExclude
299315
*/
300-
public List<String> getJreExclude() {
301-
return jreExclude;
316+
public List<String> getJreExcludes() {
317+
return jreExcludes;
302318
}
303319

304320
/**
305321
* Set a list of string - defining files - that should be excluded from the bundled JRE
306322
* @param jreExclude the jreExclude to set
307323
*/
308-
public void setJreExclude( List<String> jreExclude ) {
309-
this.jreExclude = jreExclude;
324+
public void setJreExcludes( List<String> jreExclude ) {
325+
this.jreExcludes = jreExclude;
310326
}
311327
}

src/com/oracle/appbundler/Runtime.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -92,44 +92,13 @@ private void patchIncludeExcludes( String[] includExclude ) {
9292
}
9393
}
9494

95-
/**
96-
* check the type of the runtime set.
97-
* If it is a JDK we want to exclude certain predefined entries
98-
*/
99-
private void detectType() {
100-
boolean isJDK = new File(getDir(), "jre").isDirectory();
101-
102-
appendIncludes(new String[] {
103-
"lib/",
104-
"COPYRIGHT",
105-
"LICENSE",
106-
"README",
107-
"THIRDPARTYLICENSEREADME-JAVAFX.txt",
108-
"THIRDPARTYLICENSEREADME.txt",
109-
"Welcome.html"
110-
});
111-
112-
if (isJDK) {
113-
appendExcludes(new String[] {
114-
"jre/lib/deploy/",
115-
"jre/lib/deploy.jar",
116-
"jre/lib/javaws.jar",
117-
"jre/lib/libdeploy.dylib",
118-
"jre/lib/libnpjp2.dylib",
119-
"jre/lib/plugin.jar",
120-
"jre/lib/security/javaws.policy"
121-
});
122-
}
123-
}
124-
12595
/**
12696
* Finally copy the files of the jre
12797
* @param targetDir where to copy
12898
* @param project the project we're working on
12999
* @throws IOException in case of errors
130100
*/
131101
void copyTo(File targetDir, Project project) throws IOException {
132-
detectType();
133102

134103
File runtimeHomeDirectory = getDir();
135104
File runtimeContentsDirectory = runtimeHomeDirectory.getParentFile();

0 commit comments

Comments
 (0)