|
|
|
|
|
|
Re: Eugenia Epsilon [message #1099722 is a reply to message #1097998] |
Mon, 02 September 2013 05:40 |
Shivakumar goniwada Messages: 28 Registered: August 2013 |
Junior Member |
|
|
The Design Window means,
I would like to call following are as part of ANT script after epsilon build and before epsilon build
Before Epsilon build - I want to execute some pre-requisite java classes
After Epsilon build - I would like to run "gmfgen" as a Eclipse Application, so it opens new Eclipse based EMF editor.
I want to automate entire process with Ant Script
Call Pre-Reuisite Java class in Ant Buil--> Epsilon Ant Build --> gmfgen as a Eclipse Application in Ant Build
[Updated on: Mon, 02 September 2013 12:56] Report message to a moderator
|
|
|
|
|
|
Re: Eugenia Epsilon [message #1105106 is a reply to message #1105080] |
Mon, 09 September 2013 11:25 |
Shivakumar goniwada Messages: 28 Registered: August 2013 |
Junior Member |
|
|
Hi,
Thanks for response, I am using ANT script to run the emf design code
I am using following ANT script to generate this
In this I am getting the above error
<?xml version="1.0" encoding="UTF-8"?>
<project name="CobolEMFProject" default="default">
<description>
<![CDATA[
This Ant buildfile attempts to mimic the basic Eugenia workflow
included in the documentation. It consists of: generating the
ECore model from the Emfatic source file, generating the .genmodel
file, customizing it with the global and user-defined EOL scripts,
generating the EMF code, deriving the GMF models from the ECore
file, deriving the GMFGen model from these, customizing it, and
finally generating the source code from it.
It depends on the es.uca.modeling.ant and ca.ecliptical.gmf.ant
plugins to do its work. The Ecliptical update site is at [1].
Currently, there's one known issue: the edit and editor projects,
when created from scratch, do not have the required Java and PDE
natures assigned to them. For the first nature, see [2]. For the
second, right-click on the project and use "Configure > Convert
to Plugin Projects...". Another option is generating the projects
the first time through the GUI, and then "Refactor > Move" them
to the locations in the *Project.location properties. Nevertheless,
this bug might be fixed by EMF 2.6 [3].
[1]: http://www.eclipticalsoftware.com/updates/site.xml
[2]: http://enarion.net/programming/tools/eclipse/changing-genera l-project-to-java-project/
[3]: http://www.eclipse.org/forums/index.php?t=msg&th=152228
]]>
</description>
<!-- PROPERTIES ####################################################### -->
<!-- Basic project info -->
<property name="project.name" value="CobolEMFProject" />
<property name="model.dir" value="model" />
<property name="model.basename" value="cobolEMF" />
<property name="templates.dir" value="templates"/>
<property name="templates.gmfgraph.dir" value="templates-gmfgraph"/>
<!-- File locations -->
<property name="copyright.location" value="${model.dir}/copyright.txt" />
<property name="emfatic.location" value="${model.dir}/${model.basename}.emf" />
<property name="ecore.location" value="${model.dir}/${model.basename}.ecore" />
<property name="genmodel.location" value="${model.dir}/${model.basename}.genmodel" />
<property name="gmfgen.location" value="${model.dir}/${model.basename}.gmfgen" />
<property name="gmfgraph.location" value="${model.dir}/${model.basename}.gmfgraph" />
<property name="gmfmap.location" value="${model.dir}/${model.basename}.gmfmap" />
<property name="gmftool.location" value="${model.dir}/${model.basename}.gmftool" />
<!-- EPackage URIs -->
<property name="ecore.nsuri" value="http://www.eclipse.org/emf/2002/Ecore" />
<property name="genmodel.nsuri" value="http://www.eclipse.org/emf/2002/GenModel" />
<property name="gmfgraph.nsuri" value="http://www.eclipse.org/gmf/2006/GraphicalDefinition" />
<property name="gmftool.nsuri" value="http://www.eclipse.org/gmf/2005/ToolDefinition" />
<property name="gmfmap.nsuri" value="http://www.eclipse.org/gmf/2008/mappings" />
<property name="gmfgen.nsuri" value="http://www.eclipse.org/gmf/2009/GenModel" />
<!-- Epsilon URLs -->
<property name="epsilon.ecore2gmf.uri" value="platform:/plugin/org.eclipse.epsilon.eugenia/transformations/ECore2GMF.eol" />
<property name="epsilon.fixgenmodel.uri" value="platform:/plugin/org.eclipse.epsilon.eugenia/transformations/FixGenModel.eol" />
<property name="epsilon.fixgengmf.uri" value="platform:/plugin/org.eclipse.epsilon.eugenia/transformations/FixGMFGen.eol" />
<property name="epsilon.ecore2gmf.local" value="${model.dir}/ECore2GMF.eol" />
<property name="epsilon.fixgenmodel.local" value="${model.dir}/FixGenModel.eol" />
<property name="epsilon.fixgmfgen.local" value="${model.dir}/FixGMFGen.eol" />
<available property="epsilon.ecore2gmf.local.exists" file="${epsilon.ecore2gmf.local}" />
<available property="epsilon.fixgenmodel.local.exists" file="${epsilon.fixgenmodel.local}" />
<available property="epsilon.fixgmfgen.local.exists" file="${epsilon.fixgmfgen.local}" />
<!--
Copyright text: try loading the copyright text. If it doesn't exist,
use the empty string.
-->
<loadfile srcFile="${copyright.location}" property="copyright.contents" quiet="true" />
<property name="copyright.contents" value="" />
<!-- MAIN BODY ######################################################## -->
<target name="init">
<tstamp />
</target>
<target name="refreshEmfatic" if="eclipse.application">
<echo>Refreshing the project directory under Eclipse</echo>
<eclipse.refreshLocal resource="/${project.name}" depth="infinite"/>
</target>
<!--Generating ecore model -->
<target name="generateECore" depends="refreshEmfatic">
<echo>Generating ${ecore.location} file from Emfatic source ${emfatic.location}</echo>
<epsilon.eugenia src="${emfatic.location}"></epsilon.eugenia>
</target>
<target name="registerECore" depends="generateECore">
<echo>Registering ${ecore.location} file permanently</echo>
<epsilon.emf.register file="${ecore.location}" permanently="true"/>
</target>
<target name="generateGenModel" depends="registerECore">
<echo>Generating initial ${genmodel.location} file</echo>
<emf.Ecore2Java model="${ecore.location}" genmodel="${genmodel.location}" modelproject="${modelProject.location}" modelProjectFragmentPath="src" modelPluginID="${project.name}" generateJavaCode="false" validateModel="true">
<arg line="-editProject ${editProject.location} src" />
<arg line="-editorProject ${editorProject.location} src" />
<arg line="-testsProject ${testsProject.location} src" />
</emf.Ecore2Java>
</target>
<target name="defaultFixGenModel" depends="generateGenModel">
<echo>Fixing ${genmodel.location} (default EOL script) </echo>
<epsilon.emf.loadModel name="ECore" modelFile="${ecore.location}" metamodeluri="${ecore.nsuri}" read="true" store="false" />
<epsilon.emf.loadModel name="GenModel" modelFile="${genmodel.location}" metamodeluri="${genmodel.nsuri}" read="true" store="true" />
<epsilon.eol uri="${epsilon.fixgenmodel.uri}">
<parameter name="copyright" value="${copyright.contents}" />
<model ref="ECore" as="ECore" />
<model ref="GenModel" as="GenModel" />
</epsilon.eol>
</target>
<target name="customFixGenModel" depends="defaultFixGenModel" if="epsilon.fixgenmodel.local.exists">
<echo>Fixing ${genmodel.location} (user-defined EOL script)</echo>
<epsilon.eol src="${epsilon.fixgenmodel.local}">
<parameter name="copyright" value="${copyright.contents}" />
<model ref="ECore" as="ECore" />
<model ref="GenModel" as="GenModel" />
</epsilon.eol>
</target>
<target name="saveGenModel" depends="customFixGenModel">
<epsilon.disposeModel model="GenModel" />
</target>
<target name="generateEMFCode" depends="customFixGenModel">
<echo>Generating EMF edit and editor code</echo>
<emf.Ecore2Java model="${ecore.location}" genmodel="${genmodel.location}" reconcileGenModel="keep" modelproject="${modelProject.location}" modelProjectFragmentPath="src" modelPluginID="${project.name}" jdkLevel="5.0" validateModel="true" autoBuild="true">
<arg line="-editProject ${editProject.location} src" />
<arg line="-editorProject ${editorProject.location} src" />
<arg line="-testsProject ${testsProject.location} src" />
</emf.Ecore2Java>
</target>
<target name="generateGMFFiles" depends="generateEMFCode">
<echo>Generating GMF models</echo>
<epsilon.emf.loadModel name="GmfGraph" modelFile="${gmfgraph.location}" metamodeluri="${gmfgraph.nsuri}" read="false" store="true" />
<epsilon.emf.loadModel name="GmfTool" modelFile="${gmftool.location}" metamodeluri="${gmftool.nsuri}" read="false" store="true" />
<epsilon.emf.loadModel name="GmfMap" modelFile="${gmfmap.location}" metamodeluri="${gmfmap.nsuri}" read="false" store="true" />
<epsilon.eol uri="${epsilon.ecore2gmf.uri}">
<model ref="ECore" as="ECore" />
<model ref="GmfGraph" as="GmfGraph" />
<model ref="GmfTool" as="GmfTool" />
<model ref="GmfMap" as="GmfMap" />
</epsilon.eol>
</target>
<target name="customFixGMFFiles" depends="generateGMFFiles" if="epsilon.ecore2gmf.local.exists">
<echo>Customizing GMF models</echo>
<epsilon.eol src="${epsilon.ecore2gmf.local}">
<model ref="ECore" as="ECore" />
<model ref="GmfGraph" as="GmfGraph" />
<model ref="GmfTool" as="GmfTool" />
<model ref="GmfMap" as="GmfMap" />
</epsilon.eol>
</target>
<target name="saveGMFFiles" depends="customFixGMFFiles">
<epsilon.disposeModel model="GmfGraph" />
<epsilon.disposeModel model="GmfTool" />
<epsilon.disposeModel model="GmfMap" />
</target>
<target name="generateGMFGenModel" depends="saveGMFFiles">
<echo>Generating and synchronizing GMFGen model ${gmfgen.location} from GMFMap model</echo>
<gmfgen.fromGmfmap projectName="${project.name}" destFile="${gmfgen.location}" genModel="${genmodel.location}" mapModel="${gmfmap.location}" templatesDir="${templates.gmfgraph.dir}"/>
<epsilon.emf.loadModel name="GmfGen" modelFile="${gmfgen.location}" metamodeluri="${gmfgen.nsuri}" read="true" store="true" />
<epsilon.eol uri="${epsilon.fixgengmf.uri}">
<parameter name="copyright" value="${copyright.contents}" />
<model ref="ECore" as="ECore" />
<model ref="GmfGen" as="GmfGen" />
</epsilon.eol>
</target>
<target name="customFixGMFGenModel" depends="generateGMFGenModel" if="epsilon.fixgmfgen.local.exists">
<echo>Customizing GMFGen model ${gmfgen.location}</echo>
<epsilon.eol src="${epsilon.fixgmfgen.local}">
<parameter name="copyright" value="${copyright.contents}" />
<model ref="ECore" as="ECore" />
<model ref="GmfGen" as="GmfGen" />
</epsilon.eol>
</target>
<target name="saveGMFGenModel" depends="customFixGMFGenModel">
<epsilon.disposeModel model="GmfGen"/>
</target>
<target name="generateDiagramCode" depends="saveGMFGenModel"
xmlns:gmf="http://ecliptical.ca/gmf/ant">
<echo>Generating diagram project in ${diagramProject.location}</echo>
<gmf:GenerateDiagramCode gmfgenpath="${project.name}/${gmfgen.location}"/>
</target>
<!-- Default target -->
<target name="default" depends="generateDiagramCode"/>
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${modelProject.location}" includes="src/**/*"/>
<fileset dir="${modelProject.location}" includes="bin/**/*"/>
<fileset dir="${modelProject.location}" includes="${genmodel.location}"/>
<fileset dir="${modelProject.location}" includes="${gmfmap.location}"/>
<fileset dir="${modelProject.location}" includes="${gmftool.location}"/>
<fileset dir="${modelProject.location}" includes="${gmfgraph.location}"/>
<fileset dir="${modelProject.location}" includes="${gmfgen.location}"/>
<fileset dir="${modelProject.location}" includes="${ecore.location}"/>
<fileset dir="${modelProject.location}" includes="${emfatic.location}"/>
<fileset dir="${editProject.location}" includes="src/**/*"/>
<fileset dir="${editProject.location}" includes="bin/**/*"/>
<fileset dir="${editorProject.location}" includes="src/**/*"/>
<fileset dir="${editorProject.location}" includes="bin/**/*"/>
<fileset dir="${testsProject.location}" includes="src/**/*"/>
<fileset dir="${testsProject.location}" includes="bin/**/*"/>
<fileset dir="${diagramProject.location}" includes="src/**/*"/>
<fileset dir="${diagramProject.location}" includes="bin/**/*"/>
</delete>
</target>
</project>
|
|
|
Re: Eugenia Epsilon [message #1105120 is a reply to message #1105106] |
Mon, 09 September 2013 11:50 |
|
Thanks. Could you please elaborate a bit on why you need to duplicate the behaviour of the <epsilon.eugenia> task instead of building on top of it? Regarding the error you're receiving ("failed to create task or type gmfgen.fromGmfmap"), it indicates that for some reason ANT cannot find the task in question (which I suspect is coming from the eclipticalsoftware update site). Could you please try to fix this problem first and then give it another go?
Cheers,
Dimitris
|
|
|
|
Re: Eugenia Epsilon [message #1105139 is a reply to message #1105133] |
Mon, 09 September 2013 12:19 |
|
I wasn't even aware of eclipticalsoftware until you mentioned their website in your previous message so I'm afraid I can't be of much assistance here.
Cheers,
Dimitris
|
|
|
|
|
|
Re: Eugenia Epsilon [message #1105155 is a reply to message #1105151] |
Mon, 09 September 2013 12:38 |
|
I suspect that you're receiving this error because no "genmodel" model has been loaded in your workflow using one of <epsilon.loadModel> or <epsilon.emf.loadModel> tasks...
Cheers,
Dimitris
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Eugenia Epsilon [message #1122291 is a reply to message #1116441] |
Tue, 01 October 2013 12:07 |
Shivakumar goniwada Messages: 28 Registered: August 2013 |
Junior Member |
|
|
Hi Dimitris,
Instead of plugin, I would like to call this from Application (Swing events from button),
Is it possible to give some steps on how to invoke and pass *.emf file.
You will most probably need to subclass GenerateAllDelegate, override its getDelegates() method and add a new delegate that implements the additional functionality. You should then create a new objectContribution in your plugin.xml (see [1] for examples) that will enable you to invoke your delegate on the currently selected .emf file.
[Updated on: Tue, 01 October 2013 12:30] Report message to a moderator
|
|
|
Re: Eugenia Epsilon [message #1124511 is a reply to message #1122291] |
Thu, 03 October 2013 16:03 |
|
Running the complete Eugenia workflow (.emf -> generated code) from a standalone Swing application would be really hard as Eugenia invokes GMF tooling which is deeply integrated with Eclipse.
Cheers,
Dimitris
|
|
|