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

closed
None
7
2003-07-03
2003-06-27
Ralf Hauser
No

We are doing:
<fmpp expert="true"
sourcefile="${ftl_dir}/server.xmf"
outputfile="${tomcat.home.temp}/conf/server.xml"
logfile="${ftl_log_file}"
modes="execute(**/*.xmf),ignore(**/*)"
skipUnchanged="none"
quiet="true"
replaceextension="xmf,xml"
>
<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()
</data>

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!

Discussion

  • Ralf Hauser

    Ralf Hauser - 2003-06-27

    Logged In: YES
    user_id=266141

    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

     
  • Dániel Dékány

    • priority: 5 --> 7
     
  • Dániel Dékány

    Logged In: YES
    user_id=546667

    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
    you.

     
  • Dániel Dékány

    • assigned_to: nobody --> ddekany
     
  • Dániel Dékány

    Logged In: YES
    user_id=546667

    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
    night).

     
  • Dániel Dékány

    Logged In: YES
    user_id=546667

    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... :)

     
  • Dániel Dékány

    Logged In: YES
    user_id=546667

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

     
  • Dániel Dékány

    • status: open --> closed