You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nilesh Sharma <sh...@gmail.com> on 2008/01/08 00:46:22 UTC
Problem with import using property file
Guys,
I am facing a l,ittle problem with the ant build. Here is the problem
description:
I am having three folders:
A
->B
-> C
folder A contains B and B contains C
A also contains:
base.properties
build-common.xml
build-common.xml calls buildA.properties inside and able to access all the
properties defined in property file
C contains:
buildC.xml
"buildC.xml" imports "build-common.xml" but I am not able to access the
properties defiend in the base.properties file.
*base.properties*
devenv.home=C:/dev
*build-common.xml*
<project name="build-common" default="Init" basedir=".">
<property file="${basedir}/build.properties" />
<property name="devenv.home" location="${devenv.home}" />
<echo message="${devenv.home}"/> *(this works fine)*
*buildC.xml*
<project name="buildC " default="dist">
<property name="root.dir" location="../.." />
<import file="${root.dir}/build-common.xml"/>
<echo message="${devenv.home}"/> *(Problem)*
Any Idea?
Thanks
Nilesh Sharma
Re: Problem with import using property file
Posted by Alain ROY <ar...@free.com>.
Like this it works ...
build-common.xml
----------------
<project name="build-common" default="init" basedir=".">
<property name="root.dir" location="${basedir}" />
<property file="${root.dir}/build.properties" />
<target name="init">
<echo message="${devenv.home}"/>
</target>
</project>
buildC.xml
----------
<project name="buildC" default="dist" basedir=".">
<property name="root.dir" location="../.." />
<import file="${root.dir}/build-common.xml"/>
<target name="dist">
<echo message="devenv.home = ${devenv.home}"/>
</target>
</project>
Regards
AR
On Mon, 7 Jan 2008 18:46:22 -0500
"Nilesh Sharma" <sh...@gmail.com> wrote:
> Guys,
>
> I am facing a l,ittle problem with the ant build. Here is the problem
> description:
> I am having three folders:
>
> A
>
> ->B
>
> -> C
>
> folder A contains B and B contains C
>
> A also contains:
>
> base.properties
>
> build-common.xml
>
> build-common.xml calls buildA.properties inside and able to access all the
> properties defined in property file
>
>
> C contains:
>
> buildC.xml
>
> "buildC.xml" imports "build-common.xml" but I am not able to access the
> properties defiend in the base.properties file.
>
> *base.properties*
>
> devenv.home=C:/dev
>
> *build-common.xml*
>
> <project name="build-common" default="Init" basedir=".">
>
> <property file="${basedir}/build.properties" />
>
> <property name="devenv.home" location="${devenv.home}" />
>
> <echo message="${devenv.home}"/> *(this works fine)*
>
> *buildC.xml*
>
> <project name="buildC " default="dist">
>
> <property name="root.dir" location="../.." />
>
> <import file="${root.dir}/build-common.xml"/>
>
> <echo message="${devenv.home}"/> *(Problem)*
> Any Idea?
>
> Thanks
>
>
> Nilesh Sharma
>
--
Alain ROY <ar...@free.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org