ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: ProjectHelper : parsing from InputStream
Date Thu, 10 Jan 2008 06:05:03 GMT
> -----Urspr√ľngliche Nachricht-----
> Von: Stefan Bodewig [mailto:bodewig@apache.org] 
> Gesendet: Donnerstag, 10. Januar 2008 06:10
> An: dev@ant.apache.org
> Betreff: Re: ProjectHelper : parsing from InputStream
> 
> "Benjamin de Dardel" <benjamin.dedardel@gmail.com> 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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message