Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [AM3] Compile atl file using Ant
[AM3] Compile atl file using Ant [message #378462] Wed, 11 July 2007 14:12 Go to next message
Bas Graaf is currently offline Bas GraafFriend
Messages: 9
Registered: July 2009
Junior Member
Hi All,

Is it possible to compile an atl transformation from within an Ant
script? I want to use this to generate an atl transformation using a
higher-order transformation and apply it to some source models from a
single Ant script.

Kind regards,
Bas.


--
____________________________________________________________ ________

Bas Graaf
PhD Researcher

Delft University of Technology
Faculty of Electrical Engineering, Mathematics, and Computer Science
Department of Software Technology

Mekelweg 4
2628 CD Delft
The Netherlands

P.O. Box 5031
2600 GA Delft
The Netherlands

T: +31 (15) 2782467
F: +31 (15) 2786632
E: b.s.graaf@tudelft.nl
W: http://www.st.ewi.tudelft.nl/~basgraaf
Re: [AM3] Compile atl file using Ant [message #378469 is a reply to message #378462] Thu, 12 July 2007 09:34 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hi Bas,

First, you need to generate the ATL model that conforms to the ATL metamodel using your
higher-order transformation.
Then, you can extract the ATL model into the ATL file.

Once you have extracted the file in an ATL project, the transformation compiles automatically.

I copied below an example of how to extract the ATL model.

<project name="ATL Extractor" default="extract">
<target name="extract">
<property name="context" value="/YourFolder/"/>
<property name="source" value="${context}yourATLModel.ecore"/>
<property name="target" value="${context}yourATLModel.atl"/>

<am3.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
nsuri="http://www.eclipse.org/gmt/2005/ATL" />
<am3.loadModel modelHandler="EMF" name="IN" metamodel="ATL" path="${source}" />

<am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF" path="${context}TCS.ecore" />
<am3.loadModel modelHandler="EMF" name="ATL.tcs" metamodel="TCS"
path="${context}ATL-0.2-TCS.ecore">

</am3.loadModel>
<am3.saveModel model="IN" path="${target}">
<extractor name="ebnf">
<param name="format" value="ATL.tcs"/>
</extractor>
</am3.saveModel>
</target>
</project>

The TCS.ecore and ATL-0.2-TCS.ecore files are available in the AM3 component:
( http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/AM3 /org.eclipse.am3.core/resources/?root=Technology_Project)

After that, you can call the compiled transformation using the am3.atl task as any other
ATL transformation.
However, the compilation process takes some time, so it is possible that you call the
am3.atl task before the transformation is compiled.


Regards,

Marcos.


Bas Graaf wrote:
> Hi All,
>
> Is it possible to compile an atl transformation from within an Ant
> script? I want to use this to generate an atl transformation using a
> higher-order transformation and apply it to some source models from a
> single Ant script.
>
> Kind regards,
> Bas.
>
>
Re: [AM3] Compile atl file using Ant [message #378471 is a reply to message #378469] Thu, 12 July 2007 13:05 Go to previous message
Bas Graaf is currently offline Bas GraafFriend
Messages: 9
Registered: July 2009
Junior Member
Hi Marcos,

Thanks for your reply. My problem was in fact that the extracted ATL
file was not compiled fast enough. Now I solved the problem using a
waitfor task:

<waitfor maxwait="30" maxwaitunit="second">
<available file="${target}.asm"/>
</waitfor>

Kind regards,
Bas.




Marcos Didonet Del Fabro wrote:
> Hi Bas,
>
> First, you need to generate the ATL model that conforms to the ATL
> metamodel using your higher-order transformation.
> Then, you can extract the ATL model into the ATL file.
>
> Once you have extracted the file in an ATL project, the transformation
> compiles automatically.
>
> I copied below an example of how to extract the ATL model.
>
> <project name="ATL Extractor" default="extract">
> <target name="extract">
> <property name="context" value="/YourFolder/"/>
> <property name="source" value="${context}yourATLModel.ecore"/>
> <property name="target" value="${context}yourATLModel.atl"/>
>
> <am3.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
> nsuri="http://www.eclipse.org/gmt/2005/ATL" />
> <am3.loadModel modelHandler="EMF" name="IN" metamodel="ATL"
> path="${source}" />
>
> <am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF"
> path="${context}TCS.ecore" />
> <am3.loadModel modelHandler="EMF" name="ATL.tcs" metamodel="TCS"
> path="${context}ATL-0.2-TCS.ecore">
>
> </am3.loadModel>
> <am3.saveModel model="IN" path="${target}">
> <extractor name="ebnf">
> <param name="format" value="ATL.tcs"/>
> </extractor>
> </am3.saveModel>
> </target>
> </project>
>
> The TCS.ecore and ATL-0.2-TCS.ecore files are available in the AM3
> component:
> ( http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/AM3 /org.eclipse.am3.core/resources/?root=Technology_Project)
>
>
> After that, you can call the compiled transformation using the am3.atl
> task as any other ATL transformation.
> However, the compilation process takes some time, so it is possible that
> you call the am3.atl task before the transformation is compiled.
>
>
> Regards,
>
> Marcos.
>
>
> Bas Graaf wrote:
>> Hi All,
>>
>> Is it possible to compile an atl transformation from within an Ant
>> script? I want to use this to generate an atl transformation using a
>> higher-order transformation and apply it to some source models from a
>> single Ant script.
>>
>> Kind regards,
>> Bas.
>>
>>
Re: [AM3] Compile atl file using Ant [message #602290 is a reply to message #378462] Thu, 12 July 2007 09:34 Go to previous message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del FabroFriend
Messages: 84
Registered: July 2009
Member
Hi Bas,

First, you need to generate the ATL model that conforms to the ATL metamodel using your
higher-order transformation.
Then, you can extract the ATL model into the ATL file.

Once you have extracted the file in an ATL project, the transformation compiles automatically.

I copied below an example of how to extract the ATL model.

<project name="ATL Extractor" default="extract">
<target name="extract">
<property name="context" value="/YourFolder/"/>
<property name="source" value="${context}yourATLModel.ecore"/>
<property name="target" value="${context}yourATLModel.atl"/>

<am3.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
nsuri="http://www.eclipse.org/gmt/2005/ATL" />
<am3.loadModel modelHandler="EMF" name="IN" metamodel="ATL" path="${source}" />

<am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF" path="${context}TCS.ecore" />
<am3.loadModel modelHandler="EMF" name="ATL.tcs" metamodel="TCS"
path="${context}ATL-0.2-TCS.ecore">

</am3.loadModel>
<am3.saveModel model="IN" path="${target}">
<extractor name="ebnf">
<param name="format" value="ATL.tcs"/>
</extractor>
</am3.saveModel>
</target>
</project>

The TCS.ecore and ATL-0.2-TCS.ecore files are available in the AM3 component:
( http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/AM3 /org.eclipse.am3.core/resources/?root=Technology_Project)

After that, you can call the compiled transformation using the am3.atl task as any other
ATL transformation.
However, the compilation process takes some time, so it is possible that you call the
am3.atl task before the transformation is compiled.


Regards,

Marcos.


Bas Graaf wrote:
> Hi All,
>
> Is it possible to compile an atl transformation from within an Ant
> script? I want to use this to generate an atl transformation using a
> higher-order transformation and apply it to some source models from a
> single Ant script.
>
> Kind regards,
> Bas.
>
>
Re: [AM3] Compile atl file using Ant [message #602295 is a reply to message #378469] Thu, 12 July 2007 13:05 Go to previous message
Bas Graaf is currently offline Bas GraafFriend
Messages: 9
Registered: July 2009
Junior Member
Hi Marcos,

Thanks for your reply. My problem was in fact that the extracted ATL
file was not compiled fast enough. Now I solved the problem using a
waitfor task:

<waitfor maxwait="30" maxwaitunit="second">
<available file="${target}.asm"/>
</waitfor>

Kind regards,
Bas.




Marcos Didonet Del Fabro wrote:
> Hi Bas,
>
> First, you need to generate the ATL model that conforms to the ATL
> metamodel using your higher-order transformation.
> Then, you can extract the ATL model into the ATL file.
>
> Once you have extracted the file in an ATL project, the transformation
> compiles automatically.
>
> I copied below an example of how to extract the ATL model.
>
> <project name="ATL Extractor" default="extract">
> <target name="extract">
> <property name="context" value="/YourFolder/"/>
> <property name="source" value="${context}yourATLModel.ecore"/>
> <property name="target" value="${context}yourATLModel.atl"/>
>
> <am3.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
> nsuri="http://www.eclipse.org/gmt/2005/ATL" />
> <am3.loadModel modelHandler="EMF" name="IN" metamodel="ATL"
> path="${source}" />
>
> <am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF"
> path="${context}TCS.ecore" />
> <am3.loadModel modelHandler="EMF" name="ATL.tcs" metamodel="TCS"
> path="${context}ATL-0.2-TCS.ecore">
>
> </am3.loadModel>
> <am3.saveModel model="IN" path="${target}">
> <extractor name="ebnf">
> <param name="format" value="ATL.tcs"/>
> </extractor>
> </am3.saveModel>
> </target>
> </project>
>
> The TCS.ecore and ATL-0.2-TCS.ecore files are available in the AM3
> component:
> ( http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/AM3 /org.eclipse.am3.core/resources/?root=Technology_Project)
>
>
> After that, you can call the compiled transformation using the am3.atl
> task as any other ATL transformation.
> However, the compilation process takes some time, so it is possible that
> you call the am3.atl task before the transformation is compiled.
>
>
> Regards,
>
> Marcos.
>
>
> Bas Graaf wrote:
>> Hi All,
>>
>> Is it possible to compile an atl transformation from within an Ant
>> script? I want to use this to generate an atl transformation using a
>> higher-order transformation and apply it to some source models from a
>> single Ant script.
>>
>> Kind regards,
>> Bas.
>>
>>
Previous Topic:[TCS] Getting model from text
Next Topic:[AM3] Exception on startup
Goto Forum:
  


Current Time: Thu Dec 18 07:31:17 GMT 2014

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

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