Dominique Devienne wrote:
From: Steve Loughran [mailto:[EMAIL PROTECTED]

- a way of embedding files into <propertyset>, so you can do

file-based

loading from inside anything that takes a property file. Or some easy
way of going <propertyfile file="foo" required="true" /> into Java
tasks. I wrote my own element for this for the smartfrog tasks, and it
was v. useful. But being LGPL I can't paste it back in :(


I don't understand the use case you describe Steve.
Could you elaborate, maybe with a concrete example, for me to get it?


- <setproxy> to take a file of proxy settings; if file is absent do
nothing, if present read in the props (merging in ant properties) and
then set properties from there.


I think this could be deal with using property set.

yes, but what I want to do is make it trivial to do proxy setup; so trivial that all files do it. Alternatively



I'd like propertyset to stay as a property selector of sort, and not go into the realm of actually loading or defining properties. A propertyset should stay has a collections of patterns to select existing properties. These patterns can be explicit, with the actual property name to select, or more dynamic with startsWith/contains/regexp.

Now, if we added the ability on the property loading tasks to optionally
add any property they load/define to a new or existing propertyset, then
you get what you want (I think) while preserving the current nature of
<propertyset>. Or am I missing the point? (quite possible ;-) --DD


yes, <propertyset> is probably the wrong place. But tasks that take properties (java &c) ought to be able to be driven by a file of properties that don't contaminate ant's own property space, and which may or may not be optional. Here is how I use it in a custom task:


      <sf-startdaemon classpathref="run.classpath"
        logStackTraces="true" spawn="true">
          <!-- assertions are enabled -->
        <assertions enableSystemAssertions="true">
          <enable/>
        </assertions>
          <!-- load in a property file if it is present -->
        <propertyfile file="${runtime.properties}" optional="true"/>
      </sf-startdaemon>

so, if there is a file that is present it gets loaded, if not, then not. The optional flag lets us indicate that it is an error if it is missing.

-steve


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to