Bug 55154 - Allow new properties to be defined in <propertyset>
Summary: Allow new properties to be defined in <propertyset>
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.8.4
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2013-06-28 11:52 UTC by rich
Modified: 2014-01-06 15:13 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description rich 2013-06-28 11:52:38 UTC
I would like the ability to directly add properties to a <propertyset> without first having to define a property; e.g.,

   <property name="foo" value="1" />

I'm undecided whether that property should be a real property or if it should be defined only by the <propertyset>; perhaps this should be an option?  Or use <localproperty> to define a value local to the <propertyset>?

In addition to IMHO simplifying the direct definition of a <propertyset>, it becomes very useful with <augment>.  For example, in my builds I define an empty <properyset> to use during junit tests:

   <propertyset id="junit_syspropertyset" />

which is used during unit tests:

    <junit ...>
        <syspropertyset refid="junit_syspropertyset" />

This is defined in a reusable junit importable build script, so users need only <augment> the junit_syspropertyset to specify any system properties they might need.  However, to do this looks like:

    <property name="net.sourceforge.cobertura.datafile" location="${cobertura_coverage-file}" />
    <augment id="junit_syspropertyset">
        <propertyref name="net.sourceforge.cobertura.datafile" />

I'd prefer to be able to just do this:

    <augment id="junit_syspropertyset">
        <localproperty name="net.sourceforge.cobertura.datafile" location="${cobertura_coverage-file}" />
Comment 1 Stefan Bodewig 2014-01-06 15:13:37 UTC
I'd tend to only define them inside the propertyset.