This repository has been archived by the owner on Nov 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
build-mac.xml
121 lines (100 loc) · 4 KB
/
build-mac.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version="1.0" encoding="UTF-8"?>
<project name="ButtonDemo" default="make-bundle" basedir=".">
<property name="esmska-dist-dir" value="${basedir}/dist/"/>
<property name="app.resources" value="dist/Esmska.app/Contents/Resources/" />
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="lib/appbundler-1.0.jar"/>
<target name="make-bundle">
<bundleapp outputdirectory="dist"
name="Esmska"
displayname="Esmska"
identifier="cz.paral.Esmska"
mainclassname="esmska.Main"
shortversion="1.4.0"
icon="${basedir}/resources/icons/esmska.icns">
<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Dfile.encoding=UTF8"/>
<option value="-Duser.dir=$APP_ROOT/Contents/Resources"/>
<classpath file="dist/esmska.jar"/>
<classpath dir="${esmska-dist-dir}/lib">
<include name="*.jar"/>
</classpath>
</bundleapp>
<!-- create i18n directories in /Contents/Resources -->
<exec executable="bash" os="Mac OS X" failonerror="true">
<arg value="-c"/>
<arg value="for PO in po/*.po; do LP=`basename $$PO`; LP=$${LP%.po}.lproj; mkdir ${app.resources}/$${LP}; done"/>
</exec>
<!-- copy gateways and licence to /Contents/Resources -->
<copy todir="${app.resources}">
<fileset dir="${esmska-dist-dir}">
<include name="gateways/**"/>
<include name="license/**"/>
</fileset>
</copy>
</target>
<!--
Build DMG distribution file.
-->
<target name="build-mac-dmg" description="Build dmg distribution file.">
<!-- Set this property value to a directory where you can
mount temporarily your images, for example /tmp -->
<property name="mountdir" value="/tmp"/>
<!-- Delete previously created DMG -->
<delete file="${dmg-product-path}" quiet="yes" failonerror="false"/>
<!-- Create a temporary Disk Image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="create"/>
<arg value="-srcfolder"/>
<arg value="${esmska-dist-dir}/${application.name}.app"/>
<arg value="-volname"/>
<arg value="${application.name}"/>
<arg value="-ov"/>
<arg value="${esmska-dist-dir}/${application.name}-tmp.dmg"/>
<arg value="-format"/>
<arg value="UDRW"/>
</exec>
<!-- Attach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="attach"/>
<arg value="${esmska-dist-dir}/${application.name}-tmp.dmg"/>
<arg value="-mountroot"/>
<arg value="${mountdir}/"/>
</exec>
<!-- Copy the background, the volume icon and DS_Store files -->
<mkdir dir="${mountdir}/${application.name}/.background"/>
<copy file="${basedir}/resources/mac/background.png"
tofile="${mountdir}/${application.name}/.img/desktop.png"
overwrite="true"/>
<!--copy file="VolumeIcon.icns"
tofile="${mountdir}/${application.name}/.VolumeIcon.icns"
overwrite="true"/ -->
<copy file="${basedir}/resources/mac/DS_Store"
tofile="${mountdir}/${application.name}/.DS_Store"
overwrite="true"/>
<!-- Indicate that we want a custom icon
<exec executable="/Developer/Tools/SetFile" os="Mac OS X">
<arg value="-a"/>
<arg value="C"/>
<arg value="${mountdir}/${application.name}"/>
</exec>
-->
<!-- Add a symbolic link to the Applications directory -->
<symlink link="${mountdir}/${application.name}" resource="/Applications"/>
<!-- Detach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="detach"/>
<arg value="${mountdir}/${application.name}"/>
</exec>
<!-- Compress it to a new image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="convert"/>
<arg value="${esmska-dist-dir}/${application.name}-tmp.dmg"/>
<arg value="-format"/>
<arg value="UDZO"/>
<arg value="-o"/>
<arg value="${dmg-product-path}"/>
</exec>
<!-- Delete the temporary image -->
<delete file="${esmska-dist-dir}/${application.name}-tmp.dmg" quiet="yes" failonerror="false"/>
</target>
</project>