This post explains how I build applications for the TINI using Xcode. It was written for Xcode 2.4.
Create a new Java Tool project in Xcode. The description says “This project builds a library or application as a JAR file.”
Double-click the main and only target under Targets. The target editor opens. We will need to do the following:
tiniclasses.jarto the search path for Java classes;
- tell javac to target version 1.1 of the virtual machine;
- tell Xcode to generate a class hierarchy instead of a Java archive (JAR file).
In Search Paths, drag and drop the
tiniclasses.jarfile (from the TINI SDK) under Java Classes, or select Java Classes, click the + button and select the
tiniclasses.jarfile in the file dialogue. This adds the TINI classes to the class path.
In Java Compiler Settings, change Target VM Version to 1.1 and Source Version to 1.3. The TINI runs a 1.1 virtual machine and a source version of 1.3 seems to be required in order to compile version 1.1 classes.
In Java Archive Settings, change Product Type to Class Hierarchy. This will create a folder containing the class files, on which we can subsequently run the
TINIConvertortool, instead of a JAR file.
The final step is to call the
TINIConvertor tool through a shel script build phase, in order to build the TINI executable:
Right-click on the last build phase in the left pane of the target editor (most likely Copy Files) and select New Build Phase — New Shell Script Build Phase. A Run Script build phase will be added to the end of the build phase list.
In the Script text field of the new build phase, paste the following script:
TINIPATH=$LOCAL_LIBRARY_DIR/TINI/bin java -classpath "$TINIPATH/tini.jar" TINIConvertor \ -f "$CLASS_FILE_DIR" -d "$TINIPATH/tini.db" \ -o "$TARGET_BUILD_DIR/$PRODUCT_NAME.tini"
Replace the value for
TINIPATHwith the actual path to your copy of the TINI SDK, i.e. the folder that contains
tini.db. We use
$CLASS_FILE_DIRto locate the class files,
$TARGET_BUILD_DIRto locate the build directory and
$PRODUCT_NAMEto name the executable.
That’s it. Unfortunately, it seems that you have to go through these steps for both the Debug and Release build configurations. You can now build your project and if all goes well, a
.tini file should land in your
build/Release folder. If not, drop me a note.