Ticket #1471: macbundle.diff

File macbundle.diff, 5.7 KB (added by me@…, 16 years ago)

Patch to create a bundle and a dmg.

  • build.xml

     
    22
    33        <!-- All jar files necessary to run only JOSM (no tests) -->
    44        <fileset id="josm_required_libs" dir="lib">
    5                 <include name="gettext-commons-0.9.2.jar"/>
    6                 <include name="metadata-extractor-2.3.1-nosun.jar"/>
     5                <include name="gettext-commons-0.9.2.jar" />
     6                <include name="metadata-extractor-2.3.1-nosun.jar" />
    77        </fileset>
    88
    99        <!-- Java classpath addition (all jar files to compile tests with this) -->
    1010        <path id="classpath">
    1111                <fileset dir="lib">
    12                         <include name="**/*.jar"/>
     12                        <include name="**/*.jar" />
    1313                </fileset>
    1414        </path>
    1515
     
    3333                <copy file="styles/standard/elemstyles.xml" todir="build/styles/standard"/>
    3434
    3535                <!-- create josm-custom.jar -->
    36                 <delete file="dist/josm-custom.jar"/>
     36                <delete file="dist/josm-custom.jar" />
    3737                <jar destfile="dist/josm-custom.jar" basedir="build">
    3838                        <manifest>
    3939                                <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication" />
    4040                        </manifest>
    4141                </jar>
     42                <!-- Create Mac Os X bundle -->
     43                <exec dir="." os="Mac OS X" executable="/bin/sh">
     44                    <arg value="-c" />
     45                    <arg value="./osx/mkbundle.sh" />
     46                </exec>
    4247        </target>
    4348
     49    <target name="release" depends="dist">
     50                <!-- Create dmg for Mac OS X -->
     51                <exec dir="." os="Mac OS X" executable="/bin/sh">
     52                    <arg value="-c" />
     53                    <arg value="./osx/mkdmg.sh" />
     54                </exec>   
     55    </target>
     56
    4457        <target name="compile" depends="init">
    4558                <javac srcdir="src" classpathref="classpath" destdir="build"
    4659                                target="1.5" source="1.5" debug="on" encoding="UTF-8">
    47                         <compilerarg value="-Xlint:deprecation"/>
     60                        <compilerarg value="-Xlint:deprecation" />
    4861                </javac>
    4962        </target>
    5063
  • osx/Info.plist

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: osx/josm.icns
    ___________________________________________________________________
    Name: svn:mime-type
       + application/octet-stream
    
     
     1<?xml version="1.0" encoding="UTF-8"?>
     2<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
     3<plist version="0.9">
     4<dict>
     5        <key>CFBundleName</key>
     6        <string>JOSM</string>
     7        <key>CFBundleVersion</key>
     8        <string>897</string>
     9        <key>CFBundleAllowMixedLocalizations</key>
     10        <string>false</string>
     11        <key>CFBundleExecutable</key>
     12        <string>JavaApplicationStub</string>
     13        <key>CFBundleDevelopmentRegion</key>
     14        <string>English</string>
     15        <key>CFBundlePackageType</key>
     16        <string>APPL</string>
     17        <key>CFBundleShortVersionString</key>
     18        <string>897</string>
     19        <key>CFBundleSignature</key>
     20        <string>????</string>
     21        <key>CFBundleGetInfoString</key>
     22        <string>JOSM 897</string>
     23        <key>CFBundleInfoDictionaryVersion</key>
     24        <string>6.0</string>
     25        <key>CFBundleIconFile</key>
     26        <string>josm.icns</string>
     27        <key>Java</key>
     28        <dict>
     29                <key>VMOptions</key>
     30                <string>-Dsun.java2d.opengl=True</string>
     31                <key>MainClass</key>
     32                <string>org.openstreetmap.josm.gui.MainApplication</string>
     33                <key>JVMVersion</key>
     34                <string>1.5+</string>
     35                <key>ClassPath</key>
     36                        <string>$JAVAROOT/josm.jar</string>
     37        </dict>
     38</dict>
     39</plist>
  • osx/mkdmg.sh

     
     1#!/bin/sh
     2#Remove old dmg if it already exists
     3rm ./dist/JOSM.dmg
     4
     5#first we prepare all files we want in our disk image in a new folder
     6mkdir ./dist/dmg/
     7cp -r ./dist/JOSM.app ./dist/dmg/JOSM.app
     8SetFile -a B ./dist/dmg/JOSM.app
     9
     10#Create the dmg, reduce it size to the minimum requiered, compress it and clean up
     11hdiutil create -size 100m -fs HFS+ -layout NONE -format UDIF -volname JOSM -srcfolder ./dist/dmg/ -noanyowners ./dist/TEMP
     12hdiutil convert -format UDBZ ./dist/TEMP.dmg -o ./dist/JOSM.dmg
     13hdiutil internet-enable -yes ./dist/JOSM.dmg
     14
     15rm -r ./dist/dmg
     16rm ./dist/TEMP.dmg
     17 No newline at end of file
  • osx/mkbundle.sh

    Property changes on: osx/mkdmg.sh
    ___________________________________________________________________
    Name: svn:executable
       + *
    
     
     1#!/bin/sh
     2
     3#Creates a Mac OS X Bundle for JOSM
     4
     5#Create he requiered folders
     6mkdir ./dist/JOSM.app
     7mkdir ./dist/JOSM.app/Contents
     8mkdir ./dist/JOSM.app/Contents/MacOS
     9mkdir ./dist/JOSM.app/Contents/Resources
     10mkdir ./dist/JOSM.app/Contents/Resources/Java
     11
     12#Copy the exectubale from the system framework into the bundle
     13cp /System/Library/Frameworks/JavaVM.framework/Versions/Current/Resources/MacOS/JavaApplicationStub ./dist/JOSM.app/Contents/MacOS/JavaApplicationStub
     14
     15#Copy OSX specific files into the bundle
     16cp ./osx/PkgInfo ./dist/JOSM.app/Contents/PkgInfo
     17cp ./osx/Info.plist ./dist/JOSM.app/Contents/Info.plist
     18cp ./osx/josm.icns ./dist/JOSM.app/Contents/Resources/josm.icns
     19
     20#Copy the jar into the bundle
     21cp ./dist/josm-custom.jar ./dist/JOSM.app/Contents/Resources/Java/josm.jar
     22
     23#And finally tell Mac OS that this is a Bundle
     24SetFile -a B ./dist/JOSM.app
     25 No newline at end of file
  • osx/PkgInfo

    Property changes on: osx/mkbundle.sh
    ___________________________________________________________________
    Name: svn:executable
       + *
    
     
     1APPL????
     2 No newline at end of file