Ant tasks for RubyTL

Note: Already integrated in AGE 0.3.4

Several ANT tasks has been defined to allow RubyTL to be integrated within an ANT tool chain. The .jar file can be downloaded here:

You can launch a single Rakefile creating a build.xml similar to this one:

<project name="TestTask" default="main" basedir=".">
  <target name="declare">
    <taskdef name="rubytl.configure" classname="gts.rubytl.launching.core.ant.ConfigureTask" loaderRef="rubytl" classpath="./lib/gts.rubytl.launching.core.jar"/>
    <taskdef name="rubytl.rakefile" classname="gts.rubytl.launching.core.ant.RakefileTask" loaderRef="rubytl" classpath="./lib/gts.rubytl.launching.core.jar"/>
  </target>

  <target name="main" depends="declare">
    <rubytl.rakefile ruby="ruby" rubytl="/home/jesus/usr/rubytl" >
        <raketask name="test"  />
        <project  path="../data"  />
	<rakefile path="test.rakefile" />		
    </rubytl.rakefile>
  </target>
</project>

or you can configure and invoke a "m2m" or "m2c" transformation directly within the build.xml.

<project name="MyProject" default="myDefaultTask">
  <target name="declare">
    <taskdef name="rubytl.m2m" loaderRef="rubytl" classpath="./lib/gts.rubytl.launching.core.jar"/>
    <taskdef name="rubytl.m2c" classname="gts.rubytl.launching.core.ant.M2CTask" loaderRef="rubytl" classpath="./lib/gts.rubytl.launching.core.jar"/>
    <taskdef name="rubytl.configure" classname="gts.rubytl.launching.core.ant.ConfigureTask" loaderRef="rubytl" classpath="./lib/gts.rubytl.launching.core.jar"/>
  </target>

  <rubytl.m2m name="someName" depends="declare, configure">
    <transformation path="${transformations}/myTransformation.rb" />
    <source>
       <model path="${myModel}" />
       <namespace name="Name" metamodel="${metamodels}/metamodel.ecore" />
    </source>
    <target model="${targetModel}" namespace="TargetName" metamodel="${metamodels}/targetMetamodel.ecore" />
  </rubytl.m2m>

  <target name="configure" depends="declare">
    <rubytl.configure name="default">
      <ruby   path="${rubyPath}" />
      <rubytl path="${rubytlPath}" />
    </rubytl.configure>
  </target>
  
</project>

Attachments