-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.xml
More file actions
97 lines (87 loc) · 3.08 KB
/
build.xml
File metadata and controls
97 lines (87 loc) · 3.08 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
95
96
97
<project name="inieditor" default="dist" basedir=".">
<description>
Apache Ant file for IniEditor
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="javadoc" location="javadoc"/>
<property name="website" location="website"/>
<property name="dist" location="dist"/>
<property name="test" location="test"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="true">
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="compiletest" depends="compile" description="compile unit tests">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${test}" destdir="${build}" includeantruntime="true">
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="javadoc" depends="init" description="generate javadoc">
<mkdir dir="${javadoc}"/>
<javadoc sourcepath="${src}" destdir="${javadoc}" packagenames="com.nikhaldimann.inieditor"/>
</target>
<target name="dist" depends="clean,compile,javadoc" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/inieditor/lib"/>
<!-- Copy files -->
<copy todir="${dist}/inieditor/src">
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${dist}/inieditor/javadoc">
<fileset dir="${javadoc}">
<include name="**/*.*"/>
</fileset>
</copy>
<copy todir="${dist}/inieditor/test">
<fileset dir="${test}">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${dist}/inieditor/">
<fileset dir=".">
<include name="*.txt"/>
<include name="*.xml"/>
<include name="*.md"/>
</fileset>
</copy>
<!-- Build jar -->
<jar jarfile="${dist}/inieditor/lib/inieditor.jar" basedir="${build}"/>
<!-- Build .tar.gz -->
<tar basedir="${dist}" destfile="${dist}/inieditor.tar"/>
<gzip zipfile="${dist}/inieditor.tar.gz" src="${dist}/inieditor.tar"/>
<delete file="${dist}/inieditor.tar"/>
<delete dir="${dist}/inieditor"/>
</target>
<target name="clean" description="clean up any generated files">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${javadoc}"/>
</target>
<target name="test" description="run the unit tests" depends="compiletest">
<junit haltonfailure="true" includeantruntime="true">
<classpath>
<pathelement location="${build}"/>
</classpath>
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="${test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>