[Schmitzm-commits] r12 - trunk

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 25 18:32:40 CET 2009


Author: mojays
Date: 2009-02-25 18:32:38 +0100 (Wed, 25 Feb 2009)
New Revision: 12

Modified:
   trunk/build.xml
Log:
build.xml extended with "src", "jar", "javadoc"

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2009-02-25 15:20:19 UTC (rev 11)
+++ trunk/build.xml	2009-02-25 17:32:38 UTC (rev 12)
@@ -1,28 +1,110 @@
 <!-- Build file for SCHMITZM. 
-     This script does not compile the java source, but only create a
-     jar from the existing binaries expected in folder "classes".
+     Note: This script does not compile the java source (because of library
+           dependencies)!!
+
+     Option "jar"     -> a JAR from the existing binaries expected in folder
+                         "classes" plus a ZIP of the JAR
+     Option "src"     -> a ZIP of the source code in folder "src"
+     Option "javadoc" -> a JavaDoc in folder "javadoc" plus a ZIP of
+                         this folder
+     Option "all"     -> all of the upper mentioned options
+     Option "basic"   -> only "jar" and "src"
+     
+     The default option is "basic"
 -->
-<project default="jar" basedir=".">
+<project default="basic" basedir=".">
+	<!-- Prefix for the destination file names
+	     e.g. "schmitzm" >> "schmitzm.jar", "schmitzm-src.jar" -->
+	<property name="PROJECT.PREFIX"   value="schmitzm"/>
+	<!-- Global prefix directory for ZIP files (except ZIP of JAR!) -->
+	<property name="ZIP.ROOT.DIR"     value="${PROJECT.PREFIX}"/>
+	
+	<!-- Source and Destination for source code ZIP -->
+	<property name="DIR.SRC"          value="src"/>
+	<property name="FILE.SRC.ZIP"     value="${PROJECT.PREFIX}-src.zip"/>
+	
+	<!-- Source and Destination for JAR file -->
+	<property name="DIR.CLASSES"      value="classes"/>
+    <property name="FILE.JAR"         value="${PROJECT.PREFIX}.jar"/>
+	<property name="FILE.JAR.ZIP"     value="${FILE.JAR}.zip"/>
+	
+	<!-- Destination for JavaDoc and its ZIP -->
+	<property name="DIR.JAVADOC"      value="javadoc"/>
+	<property name="FILE.JAVADOC.ZIP" value="${PROJECT.PREFIX}-doc.zip"/>
+	<property name="LINK.JDK"         value="http://java.sun.com/javase/6/docs/api/"/>
+	<property name="LINK.LOG4J"       value="http://logging.apache.org/log4j/docs/api/"/>
 
+	<target name="all">
+		<antcall target="jar"/>
+		<antcall target="src"/>
+		<antcall target="javadoc"/>
+	</target>
+
+	<target name="basic">
+		<antcall target="jar"/>
+		<antcall target="src"/>
+	</target>
+
+	<!-- ##############  Create a JAR from "classes" and ZIP it ############## -->
 	<target name="jar">
-		<jar destfile="schmitzm.jar" index="false" level="8" duplicate="preserve">
-			<fileset dir="classes">
+		<!-- Create the JAR -->
+		<delete failonerror="false" file="${FILE.JAR}"/>
+		<jar destfile="${FILE.JAR}" index="false" level="8" duplicate="preserve">
+			<fileset dir="${DIR.CLASSES}">
 				<exclude name="schmitzm/test**" />
 				<exclude name="**/*.html" />
 				<exclude name="**/*.xcf" />
 				<exclude name="**/Thumbs.db" />
 			</fileset>
-
 			<manifest>
 				<attribute name="Created-By" value="Martin O.J. Schmitz, Stefan A. Krüger" />
 			</manifest>
-
 		</jar>
+		<!-- Create a ZIP of the JAR -->
+		<delete failonerror="false" file="${FILE.JAR.ZIP}"/>
+		<zip basedir="." destfile="${FILE.JAR.ZIP}">
+			<filename name="${FILE.JAR}"/>
+		</zip>
+	</target>
+	
+	<!-- ##############  Create a ZIP from "src" folder  ############## -->
+	<target name="src">
+		<!-- Create a ZIP from "src" folder -->
+		<delete failonerror="false" file="${FILE.SRC.ZIP}"/>
+		<zip destfile="${FILE.SRC.ZIP}" update="false">
+			<zipfileset dir="${DIR.SRC}" prefix="${ZIP.ROOT.DIR}/${DIR.SRC}">
+				<exclude name="**/Thumbs.db" />
+				<exclude name="**/.svn" />
+			</zipfileset>
+		</zip>
+		<!-- Add build.xml to ZIP -->
+		<zip destfile="${FILE.SRC.ZIP}" update="true">
+			<zipfileset file="build.xml" prefix="${ZIP.ROOT.DIR}"/>
+		</zip>
+	</target>
 
-		<zip basedir="." destfile="schmitzm.jar.zip" >
-			<filename name="schmitzm.jar"/>
+	<!-- ##############  Create a JavaDoc to "javadoc" and ZIP it  ############## -->
+	<target name="javadoc">
+		<!-- Create a JavaDoc to "javadoc" folder -->
+		<delete failonerror="false" dir="${DIR.JAVADOC}"/>
+		<javadoc sourcepath ="${DIR.SRC}"
+			     destdir    ="${DIR.JAVADOC}"
+			     author     ="true"
+			     version    ="true"
+			     overview   ="${DIR.SRC}/overview.html"
+				 windowtitle="Klassenbibliothek Martin Schmitz"
+		>
+			<excludepackage name="schmitzm.test"/>
+			<link href="${LINK.JDK}"/>
+			<link href="${LINK.LOG4J}"/>
+		</javadoc>
+		<!-- Create a ZIP from "javadoc" folder -->
+		<delete failonerror="false" file="${FILE.JAVADOC.ZIP}"/>
+		<zip destfile="${FILE.JAVADOC.ZIP}" update="false">
+			<zipfileset dir="${DIR.JAVADOC}" prefix="${ZIP.ROOT.DIR}/${DIR.JAVADOC}">
+				<exclude name="**/Thumbs.db" />
+				<exclude name="**/.svn" />
+			</zipfileset>
 		</zip>
-
 	</target>
-
 </project>



More information about the Schmitzm-commits mailing list