Menu

#24 ant interface

open
nobody
None
5
2007-03-14
2007-03-14
No

Greetings!

In our project we have to generate some Java-Source-Files
from XML-Descriptions.
This was done until recently by using xslt.
The Stylsheets are a mess and so I replaced them with
fmpp.

The ant commands before were just:

<xslt force="true" basedir="${SRC_DIR}" destdir="${SRC_DIR}" style="${jgen_gen_extradataobject}">
<mapper type="glob" from="nads/pixelbox/p/*/attributes-extradata.xml" to="nads/pixelbox/p/*/PExtraDataObject.java"/>
</xslt>

As you see a stylesheet is applied to xml files which
produce Java Files.

Doing the same with fmpp I came to the following:

<fmpp sourceRoot="${SRC_DIR}" outputRoot="${SRC_DIR}" expert="true" quiet="true">
<include name="nads/pixelbox/p/*/attributes-extradata.xml"/>
<xmlRenderings><![CDATA[
{
ifDocumentElementIs: pixelboxx-object
template: nads/pixelbox/jgen/PExtraDataObjectBeanInfo.java.fmpp
}
]]></xmlRenderings>
<borders><![CDATA[
border("[#ftl][@pp.renameOutputFile name='PExtraDataObjectBeanInfo.java'/][#assign doc=pp.doc]", "", **/PExtraDataObjectBeanInfo.java.fmpp)
]]>
</borders>
<modes>
renderXml(**/*.xml)
ignore(**/*)
</modes>
</fmpp>

Any chance to get a simple mapper mode for fmpp?

Thanks,
Carsten

Discussion

  • Dániel Dékány

    Logged In: YES
    user_id=546667
    Originator: NO

    No chance, as FMPP has its own input and output file handling, as it was originally a standalone command-line tool (not an Ant task). So even if it could be useful to make it work with Ant, it would be a lot of work to make it work... sorry. (As of the possibility of any simplification, the whole "modes" element appears to be redundant in your case, at the first glance at least.)

    (It is feature request not a bug report, so I moved it over there.)

     
  • Dániel Dékány

    • labels: 580614 -->