forked from denwill/java-cloudfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
176 lines (149 loc) · 5.88 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0" encoding="UTF-8"?>
<project name="java-cloudfiles" default="compile" basedir=".">
<description>
Builds CloudFiles Java Library and example apps.
</description>
<!-- =============================================================== -->
<!-- Set project properties for folder locations -->
<!-- =============================================================== -->
<property name="project.name" value="java-cloudfiles"/>
<!-- Allow overrides to the properties set here -->
<property file="local.properties" />
<property name="src" location="src/main/java"/>
<property name="test-src" location="src/test/java"/>
<property name="test-resource" location="src/test/resources"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
<property name="classes" location="classes"/>
<property name="doc-dir" location="docs" />
<property name="pkg-dir" location="cloudfiles" />
<property name="report.dir" location="testreport" />
<path id="base.path">
<pathelement location="${classes}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- =============================================================== -->
<!-- Create a time stamp and needed directories -->
<!-- =============================================================== -->
<target name="init">
<echo>-------------------------------------------------</echo>
<echo> Building Cloudfiles </echo>
<echo>-------------------------------------------------</echo>
<!-- Create time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${classes}"/>
<mkdir dir="${dist}"/>
</target>
<!-- =============================================================== -->
<!-- Compile the project sources -->
<!-- =============================================================== -->
<target name="compile" depends="init" description="Compiles source" >
<echo>Compiling the source</echo>
<javac destdir="${classes}"
optimize="off"
debug="on"
source="1.5" target="1.5"
failonerror="true"
srcdir="${src}">
<classpath>
<path refid="base.path"/>
</classpath>
<include name="**"/>
</javac>
<copy file="${src}/com/rackspacecloud/client/cloudfiles/MIME.types"
todir="${classes}/com/rackspacecloud/client/cloudfiles" />
<jar jarfile="${dist}/${project.name}.jar" basedir="${classes}"/>
</target>
<target name="compile-test" depends="compile" description="Compiles Test Code" >
<echo>Compiling the test source</echo>
<javac destdir="${classes}"
optimize="off"
debug="on"
failonerror="true"
srcdir="${test-src}">
<classpath>
<path refid="base.path"/>
</classpath>
<include name="**"/>
</javac>
<copy todir="${classes}">
<fileset dir="${test-resource}" />
</copy>
<jar jarfile="${dist}/${project.name}-test.jar" basedir="${classes}"/>
</target>
<target name="test" depends="compile-test">
<junit printsummary="yes" >
<classpath refid="base.path" />
<formatter type="brief" usefile="false" />
<test name="com.rackspacecloud.client.cloudfiles.FilesClientTestCase" />
</junit>
</target>
<target name="test-report" depends="compile-test">
<mkdir dir="${report.dir}"/>
<junit>
<classpath refid="base.path" />
<formatter type="xml" />
<test name="com.rackspacecloud.client.cloudfiles.FilesClientTestCase" todir="${report.dir}" />
</junit>
<junitreport todir="${report.dir}">
<fileset dir="${report.dir}" includes="TEST-*.xml"/>
<report todir="${report.dir}"/>
</junitreport>
</target>
<!-- =============================================================== -->
<!-- Package things up, leaving out test files -->
<!-- =============================================================== -->
<target name="package" description="Package files" depends="clean,compile,docs">
<delete dir="${pkg-dir}"/>
<mkdir dir="${pkg-dir}" />
<mkdir dir="${pkg-dir}/lib" />
<mkdir dir="${pkg-dir}/dist" />
<copy todir="${pkg-dir}/lib" >
<fileset dir="${lib}" />
</copy>
<copy todir="${pkg-dir}/dist">
<fileset dir="${dist}" />
</copy>
<copy todir="${pkg-dir}/docs" >
<fileset dir="${doc-dir}" />
</copy>
<copy file="cloudfiles.bat" todir="${pkg-dir}" />
<copy file="cloudfiles.sh" todir="${pkg-dir}" />
<copy file="cloudfiles.properties" todir="${pkg-dir}" />
<copy file="log4j.properties" todir="${pkg-dir}" />
<copy file="COPYING" todir="${pkg-dir}" />
<tar destfile="java-cloudfiles-binary.tar.gz" compression="gzip">
<tarfileset dir="${pkg-dir}" prefix="cloudfiles/" />
</tar>
<!-- Source version -->
<copy file="build.xml" todir="${pkg-dir}" />
<mkdir dir="${pkg-dir}/src/main/java" />
<copy todir="${pkg-dir}/src/main/java" >
<fileset dir="${src}" />
</copy>
<tar destfile="java-cloudfiles-source.tar.gz" compression="gzip">
<tarfileset dir="${pkg-dir}" prefix="cloudfiles/" />
</tar>
</target>
<!-- =============================================================== -->
<!-- Create the JavaDoc HTML Files -->
<!-- =============================================================== -->
<target name="docs" description="Create javadocs">
<javadoc sourcepath="${src}" destdir="${doc-dir}">
<classpath>
<path refid="base.path"/>
</classpath>
</javadoc>
</target>
<!-- =============================================================== -->
<!-- Delete the folders we create -->
<!-- =============================================================== -->
<target name="clean" description="clean up">
<delete dir="${classes}"/>
<delete dir="${dist}"/>
<delete dir="${docdir}" />
</target>
</project>