[snapbackup] r178 committed - Updated build process to generate Mac OS X application.

0 views
Skip to first unread message

snapb...@googlecode.com

unread,
Dec 26, 2010, 3:33:49 AM12/26/10
to snapbacku...@googlegroups.com
Revision: 178
Author: pila...@gmail.com
Date: Sun Dec 26 00:32:36 2010
Log: Updated build process to generate Mac OS X application.
http://code.google.com/p/snapbackup/source/detail?r=178

Added:
/trunk/src/installer/mac/application-bundle
/trunk/src/installer/mac/application-bundle/Snap Backup.app
/trunk/src/installer/mac/application-bundle/Snap Backup.app/Contents
/trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/Info.plist
/trunk/src/installer/mac/application-bundle/Snap Backup.app/Contents/MacOS
/trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/MacOS/JavaApplicationStub
/trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/PkgInfo
/trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/Resources
/trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/Resources/Java
Deleted:
/trunk/src/installer/mac/Jar Bundler.app
Modified:
/trunk/src/installer/mac/steps.txt
/trunk/src/tools/build.xml

=======================================
--- /dev/null
+++ /trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/Info.plist Sun Dec 26 00:32:36 2010
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist
SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>CFBundleName</key>
+ <string>Snap Backup</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.snapbackup.Main</string>
+ <key>CFBundleVersion</key>
+ <string>{snap-backup-version}</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <string>true</string>
+ <key>CFBundleExecutable</key>
+ <string>JavaApplicationStub</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleGetInfoString</key>
+ <string>{snap-backup-version}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleIconFile</key>
+ <string>snap-backup.icns</string>
+ <key>Java</key>
+ <dict>
+ <key>SplashFile</key>
+ <string>$JAVAROOT/splash.png</string>
+ <key>MainClass</key>
+ <string>org.snapbackup.Main</string>
+ <key>JVMVersion</key>
+ <string>1.5+</string>
+ <key>ClassPath</key>
+ <string>$JAVAROOT/snapbackup.jar</string>
+ <key>Properties</key>
+ <dict>
+ <key>apple.laf.useScreenMenuBar</key>
+ <string>true</string>
+ </dict>
+ </dict>
+</dict>
+</plist>
=======================================
--- /dev/null
+++ /trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/MacOS/JavaApplicationStub Sun Dec 26 00:32:36 2010
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/src/installer/mac/application-bundle/Snap
Backup.app/Contents/PkgInfo Sun Dec 26 00:32:36 2010
@@ -0,0 +1,1 @@
+APPL????
=======================================
--- /trunk/src/installer/mac/Jar Bundler.app Thu May 21 15:13:29 2009
+++ /dev/null
@@ -1,1 +0,0 @@
-link /usr/share/java/Tools/Jar Bundler.app
=======================================
--- /trunk/src/installer/mac/steps.txt Thu Jan 7 23:18:27 2010
+++ /trunk/src/installer/mac/steps.txt Sun Dec 26 00:32:36 2010
@@ -3,6 +3,28 @@
See project wiki for full instructions:
http://code.google.com/p/snapbackup/wiki/ContributorSteps

