Skip to content

Commit 405abc4

Browse files
author
gk_brown
committed
Add default runtime excludes.
git-svn-id: https://svn.java.net/svn/appbundler~svn@16 07572b26-92e5-4d45-f66a-c18421440a21
1 parent 26cd709 commit 405abc4

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

appbundler/doc/appbundler.html

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,22 @@ <h3>Parameters specified as nested elements</h3>
106106
<h4>runtime</h4>
107107
<p>A <a href="http://ant.apache.org/manual/Types/fileset.html">fileset</a> representing the Java
108108
runtime to embed in the application. Corresponds to the <code>JVMRuntime</code> key in the
109-
<tt>Info.plist</tt> file. If specified, the contents of this directory will be copied to the
110-
<tt>Contents/PlugIns/</tt> folder of the generated bundle. If unspecified, the target system must
111-
have a shared JRE installed in <tt>/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/</tt>.</p>
109+
<tt>Info.plist</tt> file.</p>
110+
111+
<p>This element is optional. If specified, the runtime will be copied to the
112+
<tt>Contents/PlugIns/</tt> folder of the generated bundle. If omitted, the target system must
113+
have a shared JRE installed in <tt>/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/</tt>
114+
in order to run the application.</p>
115+
116+
<p>By default, the following runtime content will be excluded from the generated bundle:<p>
117+
<ul>
118+
<li><tt>Contents/Home/bin/</tt></li>
119+
<li><tt>Contents/Home/jre/bin/</tt></li>
120+
<li><tt>Contents/Home/man/</tt></li>
121+
<li><tt>Contents/Home/src.zip</tt></li>
122+
</ul>
123+
124+
<p>Additional content can be excluded using nested <code>&lt;excludes/&gt;</code> elements.</p>
112125

113126
<h4>classpath</h4>
114127
<p>A <a href="http://ant.apache.org/manual/Types/fileset.html">fileset</a> representing the class
@@ -151,8 +164,10 @@ <h4>argument</h4>
151164
</table>
152165

153166
<h3>Examples</h3>
154-
<p>Generate a launcher for the "Swing Set" demo, bundling the JRE defined by the
155-
<tt>JAVA_HOME</tt> environment variable with the resulting executable:</p>
167+
<p>Generate a launcher for the "Swing Set" demo, bundling the JRE defined by the <tt>JAVA_HOME</tt>
168+
environment variable with the resulting executable. In addition to the default excludes, the
169+
contents of the <tt>Contents/Home/db/</tt> and <tt>Contents/Home/lib/</tt> folders will also be
170+
excluded from the bundled runtime:</p>
156171
<pre>
157172
&lt;-- Import environment variables --&gt;
158173
&lt;property environment="env"/&gt;
@@ -169,6 +184,9 @@ <h3>Examples</h3>
169184
shortversion="1.0"
170185
mainclassname="SwingSet2"&gt;
171186
&lt;runtime dir="${env.JAVA_HOME}/../.."/&gt;
187+
&lt;exclude name="Contents/Home/db/"/&gt;
188+
&lt;exclude name="Contents/Home/lib/"/&gt;
189+
&lt;/runtime&gt;
172190
&lt;classpath file="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/&gt;
173191
&lt;option value="-Dapple.laf.useScreenMenuBar=true"/&gt;
174192
&lt;/bundleapp&gt;

appbundler/src/com/oracle/appbundler/AppBundlerTask.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ public void addConfiguredRuntime(FileSet runtime) throws BuildException {
128128

129129
this.runtime = runtime;
130130

131-
// TODO Add default excludes
131+
runtime.appendExcludes(new String[] {
132+
"Contents/MacOS/",
133+
"Contents/Info.plist",
134+
"Contents/Home/bin/",
135+
"Contents/Home/jre/bin/",
136+
"Contents/Home/man/",
137+
"Contents/Home/src.zip"
138+
});
132139
}
133140

134141
public void addConfiguredClassPath(FileSet classPath) {

build.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,8 @@ questions.
143143
shortversion="1.0"
144144
mainclassname="SwingSet2">
145145
<runtime dir="${env.JAVA_HOME}/../..">
146-
<exclude name="Contents/MacOS/"/>
147-
<exclude name="Contents/Info.plist"/>
148-
<exclude name="Contents/Home/bin/"/>
149146
<exclude name="Contents/Home/db/"/>
150147
<exclude name="Contents/Home/lib/"/>
151-
<exclude name="Contents/Home/jre/bin/"/>
152-
<exclude name="Contents/Home/jre/lib/JObjC.jar"/>
153-
<exclude name="Contents/Home/man/"/>
154-
<exclude name="Contents/Home/src.zip"/>
155148
</runtime>
156149
<classpath file="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/>
157150
<option value="-Dapple.laf.useScreenMenuBar=true"/>

0 commit comments

Comments
 (0)