1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 |
|
---|
3 | <!-- ====================================================================== -->
|
---|
4 | <!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
|
---|
5 | <!-- ====================================================================== -->
|
---|
6 |
|
---|
7 | <!-- ====================================================================== -->
|
---|
8 | <!-- ===================== - DO NOT EDIT THIS FILE! - ===================== -->
|
---|
9 | <!-- ====================================================================== -->
|
---|
10 | <!-- -->
|
---|
11 | <!-- Any modifications will be overwritten. -->
|
---|
12 | <!-- -->
|
---|
13 | <!-- Generated by Maven Ant Plugin on 6/1/10 8:14 PM -->
|
---|
14 | <!-- See: http://maven.apache.org/plugins/maven-ant-plugin/ -->
|
---|
15 | <!-- -->
|
---|
16 | <!-- ====================================================================== -->
|
---|
17 |
|
---|
18 | <project name="jupload-from-maven" default="package" basedir=".">
|
---|
19 |
|
---|
20 | <!-- ====================================================================== -->
|
---|
21 | <!-- Build environment properties -->
|
---|
22 | <!-- ====================================================================== -->
|
---|
23 |
|
---|
24 | <property file="${user.home}/.m2/maven.properties" />
|
---|
25 | <property file="maven-build.properties" />
|
---|
26 |
|
---|
27 | <property name="maven.build.finalName" value="wjhk.jupload" />
|
---|
28 | <property name="maven.build.dir" value="target" />
|
---|
29 | <property name="maven.build.outputDir" value="${maven.build.dir}/classes" />
|
---|
30 | <property name="maven.build.srcDir.0" value="src/main/java" />
|
---|
31 | <property name="maven.build.resourceDir.0" value="src/main/resources" />
|
---|
32 | <property name="maven.build.testOutputDir"
|
---|
33 | value="${maven.build.dir}/test-classes" />
|
---|
34 | <property name="maven.build.testDir.0" value="src/test/java" />
|
---|
35 | <property name="maven.build.testResourceDir.0" value="src/test/resources" />
|
---|
36 | <property name="maven.test.reports"
|
---|
37 | value="${maven.build.dir}/test-reports" />
|
---|
38 | <property name="maven.reporting.outputDirectory"
|
---|
39 | value="${maven.build.dir}/site" />
|
---|
40 |
|
---|
41 | <property name="maven.repo.local" value="${user.home}/.m2/repository" />
|
---|
42 | <property name="maven.settings.offline" value="false" />
|
---|
43 | <property name="maven.settings.interactiveMode" value="true" />
|
---|
44 |
|
---|
45 | <!-- ====================================================================== -->
|
---|
46 | <!-- Defining classpaths -->
|
---|
47 | <!-- ====================================================================== -->
|
---|
48 |
|
---|
49 | <path id="build.classpath">
|
---|
50 | <fileset dir="${maven.repo.local}">
|
---|
51 | <include name="commons-net/commons-net/1.4.1/commons-net-1.4.1.jar" />
|
---|
52 | <include name="oro/oro/2.0.8/oro-2.0.8.jar" />
|
---|
53 | <!-- include name="com/sun/runtime/java-plugin/1.5.0/java-plugin-1.5.0.jar"/ -->
|
---|
54 | </fileset>
|
---|
55 | <fileset file="./lib/plugin.jar" />
|
---|
56 | </path>
|
---|
57 | <path id="build.test.classpath">
|
---|
58 | <fileset dir="${maven.repo.local}">
|
---|
59 | <include name="junit/junit/4.5/junit-4.5.jar" />
|
---|
60 | <include name="commons-net/commons-net/1.4.1/commons-net-1.4.1.jar" />
|
---|
61 | <include name="oro/oro/2.0.8/oro-2.0.8.jar" />
|
---|
62 | <!-- include name="com/sun/runtime/java-plugin/1.5.0/java-plugin-1.5.0.jar" / -->
|
---|
63 | <include name="log4j/log4j/1.2.13/log4j-1.2.13.jar" />
|
---|
64 | </fileset>
|
---|
65 | <fileset file="./lib/plugin.jar" />
|
---|
66 | </path>
|
---|
67 |
|
---|
68 | <!-- ====================================================================== -->
|
---|
69 | <!-- Cleaning up target -->
|
---|
70 | <!-- ====================================================================== -->
|
---|
71 |
|
---|
72 | <target name="clean" description="Clean the output directory">
|
---|
73 | <delete dir="${maven.build.dir}" />
|
---|
74 | </target>
|
---|
75 |
|
---|
76 | <!-- ====================================================================== -->
|
---|
77 | <!-- Compilation target -->
|
---|
78 | <!-- ====================================================================== -->
|
---|
79 |
|
---|
80 | <target name="compile" depends="get-deps" description="Compile the code">
|
---|
81 | <mkdir dir="${maven.build.outputDir}" />
|
---|
82 | <javac destdir="${maven.build.outputDir}"
|
---|
83 | nowarn="false"
|
---|
84 | debug="true"
|
---|
85 | optimize="false"
|
---|
86 | deprecation="true"
|
---|
87 | target="1.5"
|
---|
88 | verbose="false"
|
---|
89 | fork="false"
|
---|
90 | source="1.5">
|
---|
91 | <src>
|
---|
92 | <pathelement location="${maven.build.srcDir.0}" />
|
---|
93 | </src>
|
---|
94 | <classpath refid="build.classpath" />
|
---|
95 | </javac>
|
---|
96 | <copy todir="${maven.build.outputDir}">
|
---|
97 | <fileset dir="${maven.build.resourceDir.0}" />
|
---|
98 | </copy>
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <!-- ====================================================================== -->
|
---|
102 | <!-- Test-compilation target -->
|
---|
103 | <!-- ====================================================================== -->
|
---|
104 |
|
---|
105 | <target name="compile-tests"
|
---|
106 | depends="compile"
|
---|
107 | description="Compile the test code"
|
---|
108 | unless="maven.test.skip">
|
---|
109 | <mkdir dir="${maven.build.testOutputDir}" />
|
---|
110 | <javac destdir="${maven.build.testOutputDir}"
|
---|
111 | nowarn="false"
|
---|
112 | debug="true"
|
---|
113 | optimize="false"
|
---|
114 | deprecation="true"
|
---|
115 | target="1.5"
|
---|
116 | verbose="false"
|
---|
117 | fork="false"
|
---|
118 | source="1.5">
|
---|
119 | <src>
|
---|
120 | <pathelement location="${maven.build.testDir.0}" />
|
---|
121 | </src>
|
---|
122 | <classpath>
|
---|
123 | <path refid="build.test.classpath" />
|
---|
124 | <pathelement location="${maven.build.outputDir}" />
|
---|
125 | </classpath>
|
---|
126 | </javac>
|
---|
127 | <copy todir="${maven.build.testOutputDir}">
|
---|
128 | <fileset dir="${maven.build.testResourceDir.0}" />
|
---|
129 | </copy>
|
---|
130 | </target>
|
---|
131 |
|
---|
132 | <!-- ====================================================================== -->
|
---|
133 | <!-- Run all tests -->
|
---|
134 | <!-- ====================================================================== -->
|
---|
135 |
|
---|
136 | <target name="test"
|
---|
137 | depends="compile-tests, junit-missing"
|
---|
138 | unless="junit.skipped"
|
---|
139 | description="Run the test cases">
|
---|
140 | <mkdir dir="${maven.test.reports}" />
|
---|
141 | <junit printSummary="yes"
|
---|
142 | haltonerror="true"
|
---|
143 | haltonfailure="true"
|
---|
144 | fork="true"
|
---|
145 | dir=".">
|
---|
146 | <sysproperty key="basedir" value="." />
|
---|
147 | <formatter type="xml" />
|
---|
148 | <formatter type="plain" usefile="false" />
|
---|
149 | <classpath>
|
---|
150 | <path refid="build.test.classpath" />
|
---|
151 | <pathelement location="${maven.build.outputDir}" />
|
---|
152 | <pathelement location="${maven.build.testOutputDir}" />
|
---|
153 | </classpath>
|
---|
154 | <batchtest todir="${maven.test.reports}" unless="test">
|
---|
155 | <fileset dir="${maven.build.testDir.0}">
|
---|
156 | <include name="**/Test*.java" />
|
---|
157 | <include name="**/*Test.java" />
|
---|
158 | <include name="**/*TestCase.java" />
|
---|
159 | <exclude name="**/*Abstract*Test.java" />
|
---|
160 | </fileset>
|
---|
161 | </batchtest>
|
---|
162 | <batchtest todir="${maven.test.reports}" if="test">
|
---|
163 | <fileset dir="${maven.build.testDir.0}">
|
---|
164 | <include name="**/${test}.java" />
|
---|
165 | <exclude name="**/*Abstract*Test.java" />
|
---|
166 | </fileset>
|
---|
167 | </batchtest>
|
---|
168 | </junit>
|
---|
169 | </target>
|
---|
170 |
|
---|
171 | <target name="test-junit-present">
|
---|
172 | <available classname="org.junit.Test" property="junit.present" />
|
---|
173 | </target>
|
---|
174 |
|
---|
175 | <target name="test-junit-status" depends="test-junit-present">
|
---|
176 | <condition property="junit.missing">
|
---|
177 | <and>
|
---|
178 | <isfalse value="${junit.present}" />
|
---|
179 | <isfalse value="${maven.test.skip}" />
|
---|
180 | </and>
|
---|
181 | </condition>
|
---|
182 | <condition property="junit.skipped">
|
---|
183 | <or>
|
---|
184 | <isfalse value="${junit.present}" />
|
---|
185 | <istrue value="${maven.test.skip}" />
|
---|
186 | </or>
|
---|
187 | </condition>
|
---|
188 | </target>
|
---|
189 |
|
---|
190 | <target name="junit-missing" depends="test-junit-status" if="junit.missing">
|
---|
191 | <echo>=================================== WARNING ===================================</echo>
|
---|
192 | <echo> JUnit is not present in your $ANT_HOME/lib directory. Tests not executed.</echo>
|
---|
193 | <echo>===============================================================================</echo>
|
---|
194 | </target>
|
---|
195 |
|
---|
196 | <!-- ====================================================================== -->
|
---|
197 | <!-- Javadoc target -->
|
---|
198 | <!-- ====================================================================== -->
|
---|
199 |
|
---|
200 | <target name="javadoc"
|
---|
201 | description="Generates the Javadoc of the application">
|
---|
202 | <javadoc sourcepath="${maven.build.srcDir.0}"
|
---|
203 | packagenames="*"
|
---|
204 | destdir="${maven.reporting.outputDirectory}/apidocs"
|
---|
205 | access="protected"
|
---|
206 | old="false"
|
---|
207 | verbose="false"
|
---|
208 | version="true"
|
---|
209 | use="true"
|
---|
210 | author="true"
|
---|
211 | splitindex="false"
|
---|
212 | nodeprecated="false"
|
---|
213 | nodeprecatedlist="false"
|
---|
214 | notree="false"
|
---|
215 | noindex="false"
|
---|
216 | nohelp="false"
|
---|
217 | nonavbar="false"
|
---|
218 | serialwarn="false"
|
---|
219 | charset="ISO-8859-1"
|
---|
220 | linksource="false"
|
---|
221 | breakiterator="false" />
|
---|
222 | </target>
|
---|
223 |
|
---|
224 | <!-- ====================================================================== -->
|
---|
225 | <!-- Package target -->
|
---|
226 | <!-- ====================================================================== -->
|
---|
227 |
|
---|
228 | <target name="package"
|
---|
229 | depends="compile,test"
|
---|
230 | description="Package the application">
|
---|
231 | <jar jarfile="${maven.build.dir}/${maven.build.finalName}.jar"
|
---|
232 | compress="true"
|
---|
233 | index="false"
|
---|
234 | basedir="${maven.build.outputDir}"
|
---|
235 | excludes="**/package.html" />
|
---|
236 | </target>
|
---|
237 |
|
---|
238 | <!-- ====================================================================== -->
|
---|
239 | <!-- A dummy target for the package named after the type it creates -->
|
---|
240 | <!-- ====================================================================== -->
|
---|
241 |
|
---|
242 | <target name="jar"
|
---|
243 | depends="package"
|
---|
244 | description="Builds the jar for the application" />
|
---|
245 |
|
---|
246 | <!-- ====================================================================== -->
|
---|
247 | <!-- Download dependencies target -->
|
---|
248 | <!-- ====================================================================== -->
|
---|
249 |
|
---|
250 | <target name="test-offline">
|
---|
251 | <condition property="maven.mode.offline">
|
---|
252 | <equals arg1="${maven.settings.offline}" arg2="true" />
|
---|
253 | </condition>
|
---|
254 | </target>
|
---|
255 |
|
---|
256 | <target name="get-deps"
|
---|
257 | depends="test-offline"
|
---|
258 | description="Download all dependencies"
|
---|
259 | unless="maven.mode.offline">
|
---|
260 | <mkdir dir="${maven.repo.local}" />
|
---|
261 | <mkdir dir="${maven.repo.local}/junit/junit/4.5" />
|
---|
262 | <get src="http://repo1.maven.org/maven2/junit/junit/4.5/junit-4.5.jar"
|
---|
263 | dest="${maven.repo.local}/junit/junit/4.5/junit-4.5.jar"
|
---|
264 | usetimestamp="false"
|
---|
265 | ignoreerrors="true" />
|
---|
266 | <mkdir dir="${maven.repo.local}/commons-net/commons-net/1.4.1" />
|
---|
267 | <get src="http://repo1.maven.org/maven2/commons-net/commons-net/1.4.1/commons-net-1.4.1.jar"
|
---|
268 | dest="${maven.repo.local}/commons-net/commons-net/1.4.1/commons-net-1.4.1.jar"
|
---|
269 | usetimestamp="false"
|
---|
270 | ignoreerrors="true" />
|
---|
271 | <mkdir dir="${maven.repo.local}/oro/oro/2.0.8" />
|
---|
272 | <get src="http://repo1.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar"
|
---|
273 | dest="${maven.repo.local}/oro/oro/2.0.8/oro-2.0.8.jar"
|
---|
274 | usetimestamp="false"
|
---|
275 | ignoreerrors="true" />
|
---|
276 | <mkdir dir="${maven.repo.local}/com/sun/runtime/java-plugin/1.5.0" />
|
---|
277 | <!-- get src="http://repo1.maven.org/maven2/com/sun/runtime/java-plugin/1.5.0/java-plugin-1.5.0.jar" |
---|
278 | dest="${maven.repo.local}/com/sun/runtime/java-plugin/1.5.0/java-plugin-1.5.0.jar" |
---|
279 | usetimestamp="false" |
---|
280 | ignoreerrors="true" / -->
|
---|
281 | <mkdir dir="${maven.repo.local}/log4j/log4j/1.2.13" />
|
---|
282 | <get src="http://repo1.maven.org/maven2/log4j/log4j/1.2.13/log4j-1.2.13.jar"
|
---|
283 | dest="${maven.repo.local}/log4j/log4j/1.2.13/log4j-1.2.13.jar"
|
---|
284 | usetimestamp="false"
|
---|
285 | ignoreerrors="true" />
|
---|
286 | </target>
|
---|
287 |
|
---|
288 | </project>
|
---|