-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
94 lines (77 loc) · 3.39 KB
/
build.xml
File metadata and controls
94 lines (77 loc) · 3.39 KB
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="main" name="AutoMode">
<description>
Build Automode and create JAR file.
</description>
<property name="projectName" value="Automode"/>
<property name="src.dir" location="src"/>
<property name="build.dir" location="bin"/>
<property name="dist.dir" location="dist"/>
<property name="dist.lib.dir" location="dist/lib"/>
<property name="lib.dir" value="lib"/>
<property name="resources.dir" value="resources"/>
<property name="sps.dir" value="sps"/>
<property name="dist.resources.dir" value="dist/resources"/>
<property name="main-class" value="automode.algorithms.AutoModeImpl"/>
<target name="init">
<mkdir dir="${build.dir}"/>
</target>
<path id="classpath">
<path id="classpath">
<fileset dir="${basedir}/">
<include name="${lib.dir}/*.jar" />
<include name="${resources.dir}/*" />
<exclude name="${lib.dir}/*sources.jar"/>
<exclude name="${lib.dir}/*javadoc.jar"/>
</fileset>
</path>
</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>
<copy todir="${dist.dir}">
<fileset dir="${lib.dir}" includes="Castor.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="${resources.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>