Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 206 lines (165 sloc) 8.525 kB
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to you under the Apache License,
7 Version 2.0 (the "License"); you may not use this file except in
8 compliance with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 -->
18
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
19 <!--
20 This build script demonstrates several ways to package a Pivot application. Each method can
21 demonstrated by calling the appropriate build target:
22
23 1) As an applet deployed via a Java EE web archive (WAR) file ("deploy-applet").
24
25 2) As a Windows executable ("deploy-windows"). This target requires Launch4J, available from
26 http://launch4j.sourceforge.net/index.html. This software is distributed under the BSD license.
27
28 The software can be installed anywhere; however, the location of the installation directory must
29 be specified as a command-line argument when executing Ant:
30
31 -Dlaunch4j.dir=<full path to installation directory>
32
33 The example executable requires the presence of a previously installed JRE; however, Launch4J
34 can alternatively be configured to bundle a JRE in the resulting executable.
35
36 3) As a Mac OS X application bundle ("deploy-osx"). This target requires JarBundler, available
37 from http://informagen.com/JarBundler/. This software is distributed under the GNU GPL license.
38
39 JarBundler requires Mac OS X. See the project home page for installation instructions.
40 -->
41
42 <project name="examples" default="compile">
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
43 <property file="build.properties"/>
44
45 <property name="folder.src" value="src"/>
46 <property name="folder.bin" value="ant-bin"/>
47 <property name="folder.lib" value="lib"/>
48 <property name="folder.www" value="www"/>
49
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
50 <property name="example.name" value="Deployment Example"/>
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
51 <property name="example.path" value="org/apache/pivot/examples/deployment"/>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
52
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
53 <property name="example.jar" value="deployment-example.jar"/>
54 <property name="example.war" value="deployment-example.war"/>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
55
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
56 <property name="example.exe" value="deployment-example.exe"/>
57 <property name="example-windows.zip" value="deployment-example-windows.zip"/>
58
59 <property name="example.app" value="${example.name}.app"/>
60 <property name="example-osx.tar.gz" value="deployment-example-osx.tar.gz"/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
61
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
62 <!-- Compile the example application -->
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
63 <target name="compile">
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
64 <echo message="Compiling..."/>
65 <ant target="compile"/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
66
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
67 <mkdir dir="${ant.project.name}/${folder.bin}"/>
68 <javac srcDir="${ant.project.name}/${folder.src}"
69 destDir="${ant.project.name}/${folder.bin}"
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
70 classpath="core/${folder.bin}:wtk/${folder.bin}"
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
71 includejavaruntime="true"
72 includeantruntime="true"
73 deprecation="true"
74 debug="true"
75 target="1.6"
76 encoding="UTF-8"
77 failonerror="true">
78 <include name="${example.path}/**"/>
79 </javac>
80 </target>
81
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
82 <!-- Generate the example JAR -->
83 <target name="package" depends="compile">
84 <echo message="Packaging..."/>
85 <ant target="package"/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
86
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
87 <jar destfile="${folder.lib}/${example.jar}">
e49742a Update deployment-example.xml.
Gregory K. Brown authored
88 <fileset dir="${ant.project.name}/${folder.bin}"/>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
89 <fileset dir="${ant.project.name}/${folder.src}">
e49742a Update deployment-example.xml.
Gregory K. Brown authored
90 <include name="${example.path}/**"/>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
91 <exclude name="**/*.java"/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
92 <exclude name="web.xml"/>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
93 </fileset>
94 </jar>
95 </target>
96
97 <!-- Clean up -->
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
98 <target name="clean">
99 <ant target="clean"/>
100
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
101 <delete dir="${ant.project.name}/${folder.bin}"/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
102
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
103 <delete dir="${ant.project.name}/${folder.www}"/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
104
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
105 <delete file="${example.exe}"/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
106 <delete file="${example-windows.zip}"/>
107
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
108 <delete dir="${example.app}"/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
109 <delete file="${example-osx.tar.gz}"/>
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
110 </target>
111
112 <target name="deploy" depends="deploy-applet, deploy-windows, deploy-osx"/>
113
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
114 <!-- Package example application for deployment via web browser -->
115 <target name="deploy-applet" depends="package">
116 <echo message="Generating WAR file..."/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
117
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
118 <mkdir dir="${ant.project.name}/${folder.www}"/>
119 <mkdir dir="${ant.project.name}/${folder.www}/lib"/>
120
121 <!-- Copy the platform JARs -->
122 <copy todir="${ant.project.name}/${folder.www}/lib">
123 <fileset dir="${folder.lib}">
124 <include name="pivot-core-${version}.jar"/>
125 <include name="pivot-wtk-${version}.jar"/>
126 <include name="pivot-wtk-terra-${version}.jar"/>
127 </fileset>
128 </copy>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
129
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
130 <!-- Copy the example JAR -->
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
131 <copy file="${folder.lib}/${example.jar}" todir="${ant.project.name}/${folder.www}/lib"/>
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
132
133 <!-- Generate the host page -->
134 <copy file="${ant.project.name}/${folder.src}/${example.path}/index.html"
135 tofile="${ant.project.name}/${folder.www}/index.html">
136 <filterset>
137 <filter token="version" value="${version}"/>
138 </filterset>
139 </copy>
140
141 <!-- Generate the WAR file -->
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
142 <war destfile="${folder.lib}/${example.war}"
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
143 webxml="${ant.project.name}/${folder.src}/${example.path}/web.xml">
144 <fileset dir="${ant.project.name}/${folder.www}"/>
145 </war>
146 </target>
147
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
148 <!-- Package example application for deployment via Windows executable -->
149 <target name="deploy-windows" depends="package">
150 <echo message="Generating Windows executable..."/>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
151
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
152 <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"
153 classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/>
154
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
155 <launch4j>
1377249 Eliminate main() method from deployment example application.
Gregory K. Brown authored
156 <config headerType="gui"
157 jar="${folder.lib}/${example.jar}"
1f99a07 Add icons to Windows and OS X examples.
Gregory K. Brown authored
158 icon="${ant.project.name}/${folder.src}/${example.path}/logo-notext-256x256.ico"
1377249 Eliminate main() method from deployment example application.
Gregory K. Brown authored
159 cmdLine="org.apache.pivot.examples.deployment.DeploymentExample"
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
160 outfile="${example.exe}">
1377249 Eliminate main() method from deployment example application.
Gregory K. Brown authored
161 <classPath mainClass="org.apache.pivot.wtk.DesktopApplicationContext"
e49742a Update deployment-example.xml.
Gregory K. Brown authored
162 cp="${folder.lib}/pivot-core-${version}.jar;${folder.lib}/pivot-wtk-${version}.jar;${folder.lib}/pivot-wtk-terra-${version}.jar"/>
7c05f79 Resolve PIVOT-601; add initial pass at WinXP and OS X color schemes.
Gregory K. Brown authored
163 <jre minVersion="1.6.0">
7063e76 Correct theme location property value in Launch4j config
Christopher James Bartlett authored
164 <opt>-Dorg.apache.pivot.wtk.skin.terra.location=TerraTheme_winxp1.json</opt>
7c05f79 Resolve PIVOT-601; add initial pass at WinXP and OS X color schemes.
Gregory K. Brown authored
165 </jre>
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
166 </config>
167 </launch4j>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
168
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
169 <zip destfile="${example-windows.zip}">
170 <zipfileset dir=".">
e49742a Update deployment-example.xml.
Gregory K. Brown authored
171 <include name="${example.exe}"/>
172 <include name="${folder.lib}/pivot-core-${version}.jar"/>
173 <include name="${folder.lib}/pivot-wtk-${version}.jar"/>
174 <include name="${folder.lib}/pivot-wtk-terra-${version}.jar"/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
175 </zipfileset>
e49742a Update deployment-example.xml.
Gregory K. Brown authored
176 </zip>
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
177 </target>
178
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
179 <!-- Package example application for deployment via Mac OS X bundle -->
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
180 <target name="deploy-osx" depends="package">
35206e9 Add Windows .exe to deployment example.
Gregory K. Brown authored
181 <echo message="Generating OS X application bundle..."/>
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
182
183 <taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler"/>
184
185 <jarbundler dir="."
186 name="${example.name}"
1377249 Eliminate main() method from deployment example application.
Gregory K. Brown authored
187 mainclass="org.apache.pivot.wtk.DesktopApplicationContext"
188 arguments="org.apache.pivot.examples.deployment.DeploymentExample"
7c05f79 Resolve PIVOT-601; add initial pass at WinXP and OS X color schemes.
Gregory K. Brown authored
189 vmoptions="-Dorg.apache.pivot.wtk.skin.terra.location=TerraTheme_osx.json"
1f99a07 Add icons to Windows and OS X examples.
Gregory K. Brown authored
190 icon="${ant.project.name}/${folder.src}/${example.path}/logo-notext-256x256.icns">
0a61e1c Add OS X bundle to deployment example.
Gregory K. Brown authored
191 <jarfileset dir="${folder.lib}">
192 <include name="${example.jar}"/>
193 <include name="pivot-core-${version}.jar"/>
194 <include name="pivot-wtk-${version}.jar"/>
195 <include name="pivot-wtk-terra-${version}.jar"/>
196 </jarfileset>
197 </jarbundler>
198
199 <exec executable="tar">
200 <arg value="cvzf"/>
201 <arg value="${example-osx.tar.gz}"/>
202 <arg value="${example.app}"/>
203 </exec>
12c1cd5 Minor example updates; add deploy-example.xml build script.
Gregory K. Brown authored
204 </target>
205 </project>
Something went wrong with that request. Please try again.