Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Amalgam » Invoking xpand template options in 1.0M7
Invoking xpand template options in 1.0M7 [message #525166] Fri, 05 June 2009 15:22 Go to next message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Hi

I'm a little confused on what my options are in invoking xpand
templates in this build using the OCL/QVTO version of Xpand.

Following a post from Alex in the GMF newsgroup I've had a look
at org.eclipse.gmf.codegen.util.Generator.

What I'm looking for is a way in my dsl project plugin/rcp to right
click on a saved model file and generate 'code text' from a specific
template(s).

In order to do this, do I need a workflow of some kind or must I
manually code this all in java as part of some action? (any examples?)

regards
Steve
Re: Invoking xpand template options in 1.0M7 [message #525167 is a reply to message #525166] Fri, 05 June 2009 15:29 Go to previous messageGo to next message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
You'll need an Ant script (easiest way). Here is an example of a QVTO
invocation, followed by several template invocations, as used in the Amalgam
build process:

<?xml version="1.0" encoding="UTF-8"?>
<project name="amalgam" default="main"
xmlns:zzz="eclipse.org/gmf/2008/xpand">

<tstamp/>
<property name="product" value="dsltk"/> <!-- default is dsltk -->

<target name="main">
<qvto.interpretedTransformation

transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
mations/processbuild.qvto">
<targeturidef
targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
<targeturidef
targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
<targeturidef
targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
<targeturidef
targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
<configurationproperty name="date" value="${DSTAMP}"/>
<configurationproperty name="time" value="${TSTAMP}"/>
</qvto.interpretedTransformation>

<mkdir dir="${basedir}/out/build/${product}/builder"/>

<zzz:template name="build2properties::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "

outfile="${basedir}/out/build/${product}/builder/build.properties "/>
<zzz:template name="build2customTargets::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "

outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
<zzz:template name="build2script::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/build.xml"/>
<zzz:template name="build2site::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/site.xml"/>
<zzz:template name="build2page::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/index.php"/>
<zzz:template name="build2promote::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/promote.xml"/>
</target>
</project>


On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
<steve.orobec@btopenworld.com> wrote:

> Hi
>
> I'm a little confused on what my options are in invoking xpand
> templates in this build using the OCL/QVTO version of Xpand.
>
> Following a post from Alex in the GMF newsgroup I've had a look
> at org.eclipse.gmf.codegen.util.Generator.
>
> What I'm looking for is a way in my dsl project plugin/rcp to right
> click on a saved model file and generate 'code text' from a specific
> template(s).
>
> In order to do this, do I need a workflow of some kind or must I
> manually code this all in java as part of some action? (any examples?)
>
> regards
> Steve
>

--
Thanks,
Rich
Re: Invoking xpand template options in 1.0M7 [message #525168 is a reply to message #525167] Fri, 05 June 2009 15:44 Go to previous messageGo to next message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Thanks Rich for quick response


I'll post back to let you know how I got on

regards
Steve


Richard Gronback wrote:
> You'll need an Ant script (easiest way). Here is an example of a QVTO
> invocation, followed by several template invocations, as used in the Amalgam
> build process:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="amalgam" default="main"
> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>
> <tstamp/>
> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>
> <target name="main">
> <qvto.interpretedTransformation
>
> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
> mations/processbuild.qvto">
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
> <configurationproperty name="date" value="${DSTAMP}"/>
> <configurationproperty name="time" value="${TSTAMP}"/>
> </qvto.interpretedTransformation>
>
> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>
> <zzz:template name="build2properties::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
> <zzz:template name="build2customTargets::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
> <zzz:template name="build2script::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/build.xml"/>
> <zzz:template name="build2site::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/site.xml"/>
> <zzz:template name="build2page::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/index.php"/>
> <zzz:template name="build2promote::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/promote.xml"/>
> </target>
> </project>
>
>
> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
> <steve.orobec@btopenworld.com> wrote:
>
>> Hi
>>
>> I'm a little confused on what my options are in invoking xpand
>> templates in this build using the OCL/QVTO version of Xpand.
>>
>> Following a post from Alex in the GMF newsgroup I've had a look
>> at org.eclipse.gmf.codegen.util.Generator.
>>
>> What I'm looking for is a way in my dsl project plugin/rcp to right
>> click on a saved model file and generate 'code text' from a specific
>> template(s).
>>
>> In order to do this, do I need a workflow of some kind or must I
>> manually code this all in java as part of some action? (any examples?)
>>
>> regards
>> Steve
>>
>
Re: Invoking xpand template options in 1.0M7 [message #525179 is a reply to message #525167] Thu, 25 June 2009 13:49 Go to previous messageGo to next message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Hi Rich

After a bit of fiddling about with other things I've come back to try
this. I've created my UI as described in the book and referencing the
amalgam examples.

Wrt to the ant script, am I correct in assuming that an ant script
replaces the mwe script? Hence if I create my action class to run the
script I just replace the file extension mwe by ant etc?


Secondly , when I run my UI Xpand action against a saved model file I
get the following error.

IOException: Unable to resolve plug-in
"platform/plugin/..../templates/demo.ant"

I checked and the ant file does live in the plugins directory at
..../templates/demo.ant. I'm presumably not setting some path somewhere
but not sure where I should do this (I have exported all my UI dirs in
plugin.xml and checked the templates directory in build)




regards
Steve


Richard Gronback wrote:
> You'll need an Ant script (easiest way). Here is an example of a QVTO
> invocation, followed by several template invocations, as used in the Amalgam
> build process:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="amalgam" default="main"
> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>
> <tstamp/>
> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>
> <target name="main">
> <qvto.interpretedTransformation
>
> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
> mations/processbuild.qvto">
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
> <configurationproperty name="date" value="${DSTAMP}"/>
> <configurationproperty name="time" value="${TSTAMP}"/>
> </qvto.interpretedTransformation>
>
> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>
> <zzz:template name="build2properties::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
> <zzz:template name="build2customTargets::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
> <zzz:template name="build2script::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/build.xml"/>
> <zzz:template name="build2site::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/site.xml"/>
> <zzz:template name="build2page::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/index.php"/>
> <zzz:template name="build2promote::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/promote.xml"/>
> </target>
> </project>
>
>
> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
> <steve.orobec@btopenworld.com> wrote:
>
>> Hi
>>
>> I'm a little confused on what my options are in invoking xpand
>> templates in this build using the OCL/QVTO version of Xpand.
>>
>> Following a post from Alex in the GMF newsgroup I've had a look
>> at org.eclipse.gmf.codegen.util.Generator.
>>
>> What I'm looking for is a way in my dsl project plugin/rcp to right
>> click on a saved model file and generate 'code text' from a specific
>> template(s).
>>
>> In order to do this, do I need a workflow of some kind or must I
>> manually code this all in java as part of some action? (any examples?)
>>
>> regards
>> Steve
>>
>
Re: Invoking xpand template options in 1.0M7 [message #525180 is a reply to message #525179] Thu, 25 June 2009 14:00 Go to previous messageGo to next message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
If you're going to invoke an Ant script programmatically using an action,
you should look into the AntRunner API provided by the platform. Or, stick
to using launch invocation UI. Just be sure to run using the workbench JVM,
and not a new one, in order to have easy access to all the ant libs.

You can also look into the GMF codebase to see how Xpand is invoked
programmatically from our UI contributions for running the code generator.

Best,
Rich


On 6/25/09 9:49 AM, in article 4A438066.1070005@btopenworld.com, "Bill
Hinge" <steve.orobec@btopenworld.com> wrote:

> Hi Rich
>
> After a bit of fiddling about with other things I've come back to try
> this. I've created my UI as described in the book and referencing the
> amalgam examples.
>
> Wrt to the ant script, am I correct in assuming that an ant script
> replaces the mwe script? Hence if I create my action class to run the
> script I just replace the file extension mwe by ant etc?
>
>
> Secondly , when I run my UI Xpand action against a saved model file I
> get the following error.
>
> IOException: Unable to resolve plug-in
> "platform/plugin/..../templates/demo.ant"
>
> I checked and the ant file does live in the plugins directory at
> .../templates/demo.ant. I'm presumably not setting some path somewhere
>
> but not sure where I should do this (I have exported all my UI dirs in
> plugin.xml and checked the templates directory in build)
>
>
>
>
> regards
> Steve
>
>
> Richard Gronback wrote:
>> You'll need an Ant script (easiest way). Here is an example of a QVTO
>> invocation, followed by several template invocations, as used in the Amalgam
>> build process:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project name="amalgam" default="main"
>> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>>
>> <tstamp/>
>> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>>
>> <target name="main">
>> <qvto.interpretedTransformation
>>
>> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
>> mations/processbuild.qvto">
>> <targeturidef
>> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
>> <targeturidef
>> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
>> <targeturidef
>> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
>> <targeturidef
>> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
>> <configurationproperty name="date" value="${DSTAMP}"/>
>> <configurationproperty name="time" value="${TSTAMP}"/>
>> </qvto.interpretedTransformation>
>>
>> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>>
>> <zzz:template name="build2properties::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>
>> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
>> <zzz:template name="build2customTargets::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>
>> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
>> <zzz:template name="build2script::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/build.xml"/>
>> <zzz:template name="build2site::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/site.xml"/>
>> <zzz:template name="build2page::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/index.php"/>
>> <zzz:template name="build2promote::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/promote.xml"/>
>> </target>
>> </project>
>>
>>
>> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
>> <steve.orobec@btopenworld.com> wrote:
>>
>>> Hi
>>>
>>> I'm a little confused on what my options are in invoking xpand
>>> templates in this build using the OCL/QVTO version of Xpand.
>>>
>>> Following a post from Alex in the GMF newsgroup I've had a look
>>> at org.eclipse.gmf.codegen.util.Generator.
>>>
>>> What I'm looking for is a way in my dsl project plugin/rcp to right
>>> click on a saved model file and generate 'code text' from a specific
>>> template(s).
>>>
>>> In order to do this, do I need a workflow of some kind or must I
>>> manually code this all in java as part of some action? (any examples?)
>>>
>>> regards
>>> Steve
>>>
>>

--
Thanks,
Rich
Re: Invoking xpand template options in 1.0M7 [message #525181 is a reply to message #525180] Thu, 25 June 2009 14:20 Go to previous message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Thanks Rich

getting there slowly but surely

steve

Richard Gronback wrote:
> If you're going to invoke an Ant script programmatically using an action,
> you should look into the AntRunner API provided by the platform. Or, stick
> to using launch invocation UI. Just be sure to run using the workbench JVM,
> and not a new one, in order to have easy access to all the ant libs.
>
> You can also look into the GMF codebase to see how Xpand is invoked
> programmatically from our UI contributions for running the code generator.
>
> Best,
> Rich
>
>
> On 6/25/09 9:49 AM, in article 4A438066.1070005@btopenworld.com, "Bill
> Hinge" <steve.orobec@btopenworld.com> wrote:
>
>> Hi Rich
>>
>> After a bit of fiddling about with other things I've come back to try
>> this. I've created my UI as described in the book and referencing the
>> amalgam examples.
>>
>> Wrt to the ant script, am I correct in assuming that an ant script
>> replaces the mwe script? Hence if I create my action class to run the
>> script I just replace the file extension mwe by ant etc?
>>
>>
>> Secondly , when I run my UI Xpand action against a saved model file I
>> get the following error.
>>
>> IOException: Unable to resolve plug-in
>> "platform/plugin/..../templates/demo.ant"
>>
>> I checked and the ant file does live in the plugins directory at
>> .../templates/demo.ant. I'm presumably not setting some path somewhere
>>
>> but not sure where I should do this (I have exported all my UI dirs in
>> plugin.xml and checked the templates directory in build)
>>
>>
>>
>>
>> regards
>> Steve
>>
>>
>> Richard Gronback wrote:
>>> You'll need an Ant script (easiest way). Here is an example of a QVTO
>>> invocation, followed by several template invocations, as used in the Amalgam
>>> build process:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project name="amalgam" default="main"
>>> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>>>
>>> <tstamp/>
>>> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>>>
>>> <target name="main">
>>> <qvto.interpretedTransformation
>>>
>>> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
>>> mations/processbuild.qvto">
>>> <targeturidef
>>> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
>>> <configurationproperty name="date" value="${DSTAMP}"/>
>>> <configurationproperty name="time" value="${TSTAMP}"/>
>>> </qvto.interpretedTransformation>
>>>
>>> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>>>
>>> <zzz:template name="build2properties::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>>
>>> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
>>> <zzz:template name="build2customTargets::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>>
>>> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
>>> <zzz:template name="build2script::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/build.xml"/>
>>> <zzz:template name="build2site::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/site.xml"/>
>>> <zzz:template name="build2page::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/index.php"/>
>>> <zzz:template name="build2promote::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/promote.xml"/>
>>> </target>
>>> </project>
>>>
>>>
>>> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
>>> <steve.orobec@btopenworld.com> wrote:
>>>
>>>> Hi
>>>>
>>>> I'm a little confused on what my options are in invoking xpand
>>>> templates in this build using the OCL/QVTO version of Xpand.
>>>>
>>>> Following a post from Alex in the GMF newsgroup I've had a look
>>>> at org.eclipse.gmf.codegen.util.Generator.
>>>>
>>>> What I'm looking for is a way in my dsl project plugin/rcp to right
>>>> click on a saved model file and generate 'code text' from a specific
>>>> template(s).
>>>>
>>>> In order to do this, do I need a workflow of some kind or must I
>>>> manually code this all in java as part of some action? (any examples?)
>>>>
>>>> regards
>>>> Steve
>>>>
>
Re: Invoking xpand template options in 1.0M7 [message #574581 is a reply to message #525166] Fri, 05 June 2009 15:29 Go to previous message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
You'll need an Ant script (easiest way). Here is an example of a QVTO
invocation, followed by several template invocations, as used in the Amalgam
build process:

<?xml version="1.0" encoding="UTF-8"?>
<project name="amalgam" default="main"
xmlns:zzz="eclipse.org/gmf/2008/xpand">

<tstamp/>
<property name="product" value="dsltk"/> <!-- default is dsltk -->

<target name="main">
<qvto.interpretedTransformation

transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
mations/processbuild.qvto">
<targeturidef
targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
<targeturidef
targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
<targeturidef
targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
<targeturidef
targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
<configurationproperty name="date" value="${DSTAMP}"/>
<configurationproperty name="time" value="${TSTAMP}"/>
</qvto.interpretedTransformation>

<mkdir dir="${basedir}/out/build/${product}/builder"/>

<zzz:template name="build2properties::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "

outfile="${basedir}/out/build/${product}/builder/build.properties "/>
<zzz:template name="build2customTargets::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "

outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
<zzz:template name="build2script::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/build.xml"/>
<zzz:template name="build2site::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/site.xml"/>
<zzz:template name="build2page::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/index.php"/>
<zzz:template name="build2promote::Main"

inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "

templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
outfile="${basedir}/out/build/${product}/promote.xml"/>
</target>
</project>


On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
<steve.orobec@btopenworld.com> wrote:

> Hi
>
> I'm a little confused on what my options are in invoking xpand
> templates in this build using the OCL/QVTO version of Xpand.
>
> Following a post from Alex in the GMF newsgroup I've had a look
> at org.eclipse.gmf.codegen.util.Generator.
>
> What I'm looking for is a way in my dsl project plugin/rcp to right
> click on a saved model file and generate 'code text' from a specific
> template(s).
>
> In order to do this, do I need a workflow of some kind or must I
> manually code this all in java as part of some action? (any examples?)
>
> regards
> Steve
>

--
Thanks,
Rich
Re: Invoking xpand template options in 1.0M7 [message #574598 is a reply to message #525167] Fri, 05 June 2009 15:44 Go to previous message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Thanks Rich for quick response


I'll post back to let you know how I got on

regards
Steve


Richard Gronback wrote:
> You'll need an Ant script (easiest way). Here is an example of a QVTO
> invocation, followed by several template invocations, as used in the Amalgam
> build process:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="amalgam" default="main"
> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>
> <tstamp/>
> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>
> <target name="main">
> <qvto.interpretedTransformation
>
> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
> mations/processbuild.qvto">
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
> <configurationproperty name="date" value="${DSTAMP}"/>
> <configurationproperty name="time" value="${TSTAMP}"/>
> </qvto.interpretedTransformation>
>
> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>
> <zzz:template name="build2properties::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
> <zzz:template name="build2customTargets::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
> <zzz:template name="build2script::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/build.xml"/>
> <zzz:template name="build2site::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/site.xml"/>
> <zzz:template name="build2page::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/index.php"/>
> <zzz:template name="build2promote::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/promote.xml"/>
> </target>
> </project>
>
>
> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
> <steve.orobec@btopenworld.com> wrote:
>
>> Hi
>>
>> I'm a little confused on what my options are in invoking xpand
>> templates in this build using the OCL/QVTO version of Xpand.
>>
>> Following a post from Alex in the GMF newsgroup I've had a look
>> at org.eclipse.gmf.codegen.util.Generator.
>>
>> What I'm looking for is a way in my dsl project plugin/rcp to right
>> click on a saved model file and generate 'code text' from a specific
>> template(s).
>>
>> In order to do this, do I need a workflow of some kind or must I
>> manually code this all in java as part of some action? (any examples?)
>>
>> regards
>> Steve
>>
>
Re: Invoking xpand template options in 1.0M7 [message #577183 is a reply to message #525167] Thu, 25 June 2009 13:49 Go to previous message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Hi Rich

After a bit of fiddling about with other things I've come back to try
this. I've created my UI as described in the book and referencing the
amalgam examples.

Wrt to the ant script, am I correct in assuming that an ant script
replaces the mwe script? Hence if I create my action class to run the
script I just replace the file extension mwe by ant etc?


Secondly , when I run my UI Xpand action against a saved model file I
get the following error.

IOException: Unable to resolve plug-in
"platform/plugin/..../templates/demo.ant"

I checked and the ant file does live in the plugins directory at
..../templates/demo.ant. I'm presumably not setting some path somewhere
but not sure where I should do this (I have exported all my UI dirs in
plugin.xml and checked the templates directory in build)




regards
Steve


Richard Gronback wrote:
> You'll need an Ant script (easiest way). Here is an example of a QVTO
> invocation, followed by several template invocations, as used in the Amalgam
> build process:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="amalgam" default="main"
> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>
> <tstamp/>
> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>
> <target name="main">
> <qvto.interpretedTransformation
>
> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
> mations/processbuild.qvto">
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
> <targeturidef
> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
> <configurationproperty name="date" value="${DSTAMP}"/>
> <configurationproperty name="time" value="${TSTAMP}"/>
> </qvto.interpretedTransformation>
>
> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>
> <zzz:template name="build2properties::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
> <zzz:template name="build2customTargets::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>
> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
> <zzz:template name="build2script::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/build.xml"/>
> <zzz:template name="build2site::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/site.xml"/>
> <zzz:template name="build2page::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/index.php"/>
> <zzz:template name="build2promote::Main"
>
> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>
> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
> outfile="${basedir}/out/build/${product}/promote.xml"/>
> </target>
> </project>
>
>
> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
> <steve.orobec@btopenworld.com> wrote:
>
>> Hi
>>
>> I'm a little confused on what my options are in invoking xpand
>> templates in this build using the OCL/QVTO version of Xpand.
>>
>> Following a post from Alex in the GMF newsgroup I've had a look
>> at org.eclipse.gmf.codegen.util.Generator.
>>
>> What I'm looking for is a way in my dsl project plugin/rcp to right
>> click on a saved model file and generate 'code text' from a specific
>> template(s).
>>
>> In order to do this, do I need a workflow of some kind or must I
>> manually code this all in java as part of some action? (any examples?)
>>
>> regards
>> Steve
>>
>
Re: Invoking xpand template options in 1.0M7 [message #577193 is a reply to message #525179] Thu, 25 June 2009 14:00 Go to previous message
Richard Gronback is currently offline Richard GronbackFriend
Messages: 605
Registered: July 2009
Senior Member
If you're going to invoke an Ant script programmatically using an action,
you should look into the AntRunner API provided by the platform. Or, stick
to using launch invocation UI. Just be sure to run using the workbench JVM,
and not a new one, in order to have easy access to all the ant libs.

You can also look into the GMF codebase to see how Xpand is invoked
programmatically from our UI contributions for running the code generator.

Best,
Rich


On 6/25/09 9:49 AM, in article 4A438066.1070005@btopenworld.com, "Bill
Hinge" <steve.orobec@btopenworld.com> wrote:

> Hi Rich
>
> After a bit of fiddling about with other things I've come back to try
> this. I've created my UI as described in the book and referencing the
> amalgam examples.
>
> Wrt to the ant script, am I correct in assuming that an ant script
> replaces the mwe script? Hence if I create my action class to run the
> script I just replace the file extension mwe by ant etc?
>
>
> Secondly , when I run my UI Xpand action against a saved model file I
> get the following error.
>
> IOException: Unable to resolve plug-in
> "platform/plugin/..../templates/demo.ant"
>
> I checked and the ant file does live in the plugins directory at
> .../templates/demo.ant. I'm presumably not setting some path somewhere
>
> but not sure where I should do this (I have exported all my UI dirs in
> plugin.xml and checked the templates directory in build)
>
>
>
>
> regards
> Steve
>
>
> Richard Gronback wrote:
>> You'll need an Ant script (easiest way). Here is an example of a QVTO
>> invocation, followed by several template invocations, as used in the Amalgam
>> build process:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project name="amalgam" default="main"
>> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>>
>> <tstamp/>
>> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>>
>> <target name="main">
>> <qvto.interpretedTransformation
>>
>> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
>> mations/processbuild.qvto">
>> <targeturidef
>> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
>> <targeturidef
>> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
>> <targeturidef
>> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
>> <targeturidef
>> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
>> <configurationproperty name="date" value="${DSTAMP}"/>
>> <configurationproperty name="time" value="${TSTAMP}"/>
>> </qvto.interpretedTransformation>
>>
>> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>>
>> <zzz:template name="build2properties::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>
>> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
>> <zzz:template name="build2customTargets::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>
>> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
>> <zzz:template name="build2script::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/build.xml"/>
>> <zzz:template name="build2site::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/site.xml"/>
>> <zzz:template name="build2page::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/index.php"/>
>> <zzz:template name="build2promote::Main"
>>
>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>
>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>> outfile="${basedir}/out/build/${product}/promote.xml"/>
>> </target>
>> </project>
>>
>>
>> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
>> <steve.orobec@btopenworld.com> wrote:
>>
>>> Hi
>>>
>>> I'm a little confused on what my options are in invoking xpand
>>> templates in this build using the OCL/QVTO version of Xpand.
>>>
>>> Following a post from Alex in the GMF newsgroup I've had a look
>>> at org.eclipse.gmf.codegen.util.Generator.
>>>
>>> What I'm looking for is a way in my dsl project plugin/rcp to right
>>> click on a saved model file and generate 'code text' from a specific
>>> template(s).
>>>
>>> In order to do this, do I need a workflow of some kind or must I
>>> manually code this all in java as part of some action? (any examples?)
>>>
>>> regards
>>> Steve
>>>
>>

--
Thanks,
Rich
Re: Invoking xpand template options in 1.0M7 [message #577218 is a reply to message #525180] Thu, 25 June 2009 14:20 Go to previous message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Thanks Rich

getting there slowly but surely

steve

Richard Gronback wrote:
> If you're going to invoke an Ant script programmatically using an action,
> you should look into the AntRunner API provided by the platform. Or, stick
> to using launch invocation UI. Just be sure to run using the workbench JVM,
> and not a new one, in order to have easy access to all the ant libs.
>
> You can also look into the GMF codebase to see how Xpand is invoked
> programmatically from our UI contributions for running the code generator.
>
> Best,
> Rich
>
>
> On 6/25/09 9:49 AM, in article 4A438066.1070005@btopenworld.com, "Bill
> Hinge" <steve.orobec@btopenworld.com> wrote:
>
>> Hi Rich
>>
>> After a bit of fiddling about with other things I've come back to try
>> this. I've created my UI as described in the book and referencing the
>> amalgam examples.
>>
>> Wrt to the ant script, am I correct in assuming that an ant script
>> replaces the mwe script? Hence if I create my action class to run the
>> script I just replace the file extension mwe by ant etc?
>>
>>
>> Secondly , when I run my UI Xpand action against a saved model file I
>> get the following error.
>>
>> IOException: Unable to resolve plug-in
>> "platform/plugin/..../templates/demo.ant"
>>
>> I checked and the ant file does live in the plugins directory at
>> .../templates/demo.ant. I'm presumably not setting some path somewhere
>>
>> but not sure where I should do this (I have exported all my UI dirs in
>> plugin.xml and checked the templates directory in build)
>>
>>
>>
>>
>> regards
>> Steve
>>
>>
>> Richard Gronback wrote:
>>> You'll need an Ant script (easiest way). Here is an example of a QVTO
>>> invocation, followed by several template invocations, as used in the Amalgam
>>> build process:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project name="amalgam" default="main"
>>> xmlns:zzz="eclipse.org/gmf/2008/xpand">
>>>
>>> <tstamp/>
>>> <property name="product" value="dsltk"/> <!-- default is dsltk -->
>>>
>>> <target name="main">
>>> <qvto.interpretedTransformation
>>>
>>> transformation=" platform:/plugin/org.eclipse.amalgam.releng.builder/transfor
>>> mations/processbuild.qvto">
>>> <targeturidef
>>> targeturi="file:/${basedir}/builder/${product}/${product}.product "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/builder/${product}/${product}.build "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/out/build/${product}/${product}.product "/>
>>> <targeturidef
>>> targeturi="file:/${basedir}/out/build/${product}/${product}.build "/>
>>> <configurationproperty name="date" value="${DSTAMP}"/>
>>> <configurationproperty name="time" value="${TSTAMP}"/>
>>> </qvto.interpretedTransformation>
>>>
>>> <mkdir dir="${basedir}/out/build/${product}/builder"/>
>>>
>>> <zzz:template name="build2properties::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>>
>>> outfile="${basedir}/out/build/${product}/builder/build.properties "/>
>>> <zzz:template name="build2customTargets::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>>
>>> outfile="${basedir}/out/build/${product}/builder/customTargets.xml "/>
>>> <zzz:template name="build2script::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/build.xml"/>
>>> <zzz:template name="build2site::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/site.xml"/>
>>> <zzz:template name="build2page::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/index.php"/>
>>> <zzz:template name="build2promote::Main"
>>>
>>> inputURI="file:/${basedir}/out/build/${product}/${product}.build#/ "
>>>
>>> templateroot=" platform:/plugin/org.eclipse.amalgam.releng.builder/template s/
>>> ,platform:/plugin/org.eclipse.amalgam.releng.builder/transfo rmations/ "
>>> outfile="${basedir}/out/build/${product}/promote.xml"/>
>>> </target>
>>> </project>
>>>
>>>
>>> On 6/5/09 11:22 AM, in article h0bd7o$41p$1@build.eclipse.org, "Bill Hinge"
>>> <steve.orobec@btopenworld.com> wrote:
>>>
>>>> Hi
>>>>
>>>> I'm a little confused on what my options are in invoking xpand
>>>> templates in this build using the OCL/QVTO version of Xpand.
>>>>
>>>> Following a post from Alex in the GMF newsgroup I've had a look
>>>> at org.eclipse.gmf.codegen.util.Generator.
>>>>
>>>> What I'm looking for is a way in my dsl project plugin/rcp to right
>>>> click on a saved model file and generate 'code text' from a specific
>>>> template(s).
>>>>
>>>> In order to do this, do I need a workflow of some kind or must I
>>>> manually code this all in java as part of some action? (any examples?)
>>>>
>>>> regards
>>>> Steve
>>>>
>
Previous Topic:Questions about linked EMF & GMF Editors
Next Topic:Amalgam Galileo 1.0 FR
Goto Forum:
  


Current Time: Fri Apr 19 01:37:18 GMT 2024

Powered by FUDForum. Page generated in 0.02405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top