-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
159 lines (140 loc) · 5.91 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="AirNow Realtime Mirror" default="all">
<dirname property="base.directory" file="${ant.file}"/>
<property file="build.properties"/>
<!-- Paths -->
<path id="application-classpath">
<!-- third-party jars -->
<pathelement path="${httpcomponents-client1.jar}"/>
<pathelement path="${httpcomponents-client2.jar}"/>
<pathelement path="${httpcomponents-client3.jar}"/>
<pathelement path="${httpcomponents-client4.jar}"/>
<pathelement path="${httpcomponents-client5.jar}"/>
<pathelement path="${httpcomponents-client6.jar}"/>
<pathelement path="${httpcomponents-client7.jar}"/>
<pathelement path="${commons-net.jar}"/>
</path>
<!-- Compiler resources -->
<patternset id="compiler.resources.nonfilterable">
<!-- excluded files -->
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<!-- included files -->
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.dll"/>
<include name="**/?*.jnilib"/>
<include name="**/?*.so"/>
<include name="**/?*.lib"/>
<include name="**/?*.wav"/>
</patternset>
<patternset id="compiler.resources.filterable">
<!-- excluded files -->
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<!-- included files -->
<include name="**/?*.properties"/>
<include name="**/?*.xml"/>
<include name="**/?*.htm"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
<include name="**/?*.xsd"/>
<include name="**/?*.xsl"/>
<include name="**/?*.ice"/>
<include name="**/?*.pem"/>
</patternset>
<tstamp>
<format property="build.timestamp" pattern="yyyy-MM-dd hh:mm:ss a z"/>
</tstamp>
<property environment="env"/>
<target name="all" depends="clean, dist" description="clean, then build everything"/>
<target name="clean" description="cleans up by deleting the build and dist directories">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="build" description="builds the source code" unless="build-is-complete">
<!-- create the build directory -->
<mkdir dir="${build.dir}"/>
<!-- compile code -->
<javac srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="application-classpath"
debug="${java.compiler.debug}"
nowarn="${java.compiler.generate.no.warnings}"
memorymaximumsize="${java.compiler.max.memory}"
source="${java.compiler.source.level}"
target="${java.compiler.target.level}"
fork="true"
includeAntRuntime="false">
<compilerarg line="${java.compiler.args}"/>
</javac>
<!-- copy resources -->
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<patternset refid="compiler.resources.filterable"/>
</fileset>
</copy>
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<patternset refid="compiler.resources.nonfilterable"/>
</fileset>
</copy>
<property name="build-is-complete" value="true"/>
</target>
<target name="dist" depends="build" description="builds the project" unless="dist-is-complete">
<!-- create the dist directory -->
<mkdir dir="${dist.dir}"/>
<!-- copy required jar files and native lib -->
<copy todir="${dist.dir}" flatten="true">
<fileset file="${httpcomponents-client1.jar}"/>
<fileset file="${httpcomponents-client2.jar}"/>
<fileset file="${httpcomponents-client3.jar}"/>
<fileset file="${httpcomponents-client4.jar}"/>
<fileset file="${httpcomponents-client5.jar}"/>
<fileset file="${httpcomponents-client6.jar}"/>
<fileset file="${httpcomponents-client7.jar}"/>
<fileset file="${commons-net.jar}"/>
</copy>
<!-- define the execution classpath for use in the scripts -->
<path id="execution.classpath.elements">
<pathelement location="${dist.dir}"/>
<fileset dir="${dist.dir}">
<include name="**/*.jar"/>
<include name="**/*.dll"/>
<include name="**/*.so"/>
</fileset>
</path>
<!-- Set up a path id for the dist directory so it contains the correct kind of slashes when we do the pathconvert mapping -->
<path id="dist-dir.before-conversion" path="${dist.dir}"/>
<!-- Convert the dist directory path for the target platform to ensure that all the slashes are in the right direction -->
<pathconvert property="dist-dir.after-conversion" dirsep="/" pathsep=":" refid="dist-dir.before-conversion"/>
<!-- Create the classpath -->
<pathconvert property="execution.classpath" dirsep="/" pathsep=" " refid="execution.classpath.elements">
<map from="${dist-dir.after-conversion}" to="."/>
</pathconvert>
<!-- create jar of Java classes -->
<jar destfile="${dist.dir}/${jar.filename}"
basedir="${build.dir}"
update="no"
compress="true">
<manifest>
<attribute name="Built-By" value="${jar.built-by}"/>
<attribute name="Build-Timestamp" value="${build.timestamp}"/>
<attribute name="Class-Path" value="${execution.classpath}"/>
<attribute name="Main-Class" value="org.bodytrack.AirNow.Mirror.AirNowMirror"/>
</manifest>
</jar>
<property name="dist-is-complete" value="true"/>
</target>
</project>