|
18 | 18 | <property name="testSrcDir" location="src/test/java"/>
|
19 | 19 | <property name="testClassesDir" location="target/test-classes"/>
|
20 | 20 | <property name="testReportsDir" location="target/test-reports"/>
|
| 21 | +<property name="distribZipFile" location="target/base64coder.zip"/> |
21 | 22 | <property name="jUnitVersionToDownload" value="4.7"/>
|
22 | 23 |
|
23 |
| -<target name="buildAll" description="Compiles and generates the API docs." |
| 24 | +<target name="buildAll" description="Compiles, builds the JAR and generates the API docs." |
24 | 25 | depends="buildJar, javaDoc"/>
|
25 | 26 |
|
26 |
| -<target name="buildJar" description="Compiles the Java source and builds the JAR file."> |
| 27 | +<target name="buildJar" description="Compiles the main Java sources and builds the JAR file."> |
27 | 28 | <delete dir="${classesDir}" failonerror="true"/>
|
28 | 29 | <mkdir dir="${classesDir}"/>
|
29 | 30 | <javac srcdir="${srcDir}" deprecation="true" includeAntRuntime="false" debug="true" debuglevel="lines,source"
|
|
66 | 67 | <delete dir="${javaDocDir}" failonerror="true"/>
|
67 | 68 | </target>
|
68 | 69 |
|
69 |
| -<target name="test" description="Runs the JUnit tests." |
70 |
| - depends="compileTest, getJUnitJar"> |
| 70 | +<target name="test" description="Runs the JUnit tests." depends="compileTest, getJUnitJar"> |
71 | 71 | <delete dir="${testReportsDir}" failonerror="true"/>
|
72 | 72 | <mkdir dir="${testReportsDir}"/>
|
73 | 73 | <junit haltonfailure="true">
|
|
93 | 93 | </condition>
|
94 | 94 | </target>
|
95 | 95 |
|
| 96 | +<target name="buildDistribZip" description="Builds the distribution ZIP file." depends="buildAll"> |
| 97 | + <delete file="${distribZipFile}"/> |
| 98 | + <zip destfile="${distribZipFile}"> |
| 99 | + <zipfileset dir="." includes="build.xml, CHANGES.txt, README.txt, src/, target/base64coder.jar, target/Base64Coder.html"/> |
| 100 | + </zip> |
| 101 | +</target> |
| 102 | + |
| 103 | +<target name="updateWebsite" depends="buildAll, buildDistribZip"> |
| 104 | + <property name="websiteDir" location="${env.base64CoderJavaWebsiteDir}"/> |
| 105 | + <copy todir="${websiteDir}" overwrite="true"> |
| 106 | + <fileset dir="src" includes="**/*.java"/> |
| 107 | + <fileset dir="target" includes="Base64Coder.html, base64coder.jar"/> |
| 108 | + <fileset file="${distribZipFile}"/> |
| 109 | + <chainedmapper> |
| 110 | + <flattenmapper/> |
| 111 | + <mapper> |
| 112 | + <globmapper from="*.java" to="*.java.txt"/> |
| 113 | + <identitymapper/> |
| 114 | + </mapper> |
| 115 | + </chainedmapper> |
| 116 | + </copy> |
| 117 | +</target> |
| 118 | + |
96 | 119 | </project>
|
0 commit comments