[oXygen-user] Using my own Ant build file in a DITA scenario

Eliot Kimber ekimber at reallysi.com
Thu Mar 8 08:11:04 CST 2012


I recommend not importing the base build.xml file, partly for this reason.

I find it better to use <ant>, which executes build.xml pretty much as if it
had been done from the command line. It also reduces the dependency of your
ant script on the build.xml and avoids interference.

E.g.:

        <ant antfile="${dita-ot-dir}/build.xml"
                    dir="${dita-ot-dir}"
                    target="dita2epub"
                   
                    >
            <property name="args.input" location="${root.map}"/>
      <property name="transtype" value="epub"/>
            <property name="args.outext" value="html"/>
            <property name="dita.dir" location="${dita-ot-dir}"/>
            <property name="dita.temp.dir"
location="${basedir}/temp/${pub.name}/epub"/>
            <property name="clean.temp" value="true"/><!-- Unset to preserve
the temp directory -->
            <property name="output.dir" location="${output.dir}"/>
        </ant>     


Where the Ant property dita-ot-dir is set via a separate properties file
that is included by my main build script:

  <property file="build.properties"/>
  <property file="${user.home}/.build.properties"/>
  <property file="${user.home}/build.properties"/>

    <fail message="Required property dita-ot-dir is not set. It should be
set in your build.properties or .build.properties file">
      <condition>
          <not>
              <isset property="dita-ot-dir"/>
          </not>
      </condition>
    </fail>

    <fail message="Cannot find expected file ${dita-ot-dir}/build.xml in
location specified by dita-ot-dir property">
        <condition>
            <not>
              <available file="${dita-ot-dir}/build.xml"/>
            </not>
      </condition>
    </fail>


Cheers,

E.

On 3/8/12 7:41 AM, "Florent Georges" <lists at fgeorges.org> wrote:

>   Hi,
> 
>   I tried to use a custom Ant build file for one of my DITA scenarios.
> Within that script, I import the Ant script from DITA OT in the oXygen
> distribution, and I set a value for a specific property:
> 
>     <project basedir="." name="...">
>        <import file="/.../frameworks/dita/DITA-OT/demo/fo/build.xml"/>
>        <property name="some.ot.prop" value="..."/>
>     </project>
> 
>   The problem is that the build.xml in oXygen distro contains import
> instructions with properties:
> 
>     <import file="${dita.plugin.org.dita.pdf2.dir}/build_fop.xml"/>
>     <import file="${dita.plugin.org.dita.pdf2.dir}/build_axf.xml"/>
>     <import file="${dita.plugin.org.dita.pdf2.dir}/build_xep.xml"/>
> 
> and when I run the transform scenario, Ant complains that it cannot
> find the file /.../fo/${dita.plugin.org.dita.pdf2.dir}/build_fop.xml
> (see? the property has not been expanded).  The error is:
> 
>     BUILD FAILED
>     /.../my-build.xml:3: The following error occurred while executing this
> line:
>     /.../fo/build.xml:29: Cannot find
> /.../fo/${dita.plugin.org.dita.pdf2.dir}/build_fop.xml imported from
> /.../fo/build.xml
> 
>   What did I miss?  How can I make sure the same properties are loaded
> in both cases?  Is there any built-in mechanism in oXygen to overload
> Ant properties without setting my own build file?
> 
>   Regards,
> 
> -- 
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user

-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.reallysi.com
www.rsuitecms.com



More information about the oXygen-user mailing list