[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.amalgam] Re: Invoking xpand template options in 1.0M7

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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            
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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            
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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            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/templates/
,platform:/plugin/org.eclipse.amalgam.releng.builder/transformations/"
            outfile="${basedir}/out/build/${product}/promote.xml"/>
    </target>
</project> 


On 6/5/09 11:22 AM, in article h0bd7o$41p$1@xxxxxxxxxxxxxxxxx, "Bill Hinge"
<steve.orobec@xxxxxxxxxxxxxxx> 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