cziegeler 01/11/22 04:59:33
Modified: . Tag: cocoon_20_branch build.xml
Log:
Updated build system: warnings are outputted if optional components are missing
(It's great to have Avalon to steal ideas and code from!)
Revision Changes Path
No revision
No revision
1.8.2.60 +139 -35 xml-cocoon2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/build.xml,v
retrieving revision 1.8.2.59
retrieving revision 1.8.2.60
diff -u -r1.8.2.59 -r1.8.2.60
--- build.xml 2001/11/22 11:13:55 1.8.2.59
+++ build.xml 2001/11/22 12:59:33 1.8.2.60
@@ -237,56 +237,160 @@
<filter token="database-user" value="${database-user}"/>
<filter token="database-password" value="${database-password}"/>
- <available property="servlet.present"
classname="javax.servlet.http.HttpServlet">
- <classpath refid="classpath"/>
- </available>
- <available property="php.present" classname="net.php.servlet">
- <classpath refid="classpath"/>
- </available>
- <available property="xt.present"
classname="com.jclark.xsl.sax.XMLProcessorImpl">
- <classpath refid="classpath"/>
- </available>
- <available property="svg.present"
classname="org.apache.batik.transcoder.Transcoder">
- <classpath refid="classpath"/>
- </available>
- <available property="rhino.present"
classname="org.mozilla.javascript.tools.jsc.Main">
- <classpath refid="classpath"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Test for optional components -->
+ <!-- =================================================================== -->
+ <target name="optional-tests"
+ description="Tests for optional classes missing to the environment">
+
+ <available property="servlet.present"
+ classname="javax.servlet.http.HttpServlet">
+ <classpath refid="classpath"/>
+ </available>
+
+ <available property="php.present"
+ classname="net.php.servlet">
+ <classpath refid="classpath"/>
</available>
- <available property="jstyle.present" classname="jstyle.JSFormatter">
- <classpath refid="classpath"/>
+
+ <available property="xt.present"
+ classname="com.jclark.xsl.sax.XMLProcessorImpl">
+ <classpath refid="classpath"/>
</available>
- <available property="fop.present" classname="org.apache.fop.apps.Driver">
- <classpath refid="classpath"/>
+
+ <available property="rhino.present"
+ classname="org.mozilla.javascript.tools.jsc.Main">
+ <classpath refid="classpath"/>
</available>
- <available property="tidy.present" classname="org.w3c.tidy.Tidy">
- <classpath refid="classpath"/>
+
+ <available property="jstyle.present"
+ classname="jstyle.JSFormatter">
+ <classpath refid="classpath"/>
</available>
+
<available property="servlet23.present"
- classname="javax.servlet.http.HttpServletRequestWrapper">
- <classpath refid="classpath"/>
+ classname="javax.servlet.http.HttpServletRequestWrapper">
+ <classpath refid="classpath"/>
</available>
- <available property="xpath.present" classname="org.apache.xpath.XPathAPI">
- <classpath refid="classpath"/>
- </available>
- <available property="ora.driver.present"
classname="oracle.jdbc.OracleResultSet">
- <classpath refid="classpath"/>
+
+ <available property="xpath.present"
+ classname="org.apache.xpath.XPathAPI">
+ <classpath refid="classpath"/>
</available>
- <available property="mail.present" classname="javax.mail.Session">
- <classpath refid="classpath"/>
+
+ <available property="ora.driver.present"
+ classname="oracle.jdbc.OracleResultSet">
+ <classpath refid="classpath"/>
</available>
- <ClassAvailable classpathref="classpath" property="naming.present"
classname="javax.naming.Context"/>
- <available property="weblogic.present"
classname="weblogic.servlet.internal.ServletContextImpl">
- <classpath refid="classpath"/>
+
+ <available property="mail.present"
+ classname="javax.mail.Session">
+ <classpath refid="classpath"/>
</available>
- <available property="maybeupload.present"
classname="uk.co.weft.maybeupload.MaybeUploadRequestWrapper">
- <classpath refid="classpath"/>
+
+ <ClassAvailable classpathref="classpath"
+ property="naming.present"
+ classname="javax.naming.Context"/>
+
+ <available property="weblogic.present"
+ classname="weblogic.servlet.internal.ServletContextImpl">
+ <classpath refid="classpath"/>
</available>
+
+ <ClassAvailable classpathref="classpath"
+ property="svg.present"
+ classname="org.apache.batik.transcoder.Transcoder"/>
+
+ <ClassAvailable classpathref="classpath"
+ property="fop.present"
+ classname="org.apache.fop.apps.Driver"/>
+
+ <ClassAvailable classpathref="classpath"
+ property="tidy.present"
+ classname="org.w3c.tidy.Tidy"/>
+
+ <ClassAvailable classpathref="classpath"
+ property="maybeupload.present"
+ classname="uk.co.weft.maybeupload.MaybeUploadRequestWrapper"/>
+
</target>
+
+ <!-- =================================================================== -->
+ <!-- Macro for optional warnings -->
+ <!-- =================================================================== -->
+ <target name="op-warning" description="General waring target (used by other
targets)">
+ <echo>**********************************************</echo>
+ <echo>*</echo>
+ <echo>* Classes of the optional package ${thing} are not </echo>
+ <echo>* available. ${fullname} builds without them.</echo>
+ <echo>*</echo>
+ <echo>* ${message}</echo>
+ <echo>*</echo>
+ <echo>* Recovery:</echo>
+ <echo>* ${recovery}</echo>
+ <echo>*</echo>
+ <echo>***********************************************</echo>
+ <echo/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Warnings -->
+ <!-- =================================================================== -->
+ <target name="svg-warn" unless="svg.present"
+ description="Outputs a warning if org.apache.batik.* classes are missing
during compilation">
+ <antcall target="op-warning">
+ <param name="thing" value="Batik"/>
+ <param name="recovery"
+ value="Get Batik from http://xml.apache.org/batik and place the jar in the
lib dir"/>
+ <param name="message"
+ value="Batik is required for the svg serializers."/>
+ </antcall>
+ </target>
+ <target name="fop-warn" unless="fop.present"
+ description="Outputs a warning if org.apache.fop.* classes are missing during
compilation">
+ <antcall target="op-warning">
+ <param name="thing" value="FOP"/>
+ <param name="recovery"
+ value="Get FOP from http://xml.apache.org/fop and place the jar in the lib
dir"/>
+ <param name="message"
+ value="FOP is required for the fo2pdf, fo2ps and fo2pcl serializer."/>
+ </antcall>
+ </target>
+ <target name="tidy-warn" unless="tidy.present"
+ description="Outputs a warning if org.w3c.tidy.* classes are missing during
compilation">
+ <antcall target="op-warning">
+ <param name="thing" value="JTidy"/>
+ <param name="recovery"
+ value="Get JTidy from http://sourceforge.net/projects/jtidy/ and place the
jar in the lib dir"/>
+ <param name="message"
+ value="JTidy is required for the html generator."/>
+ </antcall>
+ </target>
+ <target name="maybeupload-warn" unless="maybeupload.present"
+ description="Outputs a warning if uk.co.weft.maybeupload.* classes are
missing during compilation">
+ <antcall target="op-warning">
+ <param name="thing" value="MaybeUpload"/>
+ <param name="recovery"
+ value="Get MaybeUpload from http://www.weft.co.uk/library/maybeupload/ and
place the jar in the lib dir"/>
+ <param name="message"
+ value="MaybeUpload simplifies the handling of uploaded files."/>
+ </antcall>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Print out warnings for optional components -->
+ <!-- =================================================================== -->
+ <target name="optional-warnings" depends="svg-warn, fop-warn, tidy-warn,
maybeupload-warn"
+ description="Outputs warnings if some optional jars are missing from the
environment">
+ </target>
+
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
- <target name="prepare" depends="init">
+ <target name="prepare" depends="init, optional-tests, optional-warnings">
<mkdir dir="${build.dir}"/>
</target>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]