ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject [Ant 1.6beta1] More feedback about import
Date Thu, 16 Oct 2003 14:23:39 GMT
Peter, and al,

I'd like <import> to have a new 'required' attribute that I could set to
false to simply ignore an imported build file not found. Before I get
flamed, here's the use case: rich and flexible user-configuration of the
build.

Currently, each project loads a properties file from
users/${user.name}/${ant.project.name}-build.properties. This allows to set
various properties of course, but only properties used by the build file are
useful. It's not easy to define paths, etc... Of course, such a
user-specific properties is optional, and Ant merrily ignores that fact.

I'd like to change this pattern so that now each project imports an optional
users/${user.name}/${ant.project.name}-build.xml file, which can thus
contain properties, but also any tasks or even additional targets specific
to a user (for example as a VIM user, a tasks that runs ctags on the
project).

With this pattern, and the new <presetdef>, a user can even configure task
attributes which have not been defaulted and used thru a property (something
I complained about, and that <presetdef> addresses quite nicely).

Lastly, but quite importantly for us with platform-specific issues related
to native code, such an imported user-specific XML file can use conditions
from Ant-Contrib to conditionally set properties, something one had to
resort to emulate thru loading this or that file, which was quite
cumbersome.

I truly hope the benefits that such a use case presents will be enough for
this minor additional to make it to Ant 1.6.

Thanks, --DD


C:\oss\org_apache\antx\import16>ant -version
Apache Ant version 1.6beta compiled on September 30 2003
C:\oss\org_apache\antx\import16>ant -f import-not-found.xml
Buildfile: import-not-found.xml

BUILD FAILED
C:\oss\org_apache\antx\import16\import-not-found.xml:5: Cannot find
does/not/exist.xml imported from
 C:\oss\org_apache\antx\import16\import-not-found.xml

Total time: 1 second
C:\oss\org_apache\antx\import16>type import-not-found.xml
<?xml version="1.0"?>

<project>

  <import file="does/not/exist.xml" />

</project>

C:\oss\org_apache\antx\import16>

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


Mime
View raw message