Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Added Tobias' Bley's architecture parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
will-gilbert committed Dec 27, 2010
1 parent dda0a8c commit 315ea22
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 10 deletions.
3 changes: 1 addition & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

<mkdir dir="classes"/>

<javac srcdir="src" destdir="classes" source="1.4"
classpath="${ant.jar}"/>
<javac srcdir="src" destdir="classes" source="1.4" classpath="${ant.jar}"/>
</target>


Expand Down
54 changes: 48 additions & 6 deletions dox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


<h1>Mac OS X JarBundler ANT Task</h1>
<h1>Version 2.1.0</h1>
<h1>Version 2.2.0</h1>

<p>How many times has this happened to you? You've written a little
Java utility, or maybe even a more complex application, and you want to
Expand All @@ -35,10 +35,17 @@ <h1>Version 2.1.0</h1>


<h2>What's New</h2>
<!-- Released: Oct 2008 -->
<!-- Released: Dec 2010 -->
<ul>
<li>Added the optional 'startOnMainThread' boolean attribute to JarBundler task.<br>
Thanks to Mitch Coopet for his patch and the many other feature requesters.</li>
<li>Added the optional 'jvmarchs' space delimited string attribute to JarBundler task.<br>
Thanks to Tobias Bley and his team</li>

<li>Added the optional 'lsArchitecturePriority' space delimited string attribute to JarBundler task.<br>
Thanks to Tobias Bley and his team</li>

<li>Added the optional 'suFeedURL' string attribute to JarBundler task.<br>
Thanks to Tobias Bley and his team</li>

</ul>


Expand All @@ -57,7 +64,7 @@ <h2>Download</h2>

<h2>Installation</h2>

<p>Move the file <tt>jarbundler-2.1.0.jar</tt>
<p>Move the file <tt>jarbundler-2.2.0.jar</tt>
into <tt>/usr/share/ant/lib</tt> or
into your local ANT lib directory. Remove any older versions at this time.
<strong>NB:</stong> This location used to be <tt>/Developer/Java/Ant/lib</tt>. You
Expand Down Expand Up @@ -246,7 +253,6 @@ <h2>Task Attributes, optional</h2>
</td>
</tr>


<tr>
<td class="attribute">icon</td>
<td class="description">File reference to a Mac OS X icon file. This file is created with
Expand All @@ -270,6 +276,27 @@ <h2>Task Attributes, optional</h2>
</tr>


<tr>
<td class="attribute">jvmarchs</td>
<td class="description">A space delimited string. Used to take advantage of 64-bit computing.

<div>
Example: <tt>jvmarchs="i386 x64_86 ppc"</tt>
</div>
</td>
</tr>


<tr>
<td class="attribute">lsArchitecturePriority</td>
<td class="description">A space delimited string. Contains an array of strings identifying the supported code architectures and their preferred execution priority.

<div>
Example: <tt>jvmarchs="i386 x64_86 ppc"</tt>
</div>
</td>
</tr>

<tr>
<td class="attribute">jvmversion</td>
<td class="description">The version of the JVM required to run the application.
Expand Down Expand Up @@ -361,6 +388,15 @@ <h2>Task Attributes, optional</h2>
</td>
</tr>


<tr>
<td class="attribute">suFeedURL</td>
<td class="description">Used to check for new version of the applications.
</td>
</tr>



<tr>
<td class="attribute">verbose</td>
<td class="description">If true, output more verbose information to Ant while the task is
Expand Down Expand Up @@ -738,6 +774,12 @@ <h2>Advanced JarBundler Tasks</h2>

<h2>History</h2>

<h3> Released: Oct 2008</h3>
<ul>
<li>Added the optional 'startOnMainThread' boolean attribute to JarBundler task.<br>
Thanks to Mitch Coopet for his patch and the many other feature requesters.</li>
</ul>


<h3> Released: Jan 2007 (version 2.0.0)</h3>
<ul>
Expand Down
73 changes: 72 additions & 1 deletion src/net/sourceforge/jarbundler/AppBundleProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Hashtable;
import java.util.List;
import java.util.LinkedList;
// import java.util.Scanner;

