rhq-project/rhq — pull request #67 by metlos (2014-06-25 16:57:13+00:00)
Title: [BZ 873471] Token replacement takes into account <property> properties

The ant users are used to defining properties using the standard ant
`` task. We now recognize such properties when replacing
tokens in the bundle files.

To support `` format, the file in question has
to be defined as a bundle file using `rhq:file` or `rhq:url-file`. This
would make it deployed though, which might not be what the bundle
author wants, so a new attribute `deploy` has been added to all the
`rhq:file`, `rhq:archive`, `rhq:url-file` and `rhq:url-archive`, defaulting
to `true`, meaning whether to deploy the file/archive or not.

Also, the standard Ant `` task can now appear inside
`rhq:bundle` alongside the `rhq:input-property`.

An example deploy.xml might look like this:
```[xml]

```
The deployed.file mentioned above could contain the
`@@bundle.defined@@` token which would be replaced with "xxx". It could
also contain tokens with names of any properties defined in the
"in-bundle.properties" file that is supposed to be placed in the
bundle file alongside the deploy.xml.

----

This actually is a feature that was slated for some later RHQ version and I should have only estimated the work needed. Once I realized it would be fairly easy to do, I was halfway through implementing it, so I just finished it. Only took a day.

The detailed reqs are written down at https://issues.jboss.org/browse/PRODMGT-126.

Notable things about the implementation:

* abandoning the use of "user properties" of Ant project and just use the "properties" of it. This will make the standard properties defined by Ant, like "line.separator" available for further use.

* For reasons not entirely clear to me, we used to be very strict about what was available for token replacement. It used to be only rhq.deploy.dir and another, seemingly random(ish), bunch of rhq.* properties, the input properties defined in the recipe and finally the tags available on the bundle. I scrapped that and just include all the properties available to Ant (which includes all of the above + standard, Ant defined, things and, more importantly, the ``-ies found in the recipe).