-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
166 lines (131 loc) · 5.28 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Apr 15 2011
RealTimeViewer
JMX Real Time Viewer - grapher
pjaol
====================================================================== -->
<project name="RealTimeViewer" default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
JMX Real Time Viewer - grapher
</description>
<property name="jnlp.url" value="http://realtimeviewer/"/>
<property name="ivy.lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<property name="src.dir" value="src/java" />
<property name="test.src.dir" value="src/test" />
<property name="version" value="0.1" />
<property name="compile.path" value="${src.dir}"/> <!--:${test.src.dir}" />-->
<property name="sign.alias" value="patrick o'leary"/>
<property name="sign.keystore" value="conf/pjaol"/> <!-- nothing critical, just a keysigned file -->
<property name="sign.password" value="squirt"/> <!-- TODO: best way to store production version? -->
<path id="classpath">
<fileset dir="${ivy.lib.dir}">
<include name="*.jar" />
<exclude name="servlet-api*" />
</fileset>
</path>
<!-- =================================
target: default
================================= -->
<target name="default" depends="depends" description="JMX Real Time Viewer - grapher">
</target>
<!-- - - - - - - - - - - - - - - - - -
target: depends
- - - - - - - - - - - - - - - - - -->
<target name="depends" depends="clean, setup, resolve, compile">
</target>
<!-- - - - - - - - - - - - - - - - - -
target: setup
- - - - - - - - - - - - - - - - - -->
<target name="setup">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${ivy.lib.dir}" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: clean
- - - - - - - - - - - - - - - - - -->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" description="compile java files">
<javac srcdir="${compile.path}" destdir="${build.dir}" classpathref="classpath" debug="on" />
<!-- create a property containing all .jar files, prefix lib/, and seperated with a space -->
<pathconvert property="libs.project" pathsep=" ">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper />
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<path>
<!-- lib.home contains all jar files, in several subdirectories -->
<fileset dir="${ivy.lib.dir}">
<include name="**/*.jar" />
</fileset>
<dirset dir="conf"/>
</path>
</pathconvert>
<copy todir="${build.dir}/com/pjaol/JMX/Images">
<fileset dir="${src.dir}/com/pjaol/JMX/Images"/>
</copy>
<copy todir="${dist.dir}/lib/">
<fileset dir="lib"/>
</copy>
<copy todir="${build.dir}">
<fileset dir="conf"/>
</copy>
<copy todir="${dist.dir}" file="${src.dir}/../web/RealTimeViewer.jnlp" />
<copy tofile="${dist.dir}/dev.jnlp" file="${src.dir}/../web/RealTimeViewer.jnlp" />
<replace file="${dist.dir}/dev.jnlp" token="@codebase@" value="file://${basedir}/${dist.dir}"/>
<replace file="${dist.dir}/${ant.project.name}.jnlp" token="@codebase@" value="${jnlp.url}"/>
<jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="com.pjaol.JMX.WelcomeViewer" />
<section name="common">
<attribute name="Specification-Title" value="RealTimeViewer" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Specification-Vendor" value="SearchSaw" />
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<attribute name="Implementation-Vendor" value="SearchSaw Technologies" />
</section>
<attribute name="Class-Path" value="${libs.project}" />
</manifest>
</jar>
<signjar
alias="${sign.alias}" keystore="${sign.keystore}"
storepass="${sign.password}"
lazy="false"
>
<path>
<fileset dir="${dist.dir}" includes="**/*.jar" />
</path>
</signjar>
</target>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve />
</target>
<!-- =================================
target: run
================================= -->
<target name="run" description="Run the application">
<java jar="${dist.dir}/${ant.project.name}.jar" fork="true">
<classpath >
<fileset dir="conf"/>
</classpath>
</java>
</target>
</project>