further work on the new bundler and build script

This commit is contained in:
Ben Fry
2013-09-17 23:42:36 -04:00
parent 2d7b1041fe
commit 5955f3bb99
7 changed files with 53 additions and 12 deletions
+10 -7
View File
@@ -414,9 +414,6 @@
</copy>
-->
<!-- if loading JRE directly from .tgz, it's in a folder called
jre1.7.0_40.jre, so we'll need to strip that out. -->
<!-- workaround for apparent appbundler bug -->
<copy todir=".">
<fileset dir="macosx/template.app/Contents/Resources/"
@@ -435,9 +432,13 @@
version="Revision ${revision}"
mainClassName="processing.app.Base">
<!-- Even though the JRE is a subfolder in this dir,
it seems to be what's picked up (vs the full JDK). -->
<!-- The appbundler task needs a couple files (the Info.plist and
anything else outside /jre) from the full JDK, even though
it's primarily copying over the JRE folder. -->
<runtime dir="/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home" />
<!-- Eventually we'll want to load the JRE directly from
the .tgz on the Oracle site, though it's in a folder called
jre1.7.0_40.jre, so we'll need to strip that out. -->
<!-- Same as runtime.jars, seen above; plus core.jar. -->
<classpath file="../app/pde.jar" />
@@ -467,8 +468,8 @@
</bundledocument>
<!-- Workaround because the icon parameter for bundleapp doesn't work -->
<option value="-Xdock:icon=Contents/Resources/${bundle.icon}" />
<!--<option value="-Xdock:icon=Contents/Resources/processing.icns" />-->
<!--<option value="-Xdock:icon=Contents/Resources/${bundle.icon}" />-->
<option value="-Xdock:icon=Contents/Resources/processing.icns" />
<!--<option value="-Xdock:icon=${bundle.icon}" />-->
<!--<option value="-Xdock:icon=processing.icns" />-->
<!-- this one actually works -->
@@ -504,8 +505,10 @@
<option value="-Dcom.apple.mrj.application.apple.menu.about.name=${bundle.name}"/>
<option value="-Dcom.apple.smallTabs=true"/>
<!-- Probably no longer needed? [fry 130917]
<option value="-Xms128M" />
<option value="-Xmx256M" />
-->
</bundleapp>
<!-- workaround for apparent appbundler bug -->
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-app"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>processing-appbundler</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
@@ -48,6 +48,7 @@ import java.util.zip.ZipInputStream;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.OutputKeys;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
@@ -485,6 +486,8 @@ public class AppBundlerTask extends Task {
private void writeInfoPlist(File file) throws IOException {
Writer out = new BufferedWriter(new FileWriter(file));
XMLOutputFactory output = XMLOutputFactory.newInstance();
// output.setProperty("indent-number", 2);
output.setProperty(OutputKeys.INDENT, "yes");
try {
XMLStreamWriter xout = output.createXMLStreamWriter(out);
@@ -535,11 +538,11 @@ public class AppBundlerTask extends Task {
writeProperty(xout, "JVMRuntime", runtime.getDir().getParentFile().getParentFile().getName());
}
if ( privileged != null ) {
if (privileged != null) {
writeProperty(xout, "JVMRunPrivileged", privileged);
}
if ( workingDirectory != null ) {
if (workingDirectory != null) {
writeProperty(xout, "WorkingDirectory", workingDirectory);
}
@@ -553,20 +556,20 @@ public class AppBundlerTask extends Task {
xout.writeStartElement(ARRAY_TAG);
xout.writeCharacters("\n");
for(BundleDocument bundleDocument: bundleDocuments) {
for (BundleDocument bundleDocument: bundleDocuments) {
xout.writeStartElement(DICT_TAG);
xout.writeCharacters("\n");
writeKey(xout, "CFBundleTypeExtensions");
xout.writeStartElement(ARRAY_TAG);
xout.writeCharacters("\n");
for(String extension : bundleDocument.getExtensions()) {
for (String extension : bundleDocument.getExtensions()) {
writeString(xout, extension);
}
xout.writeEndElement();
xout.writeCharacters("\n");
if(bundleDocument.hasIcon()) {
if (bundleDocument.hasIcon()) {
writeKey(xout, "CFBundleTypeIconFile");
writeString(xout, bundleDocument.getIcon());
}
Binary file not shown.
Binary file not shown.