All Downloads are FREE. Search and download functionalities are using the official Maven repository.

docs.build.xml Maven / Gradle / Ivy

Go to download

EMMA is a fast Java code coverage tool based on bytecode instrumentation. It differs from the existing tools by enabling coverage profiling on large scale enterprise software projects with simultaneous emphasis on fast individual development.

The newest version!
<?xml version="1.0"?>
<!-- ============= [build file for ANT v1.5.x] ====================== -->
<!-- $Id: build.xml,v 1.2 2006/01/15 01:54:14 vlad_r Exp $ --> 

<project name="docs" default="build" basedir="." >
  <property name="app.short.name" value="${ant.project.name}" />

  <!-- ============================================================== -->
  <!-- This build has a number of dependencies that are too large to
       keep in CVS. Please see instructions in BUILD.txt for details.

       The static build structure is a little weird, because it is meant
       to be Apache Forrest-compatible (in the future):

       +~~data
       |  +~~content           static content (images, CSS defs, etc)
       |  |  +~~images
       |  |  |  \~~callouts
       |  |  \~~skin
       |  |     \~~css
       |  \~~docbook           DocBook content and sitemap files
       \~~lib                  checked-in dependencies

       The work directory structure created by the build uses ${out.dir}
       for all intermediate artifacts and ${dist.dir}/docs for delivering
       all distributable content. (The latter is not archived, the overall
       project build picks up ${dist.dir}/docs for overall release packaging.)
  -->
  <!-- ============================================================== -->

  <!-- (1) pull in the OS environment variables: -->
  <property environment="env" />

  <!-- (2) load the official build settings file: -->
  <property file="build.properties" />
  
  <!-- (3) load the CVS-versioned release/branch properties file: -->
  <property file="release.properties" />

  <!-- (4) load an optional global properties file: -->
  <property file="${env.ANT_BLDENV}/ant.properties" />

  <!-- (5) static (checked-in) build structure: -->
  <property file="module.dirs.properties" />

  <!-- (6) work (created by the build) build structure: -->
  <property file="work.dirs.properties" />

  <xmlcatalog id="catalogs">
    <dtd publicId="-//OASIS//DTD DocBook XML V4.4//EN" location="${docbook.home}/docbookx.dtd"/>
    <dtd publicId="-//emma//DTD DocBook XSL targetset//EN" location="${docbook.xsl.home}/common/targetdatabase.dtd"/>
  </xmlcatalog>

  <!-- ============================================================== -->
  <!-- main/default build target: -->

  <target name="build" depends="docs.generate, docs.distribution"
          description="-> full user docs build [without 'clean']"
  />

  <!-- ============================================================== -->
  <!-- support targets: -->
  <!-- ============================================================== -->

  <target name="clean" depends="clean.out, clean.dist"
          description="-> complete clean (output + distribution)" />


  <target name="clean.out" description="-> output clean" >
    <delete dir="${out.dir}" />
  </target>

  <target name="clean.dist" description="-> distribution clean" >
    <delete dir="${dist.dir}"/>
  </target>

  <!-- ============================================================== -->
  <!-- init targets: -->
  <!-- ============================================================== -->

  <target name="init" depends="init.cfg.check, init.mkdirs" >
  </target>


  <target name="init.cfg.check" >
    <fail unless="xalan.home">property "xalan.home" not set</fail>
    <fail unless="fop.home">property "fop.home" not set</fail>

    <fail unless="docbook.home">property "docbook.home" not set</fail>
    <fail unless="docbook.xsl.home">property "docbook.xsl.home" not set</fail>

    <available file="${docbook.home}/docbookx.dtd" property="docbook.home.ok" />
    <fail unless="docbook.home.ok">location [${docbook.home}] is not a valid DocBook DTD distribution</fail>

    <available file="${docbook.xsl.home}/html/docbook.xsl" property="docbook.xsl.home.ok" />
    <fail unless="docbook.xsl.home.ok">location [${docbook.xsl.home}] is not a valid DocBook XSL distribution</fail>
  </target>

  <target name="init.mkdirs.check" >
    <available file="${out.dir}/.mkdirs" property="init.mkdirs.notneeded" />
  </target>

  <target name="init.mkdirs" depends="init.mkdirs.check" unless="init.mkdirs.notneeded" >
    <mkdir dir="${out.dir}" />
    <mkdir dir="${dist.dir}" />

    <touch file="${out.dir}/.mkdirs" />
  </target>

  <!-- ============================================================== -->
  <!-- doc generation targets: -->
  <!-- ============================================================== -->

  <target name="docs.generate" depends="init, docs.single.generate, docs.chunked.generate, docs.pdf.generate"/>


  <target name="docs.single.generate" depends="init">

    <!-- create just the sitemap target databases: -->
    <antcall target="docgen.single.html" inheritRefs="true" >
      <param name="olink" value="only"/>
      <param name="doc" value="userguide"/>
    </antcall>
    <antcall target="docgen.single.fixup"><!-- work around DocBook's problem with callout images -->
      <param name="doc" value="userguide"/>
    </antcall>

    <antcall target="docgen.single.html" inheritRefs="true" >
      <param name="olink" value="only"/>
      <param name="doc" value="reference"/>
    </antcall>
    <antcall target="docgen.single.fixup">
      <param name="doc" value="reference"/>
    </antcall>

    <copy file="${docs.src.dir}/sitemap_single.xml" todir="${out.dir}" />

    <!-- generate actual documents (with olink xrefs): -->
    <antcall target="docgen.single.html" inheritRefs="true" >
      <param name="olink" value="no"/>
      <param name="doc" value="userguide"/>
    </antcall>
    <antcall target="docgen.single.html" inheritRefs="true" >
      <param name="olink" value="no"/>
      <param name="doc" value="reference"/>
    </antcall>
  </target>

  <target name="docs.chunked.generate" depends="init" >

    <!-- create just the sitemap target databases: -->
    <antcall target="docgen.chunked.html" inheritRefs="true" >
      <param name="olink" value="only"/>
      <param name="doc" value="userguide"/>
    </antcall>
    <antcall target="docgen.chunked.fixup"><!-- work around DocBook's problem with callout images -->
      <param name="doc" value="userguide"/>
    </antcall>

    <antcall target="docgen.chunked.html" inheritRefs="true" >
      <param name="olink" value="only"/>
      <param name="doc" value="reference"/>
    </antcall>
    <antcall target="docgen.chunked.fixup">
      <param name="doc" value="reference"/>
    </antcall>

    <copy file="${docs.src.dir}/sitemap_chunked.xml" todir="${out.dir}" />

    <!-- generate actual documents (with olink xrefs): -->
    <antcall target="docgen.chunked.html" inheritRefs="true" >
      <param name="olink" value="no"/>
      <param name="doc" value="userguide"/>
    </antcall>
    <antcall target="docgen.chunked.html" inheritRefs="true" >
      <param name="olink" value="no"/>
      <param name="doc" value="reference"/>
    </antcall>
  </target>


  <target name="docs.pdf.generate" depends="init" >
    <antcall target="docgen.pdf" inheritRefs="true" >
      <param name="doc" value="reference"/>
    </antcall>
  </target>

  <!-- ============================================================== -->
  <!-- distribution targets: -->
  <!-- ============================================================== -->

  <target name="docs.distribution" depends="init, docs.file.distribution" />


  <target name="docs.file.distribution" depends="init" >
    <mkdir dir="${dist.dir}/docs" />
    <copy todir="${dist.dir}/docs" >
      <fileset dir="${out.dir}" >
        <include name="userguide/**" />
        <include name="userguide_single/**" />
        <include name="reference/**" />
        <include name="reference_single/**" />
        <exclude name="*/*.db" />
        <exclude name="*/*.fo" />
      </fileset>
    </copy>
    <copy todir="${dist.dir}/docs" >
      <fileset dir="${docs.dir.root}/content" >
      </fileset>
    </copy>
  </target>


  <!-- a helper target for distributing into the site build: -->
  <target name="docs.site.distribution" depends="init, docs.file.distribution" >
    <fail unless="site.content.dir">property "site.content.dir" must be set</fail>
    <copy todir="${site.content.dir}" >
      <fileset dir="${dist.dir}/docs" >
        <exclude name="**/index.html" />
      </fileset>
    </copy>
  </target>

  <!-- ============================================================== -->
  <!-- antcall-able helper targets: -->
  <!-- ============================================================== -->

  <target name="docgen.single.fixup">
    <exec executable="perl" failonerror="true" output="${out.dir}/${doc}_single/${doc}.temp" >
      <arg value="-ne" />
      <arg value="s/&lt;img[^&gt;]*>//g; print $_;" />
      <arg value="${out.dir}/${doc}_single/${doc}.db" />
    </exec>
    <move file="${out.dir}/${doc}_single/${doc}.temp" tofile="${out.dir}/${doc}_single/${doc}.db" />
  </target>

  <target name="docgen.chunked.fixup">
    <exec executable="perl" failonerror="true" output="${out.dir}/${doc}.temp" >
      <arg value="-ne" />
      <arg value="s/&lt;img[^&gt;]*>//g; print $_;" />
      <arg value="${out.dir}/${doc}.db" /><!-- NOTE: the original doc is created in ${out.dir} -->
    </exec>
    <move file="${out.dir}/${doc}.temp" tofile="${out.dir}/${doc}/${doc}.db" />
  </target>


  <target name="docgen.single.html">
   <xslt  processor="trax"
          force="yes"
          in="${docs.src.dir}/${doc}.xml"
          out="${out.dir}/${doc}_single/${doc}.html"
          style="${docbook.xsl.home}/html/docbook.xsl"
    >
      <classpath>
        <fileset dir="${xalan.home}/" includes="*.jar" />
      </classpath>

      <xmlcatalog refid="catalogs" />

      <param name="collect.xref.targets" expression="${olink}" />
      <param name="targets.filename" expression="${doc}.db" />
      <param name="target.database.document" expression="${out.dir}/sitemap_single.xml" />
      <param name="current.docid" expression="${doc}" />

      <param name="section.autolabel" expression="1" />
      <param name="html.stylesheet" expression="../skin/css/doc.css" />
      <param name="ulink.target" expression="_blank" />
      <param name="admon.graphics.path" expression="../images/" />
      <param name="callout.graphics.path" expression="../images/callouts/" />
      <param name="generate.meta.abstract" expression="1" />
      <param name="inherit.keywords" expression="1" />
    </xslt>
  </target>

  <target name="docgen.chunked.html">
   <mkdir dir="${out.dir}/${doc}" />
   <xslt  processor="trax"
          force="yes"
          in="${docs.src.dir}/${doc}.xml"
          out="${out.dir}/dummy.excluded"
          style="${docbook.xsl.home}/html/chunk.xsl"
    >
      <classpath>
        <fileset dir="${xalan.home}/" includes="*.jar" />
      </classpath>

      <xmlcatalog refid="catalogs" />

      <param name="collect.xref.targets" expression="${olink}" />
      <param name="targets.filename" expression="${doc}.db" />
      <param name="target.database.document" expression="${out.dir}/sitemap_chunked.xml" />
      <param name="current.docid" expression="${doc}" />

      <param name="base.dir" expression="${out.dir}/${doc}/" /> <!-- trailing / is important -->
      <param name="root.filename" expression="${doc}" />
      <param name="chunk.fast" expression="1" />
      <param name="chunk.quietly" expression="1" />
      <param name="chunk.section.depth" expression="2" />
      <param name="chunk.first.sections" expression="0" /> <!-- TODO: this is debatable -->
      <param name="navig.graphics" expression="1" />
      <param name="navig.graphics.path" expression="../images/" />
      <param name="navig.graphics.extension" expression=".gif" />

      <param name="section.autolabel" expression="1" />
      <param name="html.stylesheet" expression="../skin/css/doc.css" />
      <param name="ulink.target" expression="_blank" />
      <param name="admon.graphics.path" expression="../images/" />
      <param name="callout.graphics.path" expression="../images/callouts/" />
      <param name="generate.meta.abstract" expression="1" />
      <param name="inherit.keywords" expression="1" />
    </xslt>
  </target>


 <target name="docgen.pdf" >
   <xslt  processor="trax"
          force="false"
          in="${docs.src.dir}/${doc}.xml"
          out="${out.dir}/${doc}/${doc}.fo"
          style="${docbook.xsl.home}/fo/docbook.xsl"
    >
      <xmlcatalog refid="catalogs" />

      <param name="section.autolabel" expression="1" />
      <param name="html.stylesheet" expression="../skin/css/doc.css" />
      <param name="ulink.target" expression="_blank" />
      <param name="admon.graphics.path" expression="../images/" />
      <param name="callout.graphics.path" expression="../images/callouts/" />

      <param name="fop.extensions" expression="1" />
      <param name="variablelist.as.blocks" expression="1" />
      <param name="shade.verbatim" expression="1" />
      <param name="hyphenate" expression="false" />
      <param name="insert.xref.page.number" expression="1" />
    </xslt>

    <!-- NOTE: this is hardcoded for Apache FOP 0.20.5 release: -->
    <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
      <classpath>
        <pathelement location="${fop.home}/build/fop.jar"/>
        <pathelement location="${fop.home}/lib/avalon-framework-cvs-20020806.jar"/>
        <pathelement location="${fop.home}/lib/batik.jar"/>
      </classpath>
    </taskdef>

    <fop format="application/pdf" 
         fofile="${out.dir}/${doc}/${doc}.fo"
         outfile="${out.dir}/${doc}/${doc}.pdf" />
  </target>

</project>
<!-- ========= END OF FILE ========================================== -->





© 2015 - 2024 Weber Informatics LLC | Privacy Policy