> -----Ursprüngliche Nachricht-----
> Von: Stefan Bodewig [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 10. Januar 2008 06:10
> An: [email protected]
> Betreff: Re: ProjectHelper : parsing from InputStream
>
> "Benjamin de Dardel" <[EMAIL PROTECTED]> writes:
>
> > 1: Should I copy and rewrite ProjectHelperImpl for my personal use
> > ?
>
> You can do that, if you want to 8-)
>
> > Or is there another way
>
> No, there isn't. See below.
>
> > 2: Do you need my contribution for refactoring helpers to accept
> > multiple sources ?
>
> We've started discussing this more than once but never came to a
> solution that ended up in svn. If you want to help us not dropping
> the ball, you are welcome.
>
> The problem is a bit more complex than just allowing a different
> source. The main problem are build files that do not specify a
> basedir attribute on the project tag since Ant then uses the directory
> holding the build file to resolve relative file references - which
> certainly doesn't work if it doesn't have a File reference pointing to
> the input.
Could the API require specifying the basedir?
/**
* Parses the given buildfile.
* @param is InputStream providing the content of the buildfile
* @param basedir The (absolute) basedir for use in the project
* if the parsed buildfile doesnt specify an absolute
* path.
*/
parse(InputStream is, File basedir);
is(<project>) + basedir="C:/temp" --> c:/temp
is(<project basedir=".") + basedir="C:/temp" --> c:/temp
is(<project basedir="/") + basedir="C:/temp" --> C:/
is(<project basedir="D:">) + basedir="C:/temp" --> D:
is(<project basedir="D:">) + basedir=null --> D:
is(<project basedir=".">) + basedir=null --> exception
is(<project basedir="/">) + basedir=null -->
on windows: root directory of the system drive
on unix : root directory '/'
is(<project>) + basedir=null --> exception
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]