ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Rauch <holger.ra...@heitec.de>
Subject Depending on varying target using param inside antcall
Date Tue, 05 Sep 2006 14:49:27 GMT
Hi,

I would like to have a target depend on another target whose name is
specified as the value of a param used inside an <antcall>. Is this
possible? If not, can this functionality be achieved in another way? If so,
which one? Below is an example that (hopefully) clarifies what I'm trying to
do. It consists of 2 files. One named "antcall-param-test.xml" containing
the <antcall> and another one named "antcall-actual-test.xml". This file
will do the real work and contains the target depending on the properties
defined in the corresponding target of antcall-param-test.xml.

antcall-param-test.xml

-----------------------------------------------------------------

<?xml version="1.0" encoding="iso-8859-1"?>

<project name="antcall-param-test" default="do-test" basedir=".">

  <property name="actual.test.location" location="antcall-actual-test.xml" />

  <import file="${actual.test.location}" />

  <target name="do-test" depends="xphistory-config-transformer-configuration,xphistory-presentation-ransformer-configuration">
    <antcall target="do-actual-test">
       <param name="transformer.configuration.target.name" value="xphistory-config-transformer-configuration"
/>
     </antcall>
  </target>

  <target name="xphistory-config-transformer-configuration">
    <!-- Valid values: saxon6, saxon8, xalan -->
    <property name="transformer.type" value="saxon8" />
    <property name="transformer.xml.input.file" value="../project/resources/businessmodel/resolved.xml"
/>
    <property name="transformer.xsl.stylesheet" value="../project/resources/businessmodel/helper/prepare-model-for-ear.xsl"
/>
    <property name="transformer.output.file"${src.dir}/my/sample/path/sample-config.xml"
/>
    <property name="transformer.xsl.stylesheet.params" value="NOT SET" />
  </target>

  <target name="xphistory-presentation-ransformer-configuration">
     <!-- Valid values: saxon6, xalan, xsltproc (all XSLT 1.x), saxon8 (XSLT 2.x) -->
     <property name="transformer.type" value="saxon8" />
     <property name="transformer.xml.input.file" value="${src.dir}/my/sample/path/dummy.xml"
/>
     <property name="transformer.xsl.stylesheet" value="${src.dir}/my/sample/path/compile_props2xml.xsl"
/>
     <property name="transformer.output.file" value="${src.dir}/my/sample/path/internal-properties.xml"
/>
     <!-- " around propvals required for Saxon -->
     <property name="transformer.xsl.stylesheet.params" value="prop.base.name=internal-history
prop.languages=${prop.languages}" />     
   </target>

</project>

------------------------------------------------------------------

antcall-actual-test.xml

------------------------------------------------------------------

<?xml version="1.0" encoding="iso-8859-1"?>

<project name="antcall-actual-test" default="do-actual-test" basedir=".">

  <target name="do-actual-test" depends="${transformer.configuration.target.name}">
    <echo message="Values set in target: ${transformer.configuration.target.name}" />
    <echo message="*** transformer.type = ${transformer.type}" />
    <echo message="*** transformer.xml.input.file = ${transformer.xml.input.file}" />
    <echo message="*** transformer.xsl.stylesheet = ${transformer.xsl.stylesheet}" />
    <echo message="*** transformer.output.file = ${transformer.output.file}" />
    <echo message="*** transformer.xsl.stylesheet.params = ${transformer.xsl.stylesheet.params}"
/>
  </target>

</project>

------------------------------------------------------------------

Any help will be greatly appreciated.

Thanks in advance!

Kind regards,

	Holger

Mime
View raw message