// Java language imports
import java.lang.String;
Expand Down Expand Up @@ -90,6 +91,12 @@ public class AppBundleProperties {
private List mClassPath = new ArrayList();
private List mExtraClassPath = new ArrayList();

// New in JarBundler 2.2.0; Tobias Bley ----------------
private List mJVMArchs = new ArrayList();
private List mLSArchitecturePriority = new ArrayList();
private String mSUFeedURL = null;
// -----------------------------------------------------

// Java properties
private Hashtable mJavaProperties = new Hashtable();

Expand All @@ -113,7 +120,20 @@ public Hashtable getJavaProperties() {
return mJavaProperties;
}

public void addToClassPath(String s) {
// New in JarBundler 2.2.0; Tobias Bley ----------------

public void addToJVMArchs(String s) {
mJVMArchs.add(s);
}

public List getJVMArchs() {
return mJVMArchs;
}

//------------------------------------------------------

public void addToClassPath(String s)
{
mClassPath.add("$JAVAROOT/" + s);
}

Expand Down Expand Up @@ -354,4 +374,55 @@ public List getClassPath() {
return mClassPath;
}

// New in JarBundler 2.2.0; Tobias Bley ----------------------------------------------------

/**
* @param archs space separated archs, e.g. i386 x64_64 ppc
*/

public void setJVMArchs(String archs) {

// Use for 1.4 backwards compatability
String[] tokens = archs.split("\\s+");
for (int i=0; i<tokens.length; i++)
mJVMArchs.add(tokens[i]);

// 'java.util.Scanner' is available in JDK 1.5
// Scanner s = new Scanner(archs);
// s = s.useDelimiter("\\s+");
// while (s.hasNext())
// mJVMArchs.add(s.next());
}

public List getLSArchitecturePriority() {
return mLSArchitecturePriority;

}

/**
* @param lsArchitecturePriority space separated LSArchitecturePriority, e.g. i386 x64_64 ppc
*/
public void setLSArchitecturePriority(String lsArchitecturePriority) {

// Use for 1.4 backwards compatability
String[] tokens = lsArchitecturePriority.split("\\s+");
for (int i=0; i<tokens.length; i++)
mLSArchitecturePriority.add(tokens[i]);

// 'java.util.Scanner' is available in JDK 1.5
// Scanner s = new Scanner(lsArchitecturePriority);
// s = s.useDelimiter("\\s+");
// while (s.hasNext())
// mLSArchitecturePriority.add(s.next());
}

public String getSUFeedURL() {
return mSUFeedURL;
}

public void setSUFeedURL(String suFeedURL) {
this.mSUFeedURL = suFeedURL;
}

//------------------------------------------------------------------------------------------
}
18 changes: 18 additions & 0 deletions src/net/sourceforge/jarbundler/JarBundler.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,25 @@ public void setJvmversion(String s) {
bundleProperties.setJVMVersion(s);
}

// New in JarBundler 2.2.0; Tobias Bley ----------------

/**
* Setter for the "JVMArchs" attribute (optional)
*/
public void setJvmArchs(String s) {
bundleProperties.setJVMArchs(s);
}

/**
* Setter for the "LSArchitecturePriority" attribute (optional)
*/
public void setLSArchitecturePriority(String s) {
bundleProperties.setLSArchitecturePriority(s);
}

//-------------------------------------------------------

/**
* Setter for the "startonmainthread" attribute (optional)
*/
public void setStartonmainthread(boolean b) {
Expand Down
35 changes: 34 additions & 1 deletion src/net/sourceforge/jarbundler/PropertyListWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,22 @@ private void buildDOM() {
// Target JVM version, optional but recommended
if (bundleProperties.getJVMVersion() != null)
writeKeyStringPair("JVMVersion", bundleProperties.getJVMVersion(), javaDict);

// New in JarBundler 2.2.0; Tobias Bley ---------------------------------

// JVMArchs, optional
List jvmArchs = bundleProperties.getJVMArchs();

if (jvmArchs != null && !jvmArchs.isEmpty())
writeJVMArchs(jvmArchs, javaDict);

// lsArchitecturePriority, optional
List lsArchitecturePriority = bundleProperties.getLSArchitecturePriority();

if (lsArchitecturePriority != null && !lsArchitecturePriority.isEmpty())
writeLSArchitecturePriority(lsArchitecturePriority, javaDict);

//-----------------------------------------------------------------------


// Classpath is composed of two types, required
Expand Down Expand Up @@ -409,7 +425,24 @@ private void writeJavaProperties(Hashtable javaProperties, Node appendTo) {
}
}

private Node createNode(String tag, Node appendTo) {
// New in JarBundler 2.2.0; Tobias Bley ---------------------------------

private void writeJVMArchs(List jvmArchs, Node appendTo)
{
writeKey("JVMArchs", appendTo);
writeArray(jvmArchs, appendTo);
}

private void writeLSArchitecturePriority(List lsArchitecturePriority, Node appendTo)
{
writeKey("LSArchitecturePriority", appendTo);
writeArray(lsArchitecturePriority, appendTo);
}

//----------------------------------------------------------------------

private Node createNode(String tag, Node appendTo)
{
Node node = this.document.createElement(tag);
appendTo.appendChild(node);
return node;
Expand Down

0 comments on commit 315ea22

Please sign in to comment.