2002/css-validator build.xml,1.3,1.4

Update of /sources/public/2002/css-validator
In directory hutz:/tmp/cvs-serv22839

Modified Files:
	build.xml 
Log Message:
Applying combined patch by Ville Skyttä  and Marc-Aurèle Darc:
- Configurable location of servlet API jar
- Use local build.properties for configure local properties if available
- providing encoding info for javac (note: shouldn't that be configurable?)
- add jar target to build a jar from source

http://www.w3.org/Bugs/Public/show_bug.cgi?id=807



Index: build.xml
===================================================================
RCS file: /sources/public/2002/css-validator/build.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- build.xml	30 May 2004 19:54:19 -0000	1.3
+++ build.xml	20 Mar 2006 07:02:48 -0000	1.4
@@ -1,17 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project default="build" name="CSS validator">
+<!-- $Id$ -->
+<project default="jar" name="W3C CSS Validator">
 
-	<target name="build">
+  <!-- =================================================================== -->
+  <!-- User-overrideable properties                                      -->
+  <!-- =================================================================== -->
+      
+  <property file="build.properties"/>
+  <property name="servlet.lib" value="/usr/share/java/servlet-2.3.jar"/>
+  <property name="jigsaw.lib" value="/usr/share/java/jigsaw-2.2.5a.jar"/>
+
+  <!-- =================================================================== -->
+  <!-- Project-wide properties                                           -->
+  <!-- =================================================================== -->
+  <!-- Overriding those properties works too, but is not advisable. -->
+
+  <property name="app.name" value="css-validator"/>
+  <property name="jar.file" value="${app.name}.jar"/>
+  <property name="war.file" value="${app.name}.war"/>
 	
-		<delete dir="./build"/>
-		<mkdir dir="./build"/>
+  <!-- =================================================================== -->
+  <!-- Targets                                                             -->
+  <!-- =================================================================== -->
+
+	<path id="build.class.path">
+		<pathelement location="${servlet.lib}"/>
+		<pathelement location="${jigsaw.lib}"/>
+	</path>
 	
+	<target name="build" description="Builds the validator">
+		<mkdir dir="./build"/>
 		<javac 
+			classpathref="build.class.path"
 			destdir="./build" 
-			srcdir="./org/w3c:html"
+			encoding="ISO-8859-15"
 			debug="yes">
+			<src path="./org/w3c"/>
+			<src path="./html"/>
 		</javac>
-
 		<copy todir="./build">
 		    <fileset dir="./">
 		      <exclude name="**/*.java"/>
@@ -26,39 +52,47 @@
 		      <exclude name="**/images/*"/>
 		    </fileset>
 		</copy>
-			
 	</target>
 
-	<target name="javadoc">
-	
+	<target name="javadoc" description="Generates API docs">
 		<mkdir dir="./javadoc"/>
-	
 		<javadoc 
 			packagenames="org.w3c.*"
 			sourcepath="./"
 			destdir="./javadoc"
 			author="true"
 			version="true"
-			windowtitle="CSS validator Javadoc"/>
-    
+			windowtitle="W3C CSS Validator API"/>
 	</target>	
 	
-	<target name="war" depends="build">
-		<delete  file="css-validator.war" />
-		<war warfile="css-validator.war"
+	<target name="jar" depends="build" description="Creates the lib archive">
+		<delete file="${jar.file}"/>
+		<jar jarfile="${jar.file}"
+			basedir="build">
+			<include name="org/**"/>
+			<include name="html/**"/>
+			<manifest>
+	      			<attribute name="Main-Class" value="org.w3c.css.css.StyleSheetCom"/>
+			</manifest>
+		</jar>
+	</target>
+
+	<target name="war" depends="build" description="Creates the webapp module">
+		<delete file="${war.file}"/>
+		<war warfile="${war.file}"
 			webxml="web.xml"
 			basedir="."
-			excludes="**/src/**,**/docs/**,**/build/**,**/*.tmp,*.war,**/org/**,**/html/**"
+			excludes="**/src/**,**/docs/**,**/build/**,**/*.tmp,*.jar,*.war,**/org/**,**/html/**"
 		>
 			<classes dir="build"/>
-	
 		</war>
-		
 	</target>
 
-	<target name="clean">
-		<delete file="css-validator.war"/>
+	<target name="clean" description="Cleans up generated files">
+		<delete file="${jar.file}"/>
+		<delete file="${war.file}"/>
 		<delete dir="./build"/>
+		<delete dir="./javadoc"/>
 	</target>
 
 </project>

Received on Monday, 20 March 2006 07:03:01 UTC