GradleFx/GradleFx — pull request #71 by pmowrer (2013-01-10 03:10:33+00:00)
Title: Ability to provide a source for htmlTemplate task

This is an implementation for #67.

### Idea
It's the way I used to integrate my own templates when building using ANT. Usually, while developing in Flash Builder I'd end up modifying the template it generates (identical to the one generated by Flex's ANT tasks). Eventually, I'd veer off far from where it started off, but I'd still make use of the automatic token replacement (of type `${..}`) in the template that Flash Builder seamlessly provides. Flex's ANT task does the same token replacement but doesn't allow for the template to be modified.

To achieve the same effect with my own template, I used ANT's copy task in conjunction with token replacement via filterchain. This is essentially what I've added to the htmlWrapper task. It's useful to me, but might not be general enough or well thought through. Feel free to critique.

### Usage
Two new properties are added to the htmlWrapper task, `source` and `tokenReplacements`.

`source` is the path to an existing HTML-file that can be provided as a template instead of generating one using the Flex ANT tasks. If the property isn't provided, the template will be generated like it has before.

`tokenReplacements` is map of replacements for tokens in the provided `source` file. If the template contains the token `${swf}`, it'll be replaced with 'example' if this property contains a `[swf:example]` mapping. If `source` isn't specified, this property will be ignored.

Since the existing properties `title`, `percentHeight`, `percentWidth`, `application` and `swf` are used for token replacement in the ANT generated template, it made sense to make them double as token replacements for the `source` file also.