forked from wolfdancer/cotta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
142 lines (124 loc) · 4.74 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<project name="cotta.template" default="report.coverage" basedir="core">
<property file="../build.properties"/>
<property name="product" value="cotta"/>
<property name="cfg.coverage.metrics" value="emma.threshold=class:95,method:89,block:87,line:88"/>
<property name="cfg.javadoc.packagenames" value="net.sf.*"/>
<fileset id="lib.dist" dir="../lib/commons-net">
<include name="**/*.jar"/>
</fileset>
<path id="dep.cls.prod">
<fileset refid="lib.dist"/>
<fileset dir="../lib/junit">
<include name="**/*.jar"/>
</fileset>
<fileset dir="../lib/hamcrest">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="dep.cls.behaviour">
<path refid="dep.cls.prod"/>
<fileset dir="../lib/jmock">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${cls.prod}"/>
</path>
<path id="dep.cls.ftp.behaviour">
<path refid="dep.cls.behaviour"/>
<pathelement location="${cls.behaviour}"/>
<fileset dir="../lib/commons-io">
<include name="**/*.jar"/>
</fileset>
<fileset dir="../lib/coloradoftp">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="dep.cls.prod.instr">
<fileset dir="../lib/emma">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="dep.report.coverage">
<path refid="dep.cls.prod.instr"/>
<pathelement location="${cls.prod.instr}"/>
<path refid="dep.cls.behaviour"/>
<pathelement location="${cls.behaviour}"/>
<path refid="dep.cls.ftp.behaviour"/>
<pathelement location="${cls.ftp.behaviour}"/>
</path>
<target name="cls.prod">
<mkdir dir="${cls.prod}"/>
<javac srcdir="${src.prod}" destdir="${cls.prod}" source="1.5" target="1.5" debug="true"
classpathref="dep.cls.prod"/>
<copy todir="${cls.prod}">
<fileset dir="${src.prod}" excludes="**/*.java"/>
</copy>
</target>
<target name="cls.behaviour" depends="cls.prod">
<mkdir dir="${cls.behaviour}"/>
<javac srcdir="${src.behaviour}" destdir="${cls.behaviour}" source="1.5"
target="1.5" debug="true"
classpathref="dep.cls.behaviour"/>
<copy todir="${cls.behaviour}">
<fileset dir="${res.behaviour}"/>
</copy>
</target>
<target name="cls.ftp.behaviour" depends="cls.behaviour">
<mkdir dir="${cls.ftp.behaviour}"/>
<javac srcdir="${src.ftp.behaviour}" destdir="${cls.ftp.behaviour}" source="1.5"
target="1.5" debug="true"
classpathref="dep.cls.ftp.behaviour"/>
<copy todir="${cls.ftp.behaviour}">
<fileset dir="${res.ftp.behaviour}"/>
</copy>
</target>
<target name="cls.prod.instr" depends="cls.prod">
<copy todir="${cls.prod.instr}">
<fileset dir="${cls.prod}" excludes="**/*.class"/>
</copy>
</target>
<target name="report.coverage" depends="cls.prod.instr, cls.behaviour, cls.ftp.behaviour">
<mkdir dir="${report.test}/core"/>
<mkdir dir="${report.test}/ftp"/>
<junit fork="yes" haltonerror="yes" haltonfailure="yes">
<classpath refid="dep.report.coverage"/>
<!--<jvmarg line="-Demma.coverage.out.file=${report.coverage}"/>-->
<!--<jvmarg line="-Demma.coverage.out.merge=true"/>-->
<jvmarg line="-Xmx512m"/>
<test name="net.sf.cotta.ftp.FtpFileSystemTest" todir="${report.test}/ftp">
<formatter type="plain"/>
</test>
</junit>
</target>
<target name="report.javadoc">
<echo message="${cfg.javadoc.packagenames}"/>
<javadoc packagenames="${cfg.javadoc.packagenames}" sourcepath="${src.prod}" destdir="${report.javadoc}"
access="public"/>
</target>
<target name="pkg.cls.prod" depends="cls.prod">
<jar basedir="${cls.prod}" file="${pkg.cls.prod}" index="true"
manifest="${src.prod}/META-INF/MANIFEST.MF"/>
</target>
<target name="pkg.src.prod">
<zip basedir="${src.prod}" destfile="${pkg.src.prod}"/>
</target>
<target name="dist" depends="pkg.cls.prod, pkg.src.prod">
<copy file="${pkg.cls.prod}" tofile="../dist/${product}.jar"/>
<copy file="${pkg.src.prod}" tofile="../dist/${product}-src.zip"/>
<property name="dir.product" value="../dist/${product}"/>
<mkdir dir="${dir.product}"/>
<copy file="${pkg.cls.prod}" tofile="${dir.product}/${product}.jar"/>
<copy file="${pkg.src.prod}" tofile="${dir.product}/${product}-src.zip"/>
<copy file="LICENSE.txt" todir="${dir.product}"/>
<mkdir dir="${dir.product}/lib"/>
<copy todir="${dir.product}/lib">
<fileset refid="lib.dist"/>
</copy>
<zip basedir="${dir.product}" destfile="../dist/${product}-all.zip"/>
<delete dir="${dir.product}"/>
</target>
<target name="clean.env">
<delete dir="build"/>
</target>
<target name="reports" depends="report.javadoc"/>
<target name="all" depends="clean.env, reports, dist"/>
</project>