You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Aleksander Rozman <al...@hermes.si> on 2004/01/12 18:34:21 UTC

Parameter passed to target (take2)


>  -----Original Message-----
> From: 	Aleksander Rozman  
> Sent:	Monday, January 05, 2004 1:27 PM
> To:	'user@ant.apache.org'
> Subject:	Parameter passed to target
> 
> 
> Hi !
> 
> I am having weird request. I would like to pass a parameter to specific
> task. How can I do that?
> 
> I tried to create <property> and then redefine it later, so that target
> can use it, but this doesn't work... Is there any simple sollution?
> 
> Is there possibility to change property later? How? I tried by issuing
> same command as first time...
> 
> I am attaching  part of my build.xml... in message... 
> 
> Andy
> 
> 
<project name="osis" default="build">

 
<!--=======================================================================-
->
  <property name="osis.shema" value="osisCore.1.1.1.xsd"/>  <!-- This should
be redefined -->
  <property name="osis.jar" value="jsword-osis.jar"/>               <!--
This should be redefined -->
  
<<snip>>

  <target name="xjc" description="Creates java OSIS source files (XJC)">
    <echo message="Build java source files for ${osis.shema}"/>
    <delete dir="${osis.src}"/>
    <mkdir dir="${osis.src}"/>
    <java fork="true" classname="com.sun.tools.xjc.Driver">
      <arg value="-d"/>
      <arg value="${osis.src}"/>
      <arg value="-p"/>
      <arg value="org.crosswire.jsword.osis"/>
      <arg value="${osis.shema.base}/${osis.shema}"/>
      <classpath>
        <fileset dir="${libs.jar}" includes="**/*.jar"
excludes="**/jsword-osi*.jar" />
      </classpath>
    </java>
  </target>


  <target name="osis_1.1.1">
      <property name="osis.shema" value="osisCore.1.1.1.xsd"/>
      <property name="osis.jar" value="jsword-osis-1.1.1.jar"/>
      <antcall target="xjc"/>
  </target>

  <target name="osis_1.1">
      <property name="osis.shema" value="osisCore.1.1.xsd"/>
      <property name="osis.jar" value="jsword-osis-1.1.jar"/>
      <antcall target="xjc"/>
  </target>

</project>






> --------------------------------------------------------------------------
> ----
> Aleksander Rozman - Andy                           Hermes SoftLab
>                                                    Maribor Office,
> Slovenia
> arozman@hermes.si                                  ASD:NIS
> ICQ: 4911125                                       +386 2 4508-946
> --------------------------------------------------------------------------
> ----
>         Experience is what you get, when you don't get what you want !
> --------------------------------------------------------------------------
> ----
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org