forked from jpicado/Castor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-GridSearch.xml
81 lines (68 loc) · 2.64 KB
/
build-GridSearch.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="main" name="Castor">
<description>
Build Castor and create JAR file.
</description>
<property name="projectName" value="Castor-GridSearch" />
<property name="src.dir" location="src" />
<property name="build.dir" location="bin" />
<property name="dist.dir" location="dist-GridSearch" />
<property name="dist.lib.dir" location="dist-GridSearch/lib" />
<property name="lib.dir" value="lib" />
<property name="res.dir" value="res" />
<property name="sps.dir" value="sps" />
<property name="dist.res.dir" value="dist/res" />
<property name="main-class" value="castor.clients.CastorGridSearch" />
<target name="init">
<mkdir dir="${build.dir}" />
</target>
<!-- external libraries classpath, we don't need sources and javadoc -->
<path id="classpath">
<fileset dir="${basedir}/">
<include name="${lib.dir}/*.jar" />
<include name="${res.dir}/*" />
<exclude name="${lib.dir}/*sources.jar"/>
<exclude name="${lib.dir}/*javadoc.jar"/>
</fileset>
</path>
<!-- To work with external libraries, need classpath to compile -->
<target name="compile" depends="init" description="compile the source ">
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath" debug="true" />
</target>
<!-- constructs the external libraries classpath name -->
<pathconvert property="classpath.name" pathsep=" ">
<path refid="classpath" />
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
</pathconvert>
<target name="copy-dependencies">
<copy todir="${dist.lib.dir}">
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*sources.jar, **/*javadoc.jar" />
</copy>
</target>
<!-- jar it, and declares the ext libraries in manifest.mf file -->
<target name="jar" depends="compile, copy-dependencies" description="package, output to JAR">
<echo message="classpath.name : ${classpath.name} " />
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.lib.dir}" />
<jar jarfile="${dist.dir}/${projectName}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}" />
<attribute name="Class-Path" value=". ${classpath.name}" />
</manifest>
<fileset dir="." includes="${res.dir}/*.stg" />
<fileset dir="." includes="*.properties" />
</jar>
</target>
<target name="clean" description="clean up">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${sps.dir}" />
</target>
<!-- Default, run this -->
<target name="main" depends="clean, compile, jar" />
</project>