| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <?xml version="1.0"?>
- <!-- This file is part of the DITA Open Toolkit project hosted on
- Sourceforge.net. See the accompanying license.txt file for
- applicable licenses.-->
- <!-- (c) Copyright IBM Corp. 2006 All Rights Reserved. -->
- <project name="ditaot-init">
-
- <!-- Default maximum memory to give to forked Java processes.
-
- Set this higher either in another Ant script or on the
- Ant command line using the -D parameter, e.g.:
-
- ant -DmaxJavaMemory=4G
-
- Memory values are integers followed by "M" for megabytes,
- "G" for gigabytes.
-
- On 32-bit systems, the largest memory setting will be somewhere
- between 1500M and 2000M depending on your system.
-
- 64-bit JVMs can use essentially unlimited memory.
-
- For memory-intensive process (very large maps),
- 2 or 3 gigabytes should be more than sufficient.
-
- This value is used in the @maxmemory attribute the of the Ant
- <java> task.
- -->
- <property name="maxJavaMemory" value="500m"/>
-
- <!-- Read configuration properties -->
- <property file="${dita.dir}/lib/org.dita.dost.platform/plugin.properties"/>
- <property file="${dita.dir}/lib/configuration.properties"/>
-
- <xmlcatalog id="dita.catalog">
- <catalogpath path="${dita.plugin.org.dita.base.dir}/catalog-dita.xml"/>
- </xmlcatalog>
- <!-- Determine the Java architecture and set the JVM arguments
- appropriately.
-
- Note that the Java architecture is determined by how the
- JVM is started, so it is possible for the base Ant
- JVM to have been started in 32-bit mode on a 64-bit machine.
-
- The is64bit and is32bit properties are mutually exclusive.
-
- -->
- <condition property="is64bit">
- <!-- NOTE: The following is not a complete list but should cover
- most of the systems Open Toolkit users are likely
- to use. Add more values as they become known.
- -->
- <and>
- <or>
- <os arch="x86_64"/>
- <os arch="amd64"/>
- <os arch="ppc64"/>
- </or>
- <not>
- <os family="windows"/>
- </not>
- </and>
- </condition>
-
- <condition property="is32bit">
- <isfalse value="${is64bit}"/>
- </condition>
-
- <!-- For 64-bit machines, the value -d64 runs the
- the JVM in 64-bit mode. This parameter cannot
- be specified on 32-bit machines (that is, you cannot
- specify -d32 on a 32-bit machine, you get an "unrecognized
- option error in that case).
- -->
- <condition property="jvmArchFlag"
- value="-d64"
- else="">
- <istrue value="${is64bit}"/>
- </condition>
- <!-- Base JVM argument line to use with any forked Java processes.
-
- Sets the JVM architecture.
-
- Use like so:
-
- <java ...>
- <jvmarg line="${baseJVMArgLine}"/>
- ...
- </java>
- -->
- <property name="baseJVMArgLine" value="${jvmArchFlag} -Xmx${maxJavaMemory}"/>
- <!-- Deprecated -->
- <path id="dost.jar.path" refid="dost.class.path"/>
- <taskdef name="pipeline"
- classname="org.dita.dost.invoker.ExtensibleAntInvoker">
- <classpath refid="dost.class.path" />
- </taskdef>
- <taskdef name="dita-ot-echo"
- classname="org.dita.dost.log.DITAOTEchoTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <taskdef name="dita-ot-fail"
- classname="org.dita.dost.log.DITAOTFailTask">
- <classpath refid="dost.class.path" />
- </taskdef>
- <taskdef name="dita-ot-copy"
- classname="org.dita.dost.util.DITAOTCopy">
- <classpath refid="dost.class.path" />
- </taskdef>
-
- <taskdef name="job-property" classname="org.dita.dost.platform.JobPropertyTask">
- <classpath refid="dost.class.path"/>
- </taskdef>
-
- <typedef name="isabsolute"
- classname="org.dita.dost.util.IsAbsolute">
- <classpath refid="dost.class.path" />
- </typedef>
-
- <typedef name="dita-fileset" classname="org.dita.dost.util.JobSourceSet">
- <classpath refid="dost.class.path" />
- </typedef>
- <macrodef name="job-helper" >
- <attribute name="file"/>
- <attribute name="property"/>
- <sequential>
- <xslt in="${dita.temp.dir}/.job.xml" out="${dita.temp.dir}/@{file}"
- style="${dita.plugin.org.dita.base.dir}/xsl/job-helper.xsl"
- force="true" taskname="job-helper">
- <param name="property" expression="@{property}"/>
- <outputproperty name="encoding" value="${file.encoding}"/>
- </xslt>
- </sequential>
- </macrodef>
-
- <tstamp>
- <format property="current.date" pattern="yyyyMMddHHmmssSSS"/>
- </tstamp>
- <property name="base.temp.dir" location="${basedir}/temp"/>
- <property name="dita.temp.dir" location="${base.temp.dir}${file.separator}temp${current.date}" />
- <property name="output.dir" location="${basedir}/out" />
- <property environment="env" />
- <!-- property values end -->
- <target name="build-init"
- depends="check-arg,
- log-arg" />
- <!-- property value validation begin -->
- <target name="check-arg"
- description="Validate and init input arguments">
- <!-- begin to check input parameters -->
- <dita-ot-fail id="DOTA003F">
- <condition>
- <and>
- <isset property="args.xsl" />
- <not>
- <available file="${args.xsl}" type="file" />
- </not>
- </and>
- </condition>
- <param name="1" location="${args.xsl}"/>
- </dita-ot-fail>
- <!-- end to check input parameters -->
- <!-- begin to init required parameters -->
- <dita-ot-fail id="DOTA012W">
- <condition>
- <isset property="dita.input.valfile" />
- </condition>
- <param name="1" value="dita.input.valfile"/>
- <param name="2" value="args.filter"/>
- </dita-ot-fail>
- <condition property="dita.input.valfile" value="${args.filter}">
- <and>
- <isset property="args.filter"/>
- <not><isset property="dita.input.valfile"/></not>
- </and>
- </condition>
- <dita-ot-fail id="DOTA013F">
- <condition>
- <and>
- <isset property="args.filter" />
- <not>
- <available file="${args.filter}" type="file" />
- </not>
- </and>
- </condition>
- <param name="1" location="${args.filter}"/>
- </dita-ot-fail>
- <condition property="filter-stage" value="early">
- <not>
- <isset property="filter-stage"/>
- </not>
- </condition>
- <condition property="filter-on-parse" value="true">
- <and>
- <equals arg1="${filter-stage}" arg2="early"/>
- </and>
- </condition>
- <!-- append a '.' to out.ext if args.outext not contains '.' -->
- <condition property="out.ext" value=".${args.outext}">
- <and>
- <isset property="args.outext" />
- <not>
- <contains string="${args.outext}" substring="." />
- </not>
- </and>
- </condition>
- <condition property="out.ext" value="${args.outext}">
- <and>
- <isset property="args.outext" />
- <contains string="${args.outext}" substring="." />
- </and>
- </condition>
-
- <condition property="args.grammar.cache"
- value="yes">
- <not>
- <isset property="args.grammar.cache" />
- </not>
- </condition>
-
- <condition property="args.xml.systemid.set"
- value="yes">
- <not>
- <isset property="args.xml.systemid.set" />
- </not>
- </condition>
- <!-- end to init required parameters -->
- <!-- create required directories -->
- <mkdir dir="${output.dir}" />
- <delete dir="${dita.temp.dir}" quiet="false"/>
- <mkdir dir="${dita.temp.dir}" />
- <condition property="args.logdir" value="${output.dir}">
- <not>
- <isset property="args.logdir" />
- </not>
- </condition>
-
- <!-- Validate the xml file or not,default is validation(true)-->
- <condition property="validate" value="true">
- <not>
- <isset property="validate" />
- </not>
- </condition>
-
- <!-- Related links to output: none, all, nofamily -->
- <condition property="include.rellinks" value="">
- <equals arg1="${args.rellinks}" arg2="none"/>
- </condition>
- <condition property="include.rellinks" value="#default sibling friend cousin ancestor descendant sample external other">
- <equals arg1="${args.rellinks}" arg2="nofamily"/>
- </condition>
- <condition property="include.rellinks" value="#default child sibling friend next previous cousin ancestor descendant sample external other">
- <or>
- <equals arg1="${args.hide.parent.link}" arg2="yes"/>
- <equals arg1="${args.rellinks}" arg2="noparent"/>
- </or>
- </condition>
- <condition property="include.rellinks" value="#default parent child sibling friend next previous cousin ancestor descendant sample external other">
- <or>
- <equals arg1="${args.rellinks}" arg2="all"/>
- <not><isset property="args.rellinks"/></not>
- </or>
- </condition>
-
- <!--solution for the output control-->
- <condition property="generate.copy.outer" value="1">
- <not>
- <isset property="generate.copy.outer" />
- </not>
- </condition>
-
- <condition property="onlytopic.in.map" value="false">
- <not>
- <isset property="onlytopic.in.map" />
- </not>
- </condition>
- <!--
- default value : warn
- fail :1a) Fail quickly if files are going to be generated/copied outside of that directory
- warn :1b) Complete if files will be generated/copied outside, but log a warning
- quiet :1c) Quietly finish with only those files (no warning or error)
- -->
- <condition property="outer.control" value="warn">
- <not>
- <isset property="outer.control" />
- </not>
- </condition>
-
- <condition property="inner.transform">
- <equals arg1="${generate.copy.outer}" arg2="1"/>
- </condition>
-
- <condition property="old.transform">
- <equals arg1="${generate.copy.outer}" arg2="3"></equals>
- </condition>
-
- <condition property="conserve-memory" value="false">
- <not><isset property="conserve-memory"/></not>
- </condition>
- </target>
-
- <target name="log-arg">
- <condition property="xml.parser" value="XMLReader ${org.xml.sax.driver}">
- <and>
- <isset property="org.xml.sax.driver"/>
- <not><isset property="xml.parser"/></not>
- </and>
- </condition>
- <condition property="xml.parser" value="Xerces">
- <and>
- <available classname="org.apache.xerces.parsers.SAXParser"/>
- <not><isset property="xml.parser"/></not>
- </and>
- </condition>
- <condition property="xml.parser" value="Xerces in Sun JDK 1.5">
- <and>
- <available classname="com.sun.org.apache.xerces.internal.parsers.SAXParser"/>
- <not><isset property="xml.parser"/></not>
- </and>
- </condition>
- <condition property="xml.parser" value="Crimson">
- <and>
- <available classname="org.apache.crimson.parser.XMLReaderImpl"/>
- <not><isset property="xml.parser"/></not>
- </and>
- </condition>
- <condition property="xslt.parser" value="Saxon" else="Xalan">
- <or>
- <available classname="net.sf.saxon.StyleSheet"/>
- <available classname="net.sf.saxon.Transform"/>
- </or>
- </condition>
- <condition property="collator" value="ICU" else="JDL">
- <available classname="com.ibm.icu.text.Collator"/>
- </condition>
- <!-- output parameters info -->
- <echo level="info">*****************************************************************</echo>
- <echo level="info">* basedir = ${basedir}</echo>
- <echo level="info">* dita.dir = ${dita.dir}</echo>
- <!--echo level="info">* input = ${args.input}</echo-->
- <echo level="info">* transtype = ${transtype}</echo>
- <echo level="info">* tempdir = ${dita.temp.dir}</echo>
- <echo level="info">* outputdir = ${output.dir}</echo>
- <echo level="info">* clean.temp = ${clean.temp}</echo>
- <echo level="info">* DITA-OT version = ${otversion}</echo>
- <echo level="info">* XML parser = ${xml.parser}</echo>
- <echo level="info">* XSLT processor = ${xslt.parser}</echo>
- <echo level="info">* collator = ${collator}</echo>
- <echo level="info">*****************************************************************</echo>
- <echoproperties regex="^(arg|preprocess|dita)" taskname="echo" failonerror="false"/>
- <echo level="info">*****************************************************************</echo>
- </target>
- </project>
|