SourceForge.net Logo

Project Summary Page - Files Download Page - CVS Info


MacBuild version 0.1-a2
Author: Mike Baranczak
This software is released under the Apache Software License, version 1.1.

GENERAL INFORMATION:

MacBuild is a plug-in module for the Ant build system. (See the Ant website for more information than you could possibly want.) Its purpose is to package a Java application as a Mac OS X application bundle. It basically does the same thing as Jar Bundler (which comes as part of Apple's developer tools package) but with two important differences: it's designed to be used in an automated build system, and it's designed for cross-platform operation. (As of this writing, it's only been tested on Mac OS 10.2.6, but it should theoretically work on all Unix-type systems.)

It's my hope that MacBuild will make things easier for folks trying to develop desktop Java apps for the Mac.

This software is still in the early stages of development; the features are pretty sparse, and it's bound to have bugs. If you're using it for anything important, and/or expect everything to work properly, you're fucking nuts.

COMPILING:

You'll have to download and install Ant, if you haven't done so already. (The version that I've been using for development is 1.5.3, which is the latest stable release as of this writing.) Note for NetBeans users: just having the NetBeans Ant module isn't enough, you'll need the stand-alone version of Ant to compile this project.

Unpack the source archive and enter the MacBuild directory.
Type ant to compile the project.
Optional commands:
- ant javadoc to generate API documentation.
- ant test to run the included test suite.
- ant clean to clean all build products.

USING MACBUILD:

I'm assuming here that you're familiar with the basic concepts in running Ant; if not, check out the manual.

Your build.xml file must include a <taskdef> tag in order for Ant to load MacBuild. It should look something like this:

<taskdef name="macbuild" classname="macbuild.MacOSXBundleTask" classpath="../MacBuild.jar"/>

(The classpath attribute isn't necassary if MacBuild.jar is already in Ant's classpath.)

You can now use the task <macbuild> to build your application. Take a look at test/build.xml for a simple example.

 

Task Attributes

Name Required? Description Default
MainClass yes (unless Plist is defined) The main application class. none
BundleName no The application name that the end user will see. "MyApplication"
BundleIconFile no Path to application icon file to be copied into the bundle. none
BundleVersion no Application version number. none
BundleShortVersionString no Application version descriptive string. none
TaskInfo no If true, prints information about this module. false
Plist no Path to an Info.plist file to be copied into the bundle. If undefined, the file will be auto-generated based on user-specified attributes. none
JVMOptions no Arguments to pass to the Java interpreter. none
Java no Path to the Java interpreter. /usr/bin/java

 

Nested Elements

Name Required? Description
FileSet yes Files (jars, etc) to be placed into bundle. At a minimum, this should include a single executable class file, or a jar file which contains an executable class.