#17 ant fmpp task broken with multiple properties in data tag?

Ralf Hauser

We are doing:
<fmpp expert="true"
<data expandProperties="true">
tomcatHost: ${tomcatHost} +
lastGenerated: now({pattern:'EEE, MMM
d, yyyy HH:mm:ss z'}) +
antProps: antProperties()
</data> ...

and all works fine.
If we end with
<data expandProperties="true">
tomcatHost: ${tomcatHost} +
keystoreDir: ${keystoreDir} +
lastGenerated: now({pattern:'EEE, MMM
d, yyyy HH:mm:ss z'}) +
antProps: antProperties()

I am getting

Syntax error with the value of "data"
Caused by: fmpp.util.StringUtil$ParseException:
Expected +, but found: :

This only happens if the keystoreDir property in ant is
"location" - if it is value="myHome"
I guess the backslashes hit us here...

What would be a work-around?
Or could this be a reason to go 0.90 (we desperately
need to be able to pass more than one property even if
they are locations!)

In your answer, pls cc damian.egli@softborg.com - thx!


  • Ralf Hauser
    Ralf Hauser

    Logged In: YES

    if I put single or double quotes around the ${keystoreDir},
    I get

    Syntax error with the value of "data"
    Caused by: fmpp.util.StringUtil$ParseException: Invalid
    escape sequence (\d) in a string literal

    • priority: 5 --> 7
  • Logged In: YES

    As far as I understand the problem, the keystoreDir property
    stores a Windows path, that contains back-slahes... Now, the
    problem is that Ant knows nothing about FMPP and TDD, it just
    replaces all ${foo}-s... also FMPP/TDD knows nothing about
    Ant, it just get the text that *after* Ant's replacement. So
    the result is simply an invalid TDD text, as backslash is
    reserved in TDD for escaping. So its not really a bug, but
    a hotly missing feature...

    Solution? Nothing with 0.8.9... unless some really smart trick
    exits that I can't find out right now :). I will find out something
    for this soon and and do a new release (in 24 hours, I hope)...
    if this is urgent, I guess the solution will be a new data loader
    -- maybe even you can implement that, if you look into the
    source of antProperites data loader. I guess the solution will
    be something like:

    <data expandProperties="true">
    tomcatHost: ${tomcatHost} +
    keystoreDir: antPropery(keystoreDir) +

    so it will intelligently pull the value of the Ant property, rather
    than force use Ant's search-replace. Or even:

    <data expandProperties="true">
    antProperyes(keystoreDir, tomcatHost) +

    You see, just tell what properties do you want to expose...
    Maybe it will be available in the CVS in 4 hours. I will notice

    • assigned_to: nobody --> ddekany
  • Logged In: YES

    OK, now the CVS head contains the new antProperty data
    loader, and the enchanted antProperties data loader. Seems to
    me that this last suits best your needs:

    Instead of:

    tomcatHost: ${tomcatHost} +
    keystoreDir: ${keystoreDir} +

    you can simply write:

    antProperties(tomcatHost, keystoreDir) +

    and ir can't be confused by any extreme propery values.

    This will be released with FMPP 0.8.10 (perhaps tomorrow

  • Logged In: YES

    Except that the sf.net CVS seems to went for weekend
    holiday... the committed changes are simply not visible. I hope
    this malfunction will gone until Monday...

    OK I stop talking with myself... :)

  • Logged In: YES

    FMPP 0.8.10 is out with the new data loaders. Beware with the
    non-backward compatible changes... (see the version history)

    • status: open --> closed