This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
123 lines (115 loc) · 5.5 KB
/
build.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
122
123
<?xml version="1.0" encoding="UTF-8"?>
<project name="SceneBuilder" default="dist">
<property file="version.properties"/>
<fail unless="app.version" message="File version.properties should specify app.version."/>
<property name="module.core" value="core"/>
<property name="module.builtins" value="builtins"/>
<property name="module.graphics" value="graphics"/>
<property name="module.pixie" value="pixie"/>
<property name="module.video" value="video"/>
<property name="module.toxiclibscore" value="toxiclibscore"/>
<property name="module.app" value="app"/>
<property name="app.res.mac" value="app/platform/mac/res"/>
<property name="dist.mac.dir" value="dist/mac"/>
<property name="dist.mac" value="dist/mac/${ant.project.name}"/>
<property name="dist.mac.examples" value="${dist.mac}/Examples"/>
<property name="dist.mac.app" value="${dist.mac}/${ant.project.name}.app"/>
<property name="dist.mac.stub" location="${dist.mac.app}/Contents/MacOS/${ant.project.name}"/>
<property name="dist.mac.contents" location="${dist.mac.app}/Contents"/>
<property name="dist.mac.res" location="${dist.mac.contents}/Resources"/>
<property name="dist.mac.java" location="${dist.mac.res}"/>
<property name="apple.appstub"
location="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub"/>
<target name="dist">
<copy file="lib/mvel2.jar" todir="dist"/>
<ant dir="${module.core}" antfile="build.xml" target="dist"/>
<ant dir="${module.builtins}" antfile="build.xml" target="dist"/>
<ant dir="${module.graphics}" antfile="build.xml" target="dist"/>
<ant dir="${module.pixie}" antfile="build.xml" target="dist"/>
<ant dir="${module.video}" antfile="build.xml" target="dist"/>
<!-- <ant dir="${module.toxiclibscore}" antfile="build.xml" target="dist"/> -->
<ant dir="${module.app}" antfile="build.xml" target="dist"/>
<mkdir dir="dist/configuration"/>
<copy todir="dist/configuration">
<fileset dir="app/res/configuration"/>
</copy>
<copy todir="dist" file="lib/equinox.jar"/>
<copy todir="dist" file="version.properties"/>
</target>
<target name="clean">
<ant dir="${module.core}" antfile="build.xml" target="clean"/>
<ant dir="${module.builtins}" antfile="build.xml" target="clean"/>
<ant dir="${module.graphics}" antfile="build.xml" target="clean"/>
<ant dir="${module.pixie}" antfile="build.xml" target="clean"/>
<ant dir="${module.video}" antfile="build.xml" target="clean"/>
<ant dir="${module.toxiclibscore}" antfile="build.xml" target="clean"/>
<ant dir="${module.app}" antfile="build.xml" target="clean"/>
<delete dir="dist"/>
</target>
<target name="run" depends="dist">
<java fork="true" dir="dist" classpath="dist/equinox.jar"
classname="org.eclipse.core.runtime.adaptor.EclipseStarter">
<arg value="-console"/>
<arg value="-clean"/>
<jvmarg value="-d32"/>
</java>
</target>
<target name="dist-mac" depends="dist" description="Make a double-clickable Mac OS X application">
<mkdir dir="${dist.mac.app}"/>
<mkdir dir="${dist.mac.java}"/>
<mkdir dir="${dist.mac.examples}"/>
<!-- Copy library and program archives-->
<copy todir="${dist.mac.java}">
<fileset dir="lib">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
<fileset dir="dist">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
</copy>
<!-- Copy resources-->
<copy todir="${dist.mac.res}">
<fileset dir="app/res"/>
</copy>
<!-- Copy application stub -->
<copy file="${apple.appstub}" toFile="${dist.mac.stub}"/>
<!-- Fix stub permissions -->
<chmod file="${dist.mac.stub}" perm="755"/>
<!-- Copy additional Mac contents -->
<copy todir="${dist.mac.contents}">
<fileset dir="${app.res.mac}"/>
</copy>
<mkdir dir="${dist.mac.java}/configuration"/>
<copy todir="${dist.mac.java}/configuration">
<fileset dir="app/res/configuration"/>
</copy>
<!-- Replace version number -->
<replace file="${dist.mac.contents}/Info.plist" token="@@VERSION@@" value="${app.version}"/>
<!-- Copy version number -->
<copy file="version.properties" todir="${dist.mac.res}"/>
<!-- Make directory into a bundle -->
<exec executable="/Developer/Tools/SetFile">
<arg line="-a B ${dist.mac.app}"/>
</exec>
<!-- Copy examples -->
<copy todir="${dist.mac.examples}">
<fileset dir="examples"/>
</copy>
<!-- Bundle into DMG -->
<exec executable="hdiutil">
<arg line="create -srcfolder ${dist.mac} ${dist.mac.dir}/${ant.project.name}-${app.version}.dmg"/>
</exec>
<!-- Internet-enable DMG -->
<exec executable="hdiutil">
<arg line="internet-enable ${dist.mac.dir}/${ant.project.name}-${app.version}.dmg"/>
</exec>
</target>
<target name="run-mac" depends="dist-mac" description="Run the double-clickable application">
<!-- Use the exec task to open the application -->
<exec executable="/usr/bin/open" os="Mac OS X">
<arg line="${dist.mac.app}"/>
</exec>
</target>
</project>