-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
211 lines (189 loc) · 7.52 KB
/
Copy pathbuild.xml
File metadata and controls
211 lines (189 loc) · 7.52 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2005 Sun Microsystems, Inc. All rights reserved. Use is
subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
-->
<!--
- Main build file for DescentMap2.
-
- Generated with SaverBeans SDK Startup Kit
- http://jdic.dev.java.net/
-->
<project basedir="." default="dist" name="DescentMap2">
<target name="properties">
<property file="build.properties" />
<property file="${user.home}/build.properties" />
<property name="build" value="build" />
<property name="dist" value="dist" />
<property name="src" value="src" />
<property name="screensaver" value="DescentMap2" />
<property name="screensaver.class"
value="component.MapScreensaver" />
<!-- Values for the Windows installer -->
<property name="productName" value="DescentMap2 Screensaver" />
<property name="productVersion" value="1.0" />
<property name="productPublisher" value="Sun Microsystems, Inc." />
<property name="productWebSite"
value="http://screensavers.dev.java.net/" />
</target>
<target name="check" description="Check to make sure properties are set">
<fail unless="saverbeans.path">
Property saverbeans.path not found. Please copy
build.properties.sample to build.properties and
follow the instructions in that file.
</fail>
<available file="${saverbeans.path}" property="saverbeans.present" />
<fail unless="saverbeans.present">
Property saverbeans.path is invalid. Please set
it to the installation path of the SaverBeans SDK.
</fail>
</target>
<target name="check-nsis" description="Check if NSIS is present">
<fail unless="nsis.path">
Property nsis.path not found. Please copy
build.properties.sample to build.properties and
follow the instructions in that file.
</fail>
<available file="${nsis.path}" property="nsis.present" />
<fail unless="nsis.present">
Property nsis.path is invalid. Please set
it to the installation path of NSIS.
</fail>
</target>
<target name="define" description="Define custom tasks">
<taskdef name="foreachscreensaver"
classname="org.jdesktop.jdic.screensaver.autogen.ForEachScreensaver"
classpath="${saverbeans.path}/saverbeans-ant.jar" />
<taskdef name="makewin32installscript"
classname="org.jdesktop.jdic.screensaver.autogen.NsiGeneratorTask"
classpath="${saverbeans.path}/saverbeans-ant.jar" />
</target>
<target name="init" depends="properties,check,define" />
<target name="compile" depends="init" description="Compile the screensaver">
<mkdir dir="${build}/share" />
<javac debug="on" destdir="${build}/share" srcdir="${src}"
classpath="${saverbeans.path}/saverbeans-api.jar" />
<copy todir="${build}/share">
<fileset dir="${src}">
<exclude name="**/CVS" />
<exclude name="**/*.java" />
</fileset>
</copy>
<!-- Generate Makefile and Unix source distribution for each -->
<mkdir dir="${build}/unix" />
<foreachscreensaver confDir="conf" outDir="${build}/unix"
os="unix" />
<!-- Generate Windows .scr and binary distribution for each -->
<mkdir dir="${build}/win32" />
<foreachscreensaver confDir="conf" outDir="${build}/win32"
os="win32" />
</target>
<!-- Create screensaver distribution -->
<target name="dist" depends="compile">
<mkdir dir="${build}/jar" />
<jar destfile="${build}/jar/${screensaver}.jar">
<fileset dir="${build}/share" />
</jar>
<!-- Create distribution for win32: -->
<mkdir dir="${dist}/${screensaver}-win32" />
<copy todir="${dist}/${screensaver}-win32">
<fileset dir="${saverbeans.path}">
<include name="saverbeans-api.jar" />
</fileset>
<fileset dir="${build}/jar">
<include name="*.jar" />
</fileset>
<fileset dir="${build}/win32">
<include name="*.scr" />
</fileset>
<fileset dir="${basedir}">
<include name="COPYING" />
</fileset>
<fileset dir="doc/win32">
<include name="README.txt" />
</fileset>
</copy>
<zip destfile="${dist}/${screensaver}-win32.zip" basedir="${dist}"
includes="${screensaver}-win32/**" />
<!-- Create distribution for Unix: -->
<mkdir dir="${dist}/${screensaver}-unix" />
<copy todir="${dist}/${screensaver}-unix">
<fileset dir="${saverbeans.path}">
<include name="saverbeans-api.jar" />
</fileset>
<fileset dir="${build}/jar">
<include name="*.jar" />
</fileset>
<fileset dir="conf">
<include name="*.xml" />
</fileset>
<fileset dir="${build}/unix" />
<fileset dir="${basedir}">
<include name="COPYING" />
</fileset>
<fileset dir="doc/unix">
<include name="README.txt" />
</fileset>
</copy>
<zip destfile="${dist}/${screensaver}-unix.zip" basedir="${dist}"
includes="${screensaver}-unix/**" />
</target>
<target name="win32-installer" depends="init,check-nsis,dist">
<mkdir dir="${build}/win32-installer" />
<makewin32installscript
productName="${productName}"
productVersion="${productVersion}"
productPublisher="${productPublisher}"
productWebSite="${productWebSite}"
licenseFile="${basedir}/COPYING"
outputFilename="${screensaver}-setup.exe"
saverbeansSdkPath="${saverbeans.path}"
outFile="${build}/win32-installer/${screensaver}.nsi"
jarDir="${build}/jar"
scrDir="${build}/win32"
>
<fileset dir="conf" includes="*.xml" />
</makewin32installscript>
<!-- Launch makensis on script to create the installer -->
<exec executable="${nsis.path}/makensis.exe" failonerror="true">
<arg line="${build}/win32-installer/${screensaver}.nsi" />
</exec>
<echo message="Screensaver Installer generated to: ${build}/win32-installer/${screensaver}-setup.exe" />
</target>
<!--
- Compile and debug screensaver in a JFrame.
- Can optionally attach to process using your Java IDE. Change
- to suspend=y if you need to debug before the first frame.
- Use the port number that the JVM gives you.
-->
<target name="debug" depends="compile">
<java classname="org.jdesktop.jdic.screensaver.ScreensaverFrame"
fork="true">
<classpath>
<pathelement location="${build}/share" />
<pathelement location="${saverbeans.path}/saverbeans-api.jar" />
</classpath>
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n" />
<arg value="${screensaver.class}" />
<arg line="${debug.params}" />
</java>
</target>
<target name="clean" depends="init"
description="Cleans all generated files">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>