-1) Save application from "Jar Bundler" to "/snapbackup/build"
-2) Save installer from "Package Maker" to "/snapbackup/build"
-3) Compress "SnapBackupInstaller.pkg"
+1) Save installer from "Package Maker" to "/snapbackup/build"
+2) Compress "SnapBackupInstaller.pkg"
+
+
+Create Application Shell (one-time)
+===================================
+Follow these steps to convert the Executable Java Archive (JAR) file
("snapbackup.jar") into a Mac OS X application bundle shell ("Snap
Backup.app").
+
+1) Open Jar Bundler (it's in /Developer/Applications/Utilities installed
by Xcode).
+2) For "Main Class:", use the Choose... button to navigate to the
~/Projects/snapbackup/build folder and then Choose the snapbackup.jar file.
+3) Check the "Use Macintosh Menu Bar" option.
+4) Use the Choose Icon button to navigate to the
~/Projects/snapbackup/src/installer/mac folder and then Open the
snap-backup.icns file.
+5) Click the Properties tab and enter "{snap-backup-version}" into the
fields "Version:" and "Get-Info String:".
+6) Click the Create Application... button
+7) Navigate to the
~/Projects/snapbackup/src/installer/mac/application-bundle folder
+8) In the "File:" field, enter Snap Backup
+9) Click the Create button
+10) Quit Jar Bundler
+11) In Finder, navigate to
~/Projects/snapbackup/src/installer/mac/application-bundle and do a "Show
Package Contents" for Snap Backup ("Snap Backup.app")
+12) Expand all the folders and delete the files "snapbackup.jar"
and "snap-backup.icns" (the build process will later insert fresh versions)
+13) Edit the "Info.plist" to add the following key/string just above
the "MainClass" key:
+ <key>SplashFile</key>
+ <string>$JAVAROOT/splash.png</string>
+
+The shell will be used by the build process to automatically create a Mac
OS X application.
=======================================
--- /trunk/src/tools/build.xml Sun Oct 24 19:31:04 2010
+++ /trunk/src/tools/build.xml Sun Dec 26 00:32:36 2010
@@ -8,17 +8,30 @@
<!-- "snapbackup.jar" executable JAR file. -->
<!-- http://code.google.com/p/snapbackup/ -->
<!--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-->
+<!-- Be sure the version number is up to date in:
+ org/snapbackup/settings/SystemAttributes.java -->
<project>
<property name="Home" location="../.."/>
<property name="JavaSource" location="${Home}/src/java"/>
<property name="Resources" location="${Home}/src/resources"/>
+ <property name="Installer" location="${Home}/src/installer"/>
<property name="BuildFolder" location="${Home}/build"/>
<property name="JavaClasses" location="${Home}/build/classes"/>
<property name="HtmlFolder"
location="${Home}/build/classes/org/snapbackup/ui/userguide/html"/>
<property name="WebFolder" location="${Home}/build/web"/>
+ <property name="MacApp" location="${Home}/build/Snap
Backup.app/Contents"/>

<target name="build">

+ <!-- Get Snap Backup Version -->
+ <loadfile
srcfile="${JavaSource}/org/snapbackup/settings/SystemAttributes.java"
property="version">
+ <filterchain>
+ <linecontains><contains value="appVersion ="/></linecontains>
+ <replaceregex pattern="^.*\&quot;(.*)\&quot;.*$" replace="\1"/>
+ </filterchain>
+ </loadfile>
+ <echo message="Version: ${version}"/>
+
<!-- Create Class Files -->
<delete dir="${BuildFolder}"/>
<mkdir dir="${JavaClasses}"/>
@@ -75,10 +88,20 @@
<zip destfile="${WebFolder}/SnapBackup.properties.zip"
basedir="${WebFolder}"
includes="SnapBackup_*.properties.txt"/>

- <!-- Create Installer -->
+ <!-- Create Mac OS X Application -->
+ <copy todir="${BuildFolder}">
+ <fileset dir="${Installer}/mac/application-bundle"/>
+ </copy>
+ <replace file="${MacApp}/Info.plist" token="{snap-backup-version}"
value="${version}"/>
+ <chmod file="${MacApp}/MacOS/JavaApplicationStub" perm="ugo+x"/>
+ <copy file="${Installer}/mac/snap-backup.icns"
todir="${MacApp}/Resources"/>
+ <copy file="${BuildFolder}/snapbackup.jar"
todir="${MacApp}/Resources/Java"/>
+ <copy file="${Resources}/graphics/application/splash.png"
todir="${MacApp}/Resources/Java"/>
+
+ <!-- Create Windows Installer -->
<condition property="is.windows"><os family="windows"/></condition>
<copy todir="${BuildFolder}">
- <fileset dir="${Home}/src/installer/windows"/>
+ <fileset dir="${Installer}/windows"/>
</copy>
<exec dir="${BuildFolder}" executable="\Program
Files\NSIS\makensis.exe" osfamily="windows">
<arg value="/V2" />
@@ -90,12 +113,6 @@
<delete file="${BuildFolder}/SnapBackupLicense.txt"/>
<delete file="${BuildFolder}/Uninstall.txt"/>

- <!-- Display Snap Backup Version -->
- <loadfile
srcfile="${JavaSource}/org/snapbackup/settings/SystemAttributes.java"
property="version">
- <filterchain><linecontains><contains value="appVersion
="/></linecontains></filterchain>
- </loadfile>
- <echo message="${version}"/>
-
</target>

<!-- Sign Executable JAR File -->

Reply all
Reply to author
Forward
0 new messages