-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
127 lines (110 loc) · 3.48 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
<?xml version="1.0" standalone="yes"?>
<project default="dist" basedir=".">
<property file="build.properties"/>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="on"/>
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="build.src" value="${build}/src"/>
<property name="build.classes" value="${build}/classes"/>
<property name="dist" value="dist"/>
<property name="name" value="jpt"/>
<property name="distjar" value="${dist}/${name}.jar"/>
<property name="test" value="test"/>
<property name="test.src" value="${build}/src/test"/>
<path id="classpath">
<fileset dir="./lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="distclasspath">
<path refid="classpath"/>
<pathelement path="${build.classes}"/>
</path>
<path id="testclasspath">
<path refid="distclasspath"/>
</path>
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${build}/src"/>
<filter token="name" value="${name}"/>
</target>
<target name="prepare-src" depends="init">
<copy todir="${build.src}" filtering="true">
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</copy>
<!--<mkdir dir="${test.classes}"/>-->
<copy todir="${test.src}" filtering="true">
<fileset dir="${test}">
<include name="**/*.java"/>
</fileset>
</copy>
<!--copy todir="${test.src}/com/christophermrossi/jpt" filtering="true">
<fileset dir="${test}">
<include name="**/*.jpt"/>
<include name="**/*.bsh"/>
</fileset>
</copy-->
<copy todir="${test.src}" filtering="false">
<fileset dir="${test}">
<include name="**/*.html"/>
</fileset>
</copy>
<mkdir dir="${build.classes}"/>
</target>
<target name="compile" depends="prepare-src">
<javac srcdir="${build}/src"
destdir="${build.classes}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}">
<classpath refid="classpath"/>
</javac>
<copy todir="${build.classes}" filtering="true">
<fileset dir="${test}">
<include name="**/*.jpt"/>
<include name="**/*.bsh"/>
</fileset>
</copy>
<copy todir="${build.classes}" filtering="false">
<fileset dir="${test}">
<include name="**/*.html"/>
</fileset>
</copy>
</target>
<target name="unittest" depends="compile">
<junit fork="yes" haltonerror="yes" haltonfailure="yes" printsummary="yes">
<formatter type="plain" usefile="false"/>
<test name="com.christophermrossi.jpt.AllTests" />
<classpath refid="testclasspath"/>
</junit>
</target>
<target name="dist" depends="unittest">
<mkdir dir="${dist}"/>
<jar jarfile="${distjar}"
basedir="${build.classes}"
includes="com/**"
excludes="**/test/**" />
</target>
<target name="javadocs" depends="init">
<mkdir dir="${build}/javadocs"/>
<javadoc
packagenames="com.christophermrossi.jpt.*"
sourcepath="${src}"
destdir="${build}/javadocs"
windowtitle="${name} API"
doctitle="${name}"
bottom="Copyright © ${year} Chris Rossi All Rights Reserved."
>
<classpath refid="classpath"/>
</javadoc>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="rebuild" depends="clean,dist"/>
</project>