ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30569] - basedir is not set correctly when calling subant task through ant task
Date Mon, 02 May 2005 21:46:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30569>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30569





------- Additional Comments From StefanHansel@web.de  2005-05-02 23:46 -------
Created an attachment (id=14913)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=14913&action=view)
Added workaround to TestCase

The workaround you found, doesn't work for me (at least when adapted 1:1 and
using run1).

Nevertheless it brought a good idea, so I got my example to work with exactly
the basedirs I want. 
The only drawback is, that the project-name has to equal the foldername of the
buildfile.

Added following to P1/build.xml:
-------------------------
	<target name="pre-message">
	   <ant target="message" dir="..\${ant.project.name}" />
	</target>
---------------------------

When subant in helper/helper.xml calls "pre-message" now, with that extra
indirection I get the basedirs I want to have: 
1) helper.xml runs in the basedir of the caller
2) all targets called by subant run in their own project basedir, thus enabling
a clean dependency-run:

--------
C:\temp\master>ant run1
Buildfile: build.xml

run1:

dependencies:
     [echo] subproject basedir=C:\temp\master

pre-message:

message:
     [echo] file=C:\temp\p1\build.xml
     [echo] mybasedir=C:\temp\p1

pre-message:

message:
     [echo] file=C:\temp\p2\build.xml
     [echo] mybasedir=C:\temp\p2
--------


The solution is a bit rubbish though, cause all build-files have to be at the
same hierarchy level (or pre-message has to know exactly with which wrong
basedir it is called ;-) ). 
At least p1/build.xml and p2/build.xml contain exactly the same code (apart
from the project-name), thus enabling me to <import> the targets from another
file, like in our original scripts.

Thanks for the good idea :-D

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message