You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Scott Stark <ss...@us.ibm.com> on 2009/03/13 16:32:03 UTC

Problem with using the property task

I'm trying to import a set of properties from a property file into my build
when using the <ant> call. My property file looks something like this:

<project name="scenario_properties" basedir=".">
        <property name="component" value="vti"/>
</project>

My build file contains this target:

 <target name="all">
 <ant antfile="buildfile.xml" target="build-all-test" output="vti-all.log">
  <property resource="properties_files\vti-new.properties"/>
 </ant>
 </target>

The <antfile> that it's calling (buildfile.xml) contains this target:.

 <target name="build-all-test">
  <echo>component name is ${component}</echo>
 </target>

But the output of the above target build is simply:

build-all-test:
     [echo] component name is ${component}

Why is the component property not getting passed to my antfile? I've also
tried a properties file with the "component=vti" syntax and get the same
result.

Thank you,
Scott

Re: Problem with using the property task

Posted by Scott Stark <ss...@us.ibm.com>.
>i test your files and my output is:
>[echo] component name is vti
>Test in Eclipse.
>I have attached an zip-file containing my test.

Henning, it is working now, thank you. I must have had the syntax wrong.

Scott

Re: Problem with using the property task

Posted by Henning Lötsch <he...@vodafone.de>.
Hello Scott again,

sorry i not reading all.

i test your files and my output is:

[echo] component name is vti

Test in Eclipse.

I have attached an zip-file containing my test.



Scott Stark schrieb:
> I'm trying to import a set of properties from a property file into my build
> when using the <ant> call. My property file looks something like this:
> 
> <project name="scenario_properties" basedir=".">
>         <property name="component" value="vti"/>
> </project>
> 
> My build file contains this target:
> 
>  <target name="all">
>  <ant antfile="buildfile.xml" target="build-all-test" output="vti-all.log">
>   <property resource="properties_files\vti-new.properties"/>
>  </ant>
>  </target>
> 
> The <antfile> that it's calling (buildfile.xml) contains this target:.
> 
>  <target name="build-all-test">
>   <echo>component name is ${component}</echo>
>  </target>
> 
> But the output of the above target build is simply:
> 
> build-all-test:
>      [echo] component name is ${component}
> 
> Why is the component property not getting passed to my antfile? I've also
> tried a properties file with the "component=vti" syntax and get the same
> result.
> 
> Thank you,
> Scott


Re: Problem with using the property task

Posted by Henning Lötsch <he...@vodafone.de>.
Hello Scott,

look at:
http://ant.apache.org/manual/CoreTasks/property.html
Section "Property Files".

your property file syntax is wrong.

in your case the file vti-new.properties must look like this:
component=vti


Scott Stark schrieb:
> I'm trying to import a set of properties from a property file into my build
> when using the <ant> call. My property file looks something like this:
> 
> <project name="scenario_properties" basedir=".">
>         <property name="component" value="vti"/>
> </project>
> 
> My build file contains this target:
> 
>  <target name="all">
>  <ant antfile="buildfile.xml" target="build-all-test" output="vti-all.log">
>   <property resource="properties_files\vti-new.properties"/>
>  </ant>
>  </target>
> 
> The <antfile> that it's calling (buildfile.xml) contains this target:.
> 
>  <target name="build-all-test">
>   <echo>component name is ${component}</echo>
>  </target>
> 
> But the output of the above target build is simply:
> 
> build-all-test:
>      [echo] component name is ${component}
> 
> Why is the component property not getting passed to my antfile? I've also
> tried a properties file with the "component=vti" syntax and get the same
> result.
> 
> Thank you,
> Scott


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