forked from iamxiatian/xsimilarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
100 lines (87 loc) · 4.04 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
<?xml version="1.0"?>
<project name="xsimilarity" default="help">
<!-- Load all the default properties, and any the user wants -->
<!-- to contribute (without having to type -D or edit this file -->
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
<property file="${basedir}/default.properties" />
<property name="test.junit.output.format" value="plain" />
<!-- the normal classpath -->
<path id="classpath">
<pathelement location="${build.classes.main}" />
<pathelement location="${build.classes.test}" />
<pathelement location="${src.resources}" />
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<tstamp>
<format property="buildtime" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<target name="init" description="make initial dirs">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.main}" />
<mkdir dir="${build.classes.test}" />
<mkdir dir="${build.docs}" />
<mkdir dir="${build.javadoc}" />
</target>
<!-- ====================================================== -->
<!-- Clean all build file and deployed web app -->
<!-- ====================================================== -->
<target name="clean" description="clean output dirs">
<delete dir="${build.dir}" />
</target>
<target name="help">
<echo message="" />
<echo message="xsimilarity building help" />
<echo message="------------------------------------------------------" />
<echo message="clean" />
<echo message="compile" />
<echo message="jar" />
<echo message="source" />
</target>
<!-- ====================================================== -->
<!-- Comile all classes -->
<!-- ====================================================== -->
<target name="compile" depends="init" description="Compile main Java sources">
<javac destdir="${build.classes.main}" encoding="${build.encoding}" includes="**/**/*.java" debug="${debug}" fork="${fork}" optimize="${optimize}" source="${source}" deprecation="${deprecation}">
<src path="${src.java.main}" />
<classpath refid="classpath" />
</javac>
<javac destdir="${build.classes.test}" encoding="${build.encoding}" includes="**/**/*.java" debug="${debug}" fork="${fork}" optimize="${optimize}" source="${source}" deprecation="${deprecation}">
<src path="${src.java.test}" />
<classpath refid="classpath" />
</javac>
</target>
<target name="jar" depends="compile" description="generate jar">
<copy todir="${build.classes.main}" preservelastmodified="true" flatten="false">
<fileset dir="${src.java.main}">
<exclude name="**/*.java" />
</fileset>
</copy>
<jar jarfile="${dist.jar.main}" basedir="${build.classes.main}" compress="true">
<fileset dir="${src.resources}">
<include name="**/*.*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="ke.similarity.pim.main.Start" />
</manifest>
</jar>
<!-- generate test.jar -->
<jar jarfile="${dist.jar.test}" basedir="${build.classes.main}" compress="true" />
</target>
<target name="source" depends="init" description="zip source">
<jar destfile="${build.dir}/similarity-src.zip">
<fileset dir="${basedir}">
<include name="src/**/*.*" />
<include name="lib/**/*.*" />
<include name="*.*" />
<exclude name="**/LCMC.zip"/>
<exclude name="*.pdf"/>
</fileset>
</jar>
</target>
</project>