glenn 01/07/03 09:34:49
Modified: . common.xml
Log:
Add generation of *.html files for example *.jsp files
Revision Changes Path
1.12 +43 -12 jakarta-taglibs/common.xml
Index: common.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/common.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- common.xml 2001/07/02 02:03:31 1.11
+++ common.xml 2001/07/03 16:34:47 1.12
@@ -80,6 +80,8 @@
<available file="${examples.src}/src" property="examples.src.present"/>
<!-- See if we should use template to generate documentation and tld -->
<available file="xml/${taglib.name}.xml" property="template.present"/>
+ <!-- See if there is any documentation web app documents -->
+ <available file="${doc.src}/web" property="documentation.present"/>
<antcall target="${prepare.post}"/>
</target>
@@ -89,8 +91,6 @@
<target name="documentation" depends="prepare">
<antcall target="${documentation.pre}"/>
<antcall target="template-docs"/>
- <!-- Remove call to gen-docs once taglibs converted to new template -->
- <antcall target="gen-docs"/>
<copy todir="${build.doc}/WEB-INF">
<fileset dir="${doc.src}/conf"/>
</copy>
@@ -102,10 +102,7 @@
style="${taglibs.xsl}">
<param name="prefix" expression="../../"/>
</style>
- <mkdir dir="${doc.src}/web"/>
- <copy todir="${build.doc}">
- <fileset dir="${doc.src}/web" includes="**/*.html"/>
- </copy>
+ <antcall target="copy.documentation"/>
<javadoc packagenames="org.apache.taglibs.*"
sourcepath="src"
classpath="${classpath}"
@@ -120,6 +117,12 @@
<antcall target="${documentation.post}"/>
</target>
+ <target name="copy.documentation" if="documentation.present">
+ <copy todir="${build.doc}">
+ <fileset dir="${doc.src}/web" includes="**/*.html"/>
+ </copy>
+ </target>
+
<!-- =================================================================== -->
<!-- Assemble the examples application -->
<!-- =================================================================== -->
@@ -135,12 +138,11 @@
will be responsible for copying any necessary jar files. -->
<copy file="${dist.library}/${taglib.name}.jar"
toFile="${build.examples}/WEB-INF/lib/${taglib.name}.jar"/>
-
+ <!-- Copy the .jsp files as .txt files -->
<copy todir="${build.examples}" >
<fileset dir="${examples.src}/web" includes="*.jsp"/>
<mapper type="glob" from="*.jsp" to="*.txt"/>
</copy>
-
<!-- now escape the .txt files -->
<replace dir="${build.examples}">
<include name="**/*.txt"/>
@@ -152,10 +154,37 @@
<replacetoken><![CDATA[>]]></replacetoken>
<replacevalue><![CDATA[>]]></replacevalue>
</replace>
+ <antcall target="examples.html"/>
+ <antcall target="${examples.pre}"/>
+ </target>
+
+ <!-- Generates example html files from the escaped txt files -->
+ <target name="examples.html" unless="gen-docs.present">
+ <!-- now format the .txt files as an xml file -->
+ <replace dir="${build.examples}">
+ <include name="**/*.txt"/>
+ <replacetoken><![CDATA[<!doctype]]></replacetoken>
+ <replacevalue><![CDATA[<?xml version="1.0" ?>
- <antcall target="${examples.post}"/>
+<document>
+<!doctype]]></replacevalue>
+ </replace>
+ <replace dir="${build.examples}">
+ <include name="**/*.txt"/>
+ <replacetoken><![CDATA[</html>]]></replacetoken>
+ <replacevalue><![CDATA[</html></document>]]></replacevalue>
+ </replace>
+ <!-- now style the .txt files as .html files -->
+ <style basedir="${build.examples}"
+ destdir="${build.examples}"
+ includes="**/*.txt"
+ style="../../../src/taglib/examples.xsl"/>
+ <!-- delete the temporary text files -->
+ <delete>
+ <fileset dir="${build.examples}" includes="**/*.txt"/>
+ </delete>
</target>
-
+
<!-- =================================================================== -->
<!-- Compile the examples application -->
<!-- =================================================================== -->
@@ -178,8 +207,6 @@
<target name="library" depends="prepare">
<antcall target="${library.pre}"/>
<antcall target="template-tld"/>
- <!-- Remove call to gen-tld once taglibs converted to new template -->
- <antcall target="gen-tld"/>
<javac srcdir="${library.src}" destdir="${build.library}"
classpath="${classpath}" debug="on"/>
<antcall target="${library.post}"/>
@@ -265,6 +292,8 @@
destdir="${build.examples}/WEB-INF"
out="${build.examples}/WEB-INF/${taglib.name}.tld"
style="${tld11.xsl}"/>
+ <!-- Remove call to gen-tld once taglibs converted to new template -->
+ <antcall target="gen-tld"/>
</target>
<target name="template-docs" depends="prepare" if="template.present">
@@ -276,6 +305,8 @@
destdir="${build.doc}"
out="${build.doc}/changes.html"
style="${changes-doc.xsl}"/>
+ <!-- Remove call to gen-docs once taglibs converted to new template -->
+ <antcall target="gen-docs"/>
</target>
<!-- =================================================================== -->