ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cmanola...@yahoo.com>
Subject RE: Improt task and project basedir
Date Thu, 09 Jan 2003 21:19:16 GMT
Jose Alberto Fernandez wrote:

>> IMO:
>> - default = resolve based on the local basedir ( so all
>> existing build.xml
>> can be imported and will behave as expected )
>> - explicit override = an attribute to import that allows you
>> to override
>> the basedir.
>> 
> 
> What happens when I need things like xslt files to be found relative to
> the imported project, but I need other files of the actual build to
> be relative to the global build (like the builddir to use).

Pick one - and pass it as the basedir. Use explicit paths for the other.


> My point is that things are not that simple, it is not an all or nothing
> situation, you will have to be able to pick and choose because some files
> depend on the static layout of the project and other depend on the
> dynamic dependencies make by the imports.

It's not "all or nothing". Is choose a default that solves common use 
case and allow override for more advanced users.

If you look in jakarta ( or gump ), most build files depend on the 
layout of the project ( <javac src="src/share" ... /> ). If you would
import some of the existing buildfiles - most likely the default that
makes sense is relative to the imported files. 

Choosing a default is subjective - and it doesn't have a perfect 
answer. If you have other use cases that would justify a different default
behavior - we can discuss what's more frequent and what seems more usefull.


> 
>> In all projects that I know, the basedir is used to resolve
>> files relative
>> to the location of the build file - and I think the default
>> should reflect
>> that.
>> 
> 
> So why do we allow basedir to be changed using -Dbasedir=xxx
> or using <ant dir="xxx" file="somelocalfile"/>

For advanced behavior. 

> Or am I mistaken such functionality is there? How would that affect
> the behaviour of import? Things need to be consistent.

Consistency is nice where it makes sense. Should all tasks ignore
missing files like property ? 


> Following your line of thought, are you advocating for each task or target
> to actually remember from which buildfile it came from? Even if they are
> called using <antcall> from some other target coming from somewhere else?

Yes.

Most existing build files rely on paths relative to the build file.

Build files designed specifically for import ( providing some templates )
look like advanced features - and I think it's reasonable to ask
them to explicitely specify a basedir. 
Also changing the basedir is IMO an advanced use - and shouldn't be 
the default.



Costin


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


Mime
View raw message