ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dino Valente <>
Subject Re: Problems with subbuild
Date Mon, 31 Jul 2000 19:31:54 GMT
At 07:47 AM 7/28/00 +0200, you wrote:
>> If I change file:../../build.template to file:./build.template then it
>> works. But of course, I am not able to run the build in the test directory
>> anymore.
>> How do I get around this (more importantly is this a bug to fix?).
>> dino
>I mentioned the same problem just 2 days ago. It depends on the task.
>As a workaround:
>    place
>        <property name=""projectTop" value=".."/>
>    in build.xml (project directory)
>    and
>        <property name="projectTop" value="../.." />
>    in build.xml in test directory
>    then you can access any file in the projectTop dir from within build.xml
>in test directory
>    with ${projectTop}/filename.
>This works since projectTop will not be overwritten when the test build.xml
>is called from the project build.xml

This approach is fine for rules within the ant rules. However, I'm using an
entity declaration and it doesn't take the variable value. However, this
approach is pretty good for other situations I have come across.

>hope this helps
>P.S. Perhaps the values of projectTop have to be changed, I didn't quite
>understand where your build.template file is placed.

The build.template is placed relative to all my project directories. I
include this template into each project's build file and set only one
property (name).

My goal is to achieve three things with ant:
	1) Place virtually all the build rules in a template file
	2) Reuse this file for all projects and be able to set a couple of
variables to determine targets
	3) Construct a main build file which compiles all subprojects. 
This is a snap with makefiles but I am finding it really difficult to
achieve the above with ant. Ant is great for simple one build files (this
what got me hooked; especially the javac task). I really wish these
problems get resolve soon (I have to make a decision within the week on
whether to use this tool for the whole company). 


View raw message