-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·201 lines (147 loc) · 5.49 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<project name="browser_proio" default="jarlib" basedir=".">
<description>
ProIO build file
</description>
<!-- set global properties for this build -->
<property name="app.version" value="1.0"/>
<property name="app.author" value="D.Blyth, S.Chekanov"/>
<property name="app.name" value="ProIO"/>
<!-- set global properties for this build -->
<property name="src.dir" location="src" />
<property name="build.dir" location="build"/>
<property name="dist" location="dist" />
<property name="lib.dir" value="lib"/>
<property name="javadoc.dir" value="doc/api" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<!-- Build the CLASSPATH -->
<path id="classpath_run">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${javadoc.dir}" />
</target>
<target name="copybeforecompile" depends="init">
<!-- make necessary manifest -->
<manifest file="${src.dir}/META-INF/MANIFEST.MF">
<attribute name="Built-By" value="${app.author}"/>
<attribute name="Main-Class" value="hepsimproio.browser.Main"/>
<attribute name="Class-Path" value="lib/protobuf-java-3.4.0.jar lib/javassist-3.21.0-GA.jar lib/lz4-java-1.4.1.jar lib/reflections-0.9.11.jar lib/guava-23.0.jar"/>
<attribute name="Built-Date" value="${DSTAMP}"/>
<attribute name="Version" value="${app.version}"/>
</manifest>
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<patternset>
<exclude name="**/*.java*" />
<exclude name="**/*.odg" />
<exclude name="**/*.odp" />
<exclude name="**/*.*~" />
<exclude name="**/*.bak" />
<exclude name="**/*.pdf" />
</patternset>
</fileset>
</copy>
</target>
<target name="compile" depends="init,copybeforecompile"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src.dir}" destdir="${build.dir}"
debug="on" deprecation="off" optimize="on"
target="1.7" source="1.7"
classpathref="classpath">
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="lib/browser_proio_tmp.jar"
basedir="${build.dir}"
index="true"
manifest="${build.dir}/META-INF/MANIFEST.MF"/>
</target>
<target name="jarlib" depends="dist" >
<delete file="browser_proio.jar"/>
<property name="store.jar.name" value="browser_proio"/>
<property name="store.dir" value="dist"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging into a single JAR for a library"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="lib/" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="hepsimproio.browser.Main"/>
</manifest>
</jar>
<zip destfile="${store.jar.name}.jar">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA, *.html"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
<delete dir="${store.dir}/lib"/>
<delete file="${lib.dir}/browser_proio_tmp.jar"/>
<delete dir="${build.dir}"/>
<delete dir="dist"/>
</target>
<target name="run" depends="dist">
<!-- run the class -->
<java classname="hepsimproio.browser.Main"
fork="true"
failonerror="true"
maxmemory="64m"
>
<!-- add a command line arg: <arg value="-h"/> -->
<arg value="gev35ep_pythia8_gev1q2_001.proio"/>
<classpath>
<!-- use the value of the ${classpath} property in the classpath -->
<!-- <pathelement path="${classpath_run}"/> -->
<!-- include all jar files -->
<pathelement path="${java.class.path}"/>
<fileset dir=".">
<include name="browser_proio.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="javadoc" depends="init,cleandoc">
<javadoc destdir="${javadoc.dir}"
author="true"
version="false"
use="true"
splitindex="true"
source="${build.sourceversion}"
overview="doc/symbols.html"
link="http://download.oracle.com/javase/8/docs/api/"
windowtitle="ProIO-${build.version} API" classpathref="classpath">
<!--
<classpath>
<pathelement path="${java.class.path}/"/>
</classpath>
-->
<packageset dir="${src.dir}" >
<include name="*/**" />
</packageset>
<bottom><![CDATA[<i>© ProIO data format. HepSim repository.
]]></bottom>
</javadoc>
</target>
<target name="cleandoc"
description="clean up javadoc" >
<delete dir="doc/api"/>
</target>
<target name="clean"
description="clean up" >
<delete dir="${build.dir}"/>
<delete dir="${dist}"/>
<delete file="jhplot.jar"/>
</target>
</project>