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

Commit

Permalink
Merge pull request #1 from AQuillet/master
Browse files Browse the repository at this point in the history
Added optional "contentSize" attribute
  • Loading branch information
tofi86 committed Nov 6, 2015
2 parents 05d0871 + 9dd0556 commit e5cbde5
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ JarBundler is a feature-rich Apache ANT task that can create Mac OS X Applicatio
Modifications
-----

* **version 2.5.0** (2015-11-06)
* Added optional `contentSize` attribute to JarBundler task (for Plist key `NSPreferencesContentSize`)

* **version 2.4.0** (2015-05-15)
* Added optional `useJavaXKey` attribute to JarBundler task (for [universalJavaApplicationStub](https://github.com/tofi86/universalJavaApplicationStub)-Support)
* Added optional `hiResCapable` attribute to JarBundler task (for Plist key `NSHighResolutionCapable`)
Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project name="jarbundler" default="jar" basedir=".">

<property name="version" value="2.4.0"/>
<property name="version" value="2.5.0"/>
<property name="description" value="ANT task for creating Mac OS X application bundles"/>


Expand All @@ -10,7 +10,7 @@
<property name="release.tar" value="${ant.project.name}.tar" />


<!-- Needs to reference this in order to compile -->
<!-- Needs to reference this in order to compile -->
<!-- This path works only for OS X, Windows, and Linux must redefine -->
<property name="ant.jar" value="/Developer/Java/Ant/lib/ant.jar" />

Expand Down
28 changes: 20 additions & 8 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.4.0</h1>
<h1>Version 2.5.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 @@ -34,13 +34,10 @@ <h1>Version 2.4.0</h1>



<h2>What's New, May 2015</h2>
<!-- Released: May 2015 (version 2.4.0) -->
<h2>What's New, November 2015</h2>
<!-- Released: November 2015 (version 2.5.0) -->
<ul>
<li>Added optional <tt>useJavaXKey</tt> attribute to JarBundler task (for <a href="https://github.com/tofi86/universalJavaApplicationStub">universalJavaApplicationStub</a>-Support)</li>
<li>Added the optional <tt>hiResCapable</tt> boolean attribute to JarBundler task (for Plist key <tt>NSHighResolutionCapable</tt>)</li>
<li>Removed deprecated <tt>aboutmenuname</tt> attribute</li>
<li>Removed deprecated <tt>infostring</tt> and <tt>shortinfostring</tt> attributes (use <tt>copyright</tt> attribute instead)</li>
<li>Added optional <tt>contentSize</tt> attribute to JarBundler task (for Plist key <tt>NSPreferencesContentSize</tt>)</li>
</ul>


Expand All @@ -59,7 +56,7 @@ <h2>Download</h2>

<h2>Installation</h2>

<p>Move the file <tt>jarbundler-2.4.0.jar</tt>
<p>Move the file <tt>jarbundler-2.5.0.jar</tt>
into your local ANT lib directory. Remove any older versions at this time.

<h2>Using in the Build file</h2>
Expand Down Expand Up @@ -199,6 +196,16 @@ <h2>Task Attributes, optional</h2>

</td>
</tr>

<tr>
<td class='attribute'>contentSize</td>
<td class='description'>A string with the window content size, in the form of a couple of integers (the first one for content width, the second one for content height); for example "<tt>400,200</tt>"
<div>
<!--It seems like this bundle variable is never referenced in Apple documentation... -->
The corresponding bundle variable is NSPreferencesContentSize.
</div>
</td>
</tr>

<tr>
<td class='attribute'>copyright</td>
Expand Down Expand Up @@ -794,6 +801,11 @@ <h2>Advanced JarBundler Tasks</h2>

<h2>History</h2>

<h3> Released: November 2015 (version 2.5.0)</h3>
<ul>
<li>Added optional <tt>contentSize</tt> attribute to JarBundler task (for Plist key <tt>NSPreferencesContentSize</tt>)</li>
</ul>

<h3> Released: May 2015 (version 2.4.0)</h3>
<ul>
<li>Added optional <tt>useJavaXKey</tt> attribute to JarBundler task (for <a href="https://github.com/tofi86/universalJavaApplicationStub">universalJavaApplicationStub</a>-Support)</li>
Expand Down
11 changes: 11 additions & 0 deletions src/net/sourceforge/jarbundler/AppBundleProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public class AppBundleProperties {

// HiRes capability, optional
private boolean mNSHighResolutionCapable = false;

// Window size, optional (per Adrien Quillet <[email protected]>)
private String mNSPreferencesContentSize = null;

// Support for JavaX key, optional
private boolean mJavaXKey = false;
Expand Down Expand Up @@ -286,6 +289,14 @@ public void setNSHighResolutionCapable(boolean b) {
public boolean getNSHighResolutionCapable() {
return mNSHighResolutionCapable;
}

public void setNSPreferencesContentSize(String s) {
mNSPreferencesContentSize = s;
}

public String getNSPreferencesContentSize() {
return mNSPreferencesContentSize;
}

public void setJavaXKey(boolean b) {
mJavaXKey = b;
Expand Down
12 changes: 12 additions & 0 deletions src/net/sourceforge/jarbundler/JarBundler.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,18 @@ public void setCopyright(String s) {
public void setHiResCapable(boolean b) {
bundleProperties.setNSHighResolutionCapable(b);
}

/** Adrien Quillet, v2.5.0
* Setter for the "NSPreferencesContentSize" attribute (optional).
*/
public void setContentSize(String s) {
// Check input consistency
String pattern = "[0-9]+,[0-9]+";
if(!s.matches(pattern)) {
throw new BuildException("Invalid content size format (expected 'width,height')");
}
bundleProperties.setNSPreferencesContentSize(s);
}

/** Tobias Fischer, v2.4.0
* Setter for the alternative 'JavaX' dictionary key
Expand Down
4 changes: 4 additions & 0 deletions src/net/sourceforge/jarbundler/PropertyListWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ private void buildDOM() {
// HiRes capability, optional
if ( bundleProperties.getNSHighResolutionCapable() != false )
writeKeyBooleanPair( "NSHighResolutionCapable", bundleProperties.getNSHighResolutionCapable(), dict );

// Content size, optional
if ( bundleProperties.getNSPreferencesContentSize() != null )
writeKeyStringPair( "NSPreferencesContentSize", "{" + bundleProperties.getNSPreferencesContentSize() + "}", dict );

// IsAgent, optional
if ( bundleProperties.getLSUIElement() != null )
Expand Down

0 comments on commit e5cbde5

Please sign in to comment.