-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
182 lines (162 loc) · 5.17 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
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
<!-- $Id: build.xml,v 1.7 2004/06/03 13:21:43 gon23 Exp $ -->
<project name="wakeonlan" default="deploy" basedir=".">
<property file="build.properties"/>
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="init.build">
<tstamp>
<format property="BUILD" pattern="yyyy-MM-d-HH:mm" locale="en"/>
</tstamp>
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="init.deploy">
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.lib.dir}"/>
<mkdir dir="${deploy.doc.dir}"/>
</target>
<target name="init.deploy.ws" depends="init.deploy">
<mkdir dir="${deploy.ws.dir}"/>
</target>
<target name="init.deploy.zip" depends="init.deploy">
<mkdir dir="${deploy.zip.dir}"/>
</target>
<target name="build" depends="init.build">
<javac destdir="${build.classes.dir}"
debug="${build.debug}"
optimize="${build.optimize}"
target="${build.target}"
classpathref="build.classpath" >
<src path="${src.dir}" />
<src path="${testsrc.dir}" />
</javac>
<copy todir="${build.classes.dir}" overwrite="true">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
<filterset>
<filter token="VERSION" value="${version}"/>
<filter token="BUILD" value="${BUILD}"/>
</filterset>
</copy>
<copy todir="${build.classes.dir}" overwrite="true">
<fileset dir="${src.dir}">
<include name="**/*.gif"/>
</fileset>
</copy>
</target>
<target name="init.javadoc">
<mkdir dir="${deploy.javadoc.dir}"/>
</target>
<target name="javadoc" depends="init.javadoc">
<javadoc
destdir="${deploy.javadoc.dir}"
packagenames="wol.*"
sourcepath="${src.dir}"
windowtitle="wakeonlan - API"
author="true"
classpathref="build.classpath">
<doctitle><![CDATA[<h1>wakeonlan</h1>]]></doctitle>
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
<link href="http://www.martiansoftware.com/jsap/doc/javadoc/"/>
</javadoc>
</target>
<target name="test" depends="build">
<junit showoutput="true" printsummary="true">
<classpath >
<path refid="build.classpath" />
<dirset dir="${build.classes.dir}" />
</classpath>
<batchtest>
<fileset dir="${testsrc.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="deploy.zip" depends="init.deploy.zip,deploy,javadoc" >
<zip
compress="true"
destfile="${deploy.zip.dir}/${ant.project.name}-${version}.zip"
update="false">
<zipfileset dir="${src.dir}" prefix="${ant.project.name}-${version}/src">
<include name="**/*.java"/>
<include name="**/*.properties"/>
<include name="**/*.gif"/>
</zipfileset>
<zipfileset dir="${testsrc.dir}" prefix="${ant.project.name}-${version}/testsrc">
<include name="**/*.java"/>
<include name="**/*.properties"/>
</zipfileset>
<zipfileset dir="${lib.dir}" prefix="${ant.project.name}-${version}/lib">
<include name="**/*.jar"/>
</zipfileset>
<zipfileset dir="${etc.dir}" prefix="${ant.project.name}-${version}/etc" />
<zipfileset dir="${deploy.javadoc.dir}" prefix="${ant.project.name}-${version}/doc/javadoc"/>
<zipfileset dir="${doc.dir}" prefix="${ant.project.name}-${version}/doc">
<include name="README"/>
<include name="COPYING"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="${ant.project.name}-${version}">
<include name="build.xml"/>
<include name="build.properties"/>
</zipfileset>
<zipfileset dir="${etc.dir}" prefix="${ant.project.name}-${version}">
<include name="wakeonlan.sh"/>
<include name="wakeonlan.bat"/>
</zipfileset>
<zipfileset dir="${deploy.dir}" prefix="${ant.project.name}-${version}">
<include name="${ant.project.name}.jar"/>
</zipfileset>
</zip>
</target>
<target name="deploy" depends="build,init.deploy">
<jar basedir="${build.classes.dir}"
destfile="${deploy.dir}/${ant.project.name}.jar"
manifest="${build.manifest}" />
<copy todir="${deploy.dir}">
<fileset dir="${etc.dir}">
<include name="wakeonlan.sh"/>
<include name="wakeonlan.bat"/>
</fileset>
</copy>
<copy todir="${deploy.lib.dir}">
<fileset dir="${lib.dir}" />
</copy>
<copy todir="${deploy.doc.dir}" >
<fileset dir="${doc.dir}" />
</copy>
</target>
<target name="deploy.ws" depends="build,init.deploy.ws">
<jar basedir="${build.classes.dir}"
destfile="${deploy.ws.dir}/${ant.project.name}.jar"
manifest="${build.manifest}" />
<signjar jar="${deploy.ws.dir}/${ant.project.name}.jar"
alias="${sign.alias}"
storepass="${sign.storepass}"
keystore="${sign.keystore}"
keypass="${sign.keypass}"/>
<copy todir="${deploy.ws.dir}" >
<fileset dir="${javaws.dir}">
<include name="wakeonlan.jnlp"/>
<include name="wakeonlan64x64.gif"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete quiet="true">
<fileset dir="${deploy.dir}" />
<fileset dir="${build.dir}" />
</delete>
</target>
<target name="all">
<echo message="Cleaning project" />
<antcall target="clean" />
<echo message="Deploy wakeonlan" />
<antcall target="deploy" />
<antcall target="deploy.ws" />
<antcall target="deploy.zip" />
</target>
</project>