Changeset 3198 for trunk/build.xml


Ignore:
Timestamp:
Mar 20, 2007, 2:42:00 PM (16 years ago)
Author:
Martin Svensson
Message:

Added an ant task and a xsl stylesheet for helptext-import-file generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3196 r3198  
    243243    description="Generate docbook documentation. This target is temporary.
    244244      It will be included in the 'doc' target in the future."
     245  />
     246 
     247  <target
     248    name="helptext"
     249    depends="dev.init, doc.helptext"
     250    description="Generate import file with helptexts from the docbook documentation."
    245251  />
    246252
     
    10341040  </target>
    10351041 
     1042  <target
     1043    name="doc.helptext"
     1044    depends="doc.docbook, xsltprocessor"
     1045    description="Generate a import file with helptexts for the webclient"
     1046    >   
     1047    <delete file="${build}/docbook/helptext_docbook.xml"/> 
     1048    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
     1049    <path id="ant-extensions">
     1050        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
     1051        <pathelement path="${lib}/docbook/ant-extensions" />
     1052      </path>
     1053   
     1054    <xmlcatalog id="dtdcatalog">
     1055          <catalogpath>
     1056              <fileset file="${catalog.location}"/>
     1057          </catalogpath>
     1058      </xmlcatalog>
     1059
     1060      <style
     1061          in      = "${build}/docbook/docbook-ready-file.tmp"
     1062          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
     1063          out     = "${build}/docbook/helptext_docbook.xml"
     1064          processor = "${xslt.processor}"
     1065          >
     1066          <xmlcatalog refid="dtdcatalog"/>
     1067          <classpath refid="ant-extensions" />
     1068
     1069          <param name="xsltproc.catalog" expression="${catalog.location}" />
     1070          <param name="xsltproc.option.--nonet"  expression="" />
     1071      </style>
     1072
     1073    <replaceregexp
     1074      file="${build}/docbook/helptext_docbook.xml"
     1075      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
     1076      replace="&amp;lt;\$1&amp;gt;"
     1077      flags="sg"
     1078    />
     1079   
     1080  </target>
     1081 
     1082  <target name="xsltprocessor">
     1083      <property environment="env"/>
     1084
     1085      <condition  property="executable.file.extension"
     1086                  value=".exe">
     1087              <os family="windows"/>
     1088      </condition>
     1089      <condition  property="executable.file.extension"
     1090                  value="">
     1091              <os family="unix"/>
     1092      </condition>
     1093     
     1094      <condition  property="tmp:xsltproc.available"
     1095                  value="xsltproc${executable.file.extension}">
     1096          <or>
     1097              <and>
     1098                  <os family="windows"/>
     1099                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
     1100              </and>
     1101              <and>
     1102                  <os family="unix"/>
     1103                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
     1104              </and>
     1105          </or>
     1106      </condition>
     1107     
     1108      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
     1109          <and>
     1110              <isset property="tmp:xsltproc.available" />
     1111              <not>
     1112                  <isset property="disable.xsltproc" />
     1113              </not>
     1114          </and>
     1115      </condition>
     1116     
     1117      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
     1118          <not>
     1119              <isset property="disable.saxon" />
     1120          </not>
     1121      </condition>
     1122
     1123      <condition property="xslt.processor" value="trax">
     1124          <not>
     1125          <and>
     1126                  <isset property="tmp:xsltproc.available" />
     1127                  <not>
     1128                      <isset property="disable.xsltproc" />
     1129                  </not>
     1130          </and>
     1131          </not>
     1132      </condition>
     1133
     1134    </target>
     1135 
    10361136  <!--package targets -->
    10371137  <target
Note: See TracChangeset for help on using the changeset viewer.