Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Eugenia Epsilon (ANT Task)
Eugenia Epsilon [message #1094975] Mon, 26 August 2013 09:19 Go to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Dear Team,

I am generating design editor using Epsilon, I did design, compilation manually, I would like to automate same using ANT script. Epsilon web provided some info but does not have full info on ANT script, please share anyone who worked on the same.

Regards
Re: Eugenia Epsilon [message #1095715 is a reply to message #1094975] Tue, 27 August 2013 08:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

Does this help?

http://eclipse.org/epsilon/doc/articles/eugenia-ant/

Cheers,
Dimitris
Re: Eugenia Epsilon [message #1097773 is a reply to message #1095715] Fri, 30 August 2013 02:33 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks,

I follow the URL but I am getting following error

build.xml:36: Problem: failed to create task or type epsilon.eugenia
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

I included Apache ant-contrib-1.0b3 but still I am getting this error
Re: Eugenia Epsilon [message #1097799 is a reply to message #1097773] Fri, 30 August 2013 03:02 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

You'll need to select the "Run in the same JRE as the workspace" option under the JRE tab of your launch configuration [1].

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/workflow/
Re: Eugenia Epsilon [message #1097903 is a reply to message #1097799] Fri, 30 August 2013 06:07 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks for you help, It works for me.

After this code generation, and i need to launch a design window (may be in eclipse) automatically after code generation, is there anyway i can do it

Re: Eugenia Epsilon [message #1097998 is a reply to message #1097903] Fri, 30 August 2013 08:56 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Could you please clarify what you mean by "a design window"?

Cheers,
Dimitris
Re: Eugenia Epsilon [message #1099722 is a reply to message #1097998] Mon, 02 September 2013 01:40 Go to previous messageGo to next message
Shivakumar goniwada is currently offline 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 08:56]

Report message to a moderator

Re: Eugenia Epsilon [message #1100042 is a reply to message #1099722] Mon, 02 September 2013 11:19 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

You can execute java code using the "java" ANT task [1]. I'm not aware of an ANT task that would enable you to launch a new Eclipse application so you may need to roll out your own.

Cheers,
Dimitris

[1] http://ant.apache.org/manual/Tasks/java.html
[2] http://ant.apache.org/manual/develop.html
Re: Eugenia Epsilon [message #1104971 is a reply to message #1100042] Mon, 09 September 2013 03:02 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Hi Dimitris,

Thanks for your previous help

I am getting following error

failed to create task or type gmfgen.fromGmfmap

plugin/org.eclipse.epsilon.eugenia/transformations/FixGenModel.eol


Please help me out here

[Updated on: Mon, 09 September 2013 04:50]

Report message to a moderator

Re: Eugenia Epsilon [message #1105080 is a reply to message #1104971] Mon, 09 September 2013 06:35 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

I'll probably need a bit more information than that (e.g a minimal example that I can use to reproduce this error [1]) before I can provide a more helpful response.

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Eugenia Epsilon [message #1105106 is a reply to message #1105080] Mon, 09 September 2013 07:25 Go to previous messageGo to next message
Shivakumar goniwada is currently offline 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 07:50 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
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 #1105133 is a reply to message #1105120] Mon, 09 September 2013 08:10 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks for info,

eclipticalsoftware update site - is not available, it throws error to fix. is there any other update site available
Re: Eugenia Epsilon [message #1105139 is a reply to message #1105133] Mon, 09 September 2013 08:19 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
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 #1105142 is a reply to message #1105139] Mon, 09 September 2013 08:22 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Ohk, I got it from here

http://www.eclipse.org/forums/index.php?t=msg&th=158862/
Re: Eugenia Epsilon [message #1105146 is a reply to message #1105142] Mon, 09 September 2013 08:27 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
I believe that this is an earlier version of work that was eventually consolidated in the <epsilon.eugenia> task [1] so it's obsolete now.

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/eugenia-ant/
Re: Eugenia Epsilon [message #1105151 is a reply to message #1105146] Mon, 09 September 2013 08:34 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
ok, thanks

Thanks for info, I am changing the script,

during this time, I am getting this frequent error

I have a genemodel generated into the model directory,

Any pointer to me to resolve this

Model 'genmodel' not found



<!-- It save gen model -->
<target name="saveGenModel" depends="generateGenModel">
<epsilon.disposeModel model="genmodel" />
</target>
Re: Eugenia Epsilon [message #1105155 is a reply to message #1105151] Mon, 09 September 2013 08:38 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
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 #1105685 is a reply to message #1105155] Tue, 10 September 2013 02:55 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks,

Again I am struck with some issue

\build.xml:174: Type 'GmfTool!ToolRegistry' not found (platform:/plugin/org.eclipse.epsilon.eugenia/transformations/ECore2GMF.eol@8:32)
Can you give a pointer to this

sorry for bother you

(As i said earlier, I have a emafatic code which i need to automate generation)

[Updated on: Tue, 10 September 2013 03:10]

Report message to a moderator

Re: Eugenia Epsilon [message #1105736 is a reply to message #1105685] Tue, 10 September 2013 04:06 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 303
Registered: January 2010
Senior Member
Hi Shivakumar,

I would suggest switching to our new <epsilon.eugenia> task: it is *much* easier to use than my old hackish script Smile. Can you post your Ant buildfile over here so we can have a look at it?

Best regards,
Antonio

[Updated on: Tue, 10 September 2013 04:07]

Report message to a moderator

Re: Eugenia Epsilon [message #1109989 is a reply to message #1105736] Mon, 16 September 2013 04:02 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks for help,

It works for me,

Now I am facing another problem, I want to create a plug-in out of it, when i run a menu command to run build.xml, I am getting this error

"Problem: failed to create task or type epsilon.eugenia"

Is there any pointer how I can run my plugin with "Run in the same as JRE in the workspace"

I am launching new workspace for plugin.
Re: Eugenia Epsilon [message #1109993 is a reply to message #1109989] Mon, 16 September 2013 04:08 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

On the 3rd screen of [1] you should select the "Run in the same as JRE in the workspace" option.

Cheers,
Dimitris

[1] http://www.codejava.net/ides/eclipse/how-to-change-jre-for-ant-in-eclipse
Re: Eugenia Epsilon [message #1110064 is a reply to message #1109993] Mon, 16 September 2013 06:04 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Hi,

Thanks for quick reply, This solns works fine when i execute ant's build.xml script in the workspace.

I am planning to do Plug-in the whole automation process by calling build.xml in the Java class which inturn is a command in plug-in.

When i run as Meta-Inf of ecliplse plug-in, it starts new eclipse window with the command in Menu tool bar.
When i run this menu, it calls teh Java class which inturn calls the build.xml, it executes other part of the build but when it comes to the eugenia , throws build.xml:112: Problem: failed to create task or type epsilon.eugenia"
Any Idea on how to fix JRE issue

"<target name="generateCode">
<!-- Generate myfile.ecore from myfile.emf and then proceed -->
<epsilon.eugenia src="${emfatic.location}"/>

<!-- Start directly from the Ecore model -->
<epsilon.eugenia src="${ecore.location}"/>

<!-- Skips the clean, ecore and genmodel steps -->
<epsilon.eugenia src="${ecore.location}" firstStep="gmf"/>

<!-- Does not run the emfcode and gmfcode steps -->
<epsilon.eugenia src="${emfatic.location}" lastStep="gmfgen"/>

<!-- Only runs the gmf and gmfgen steps -->
<epsilon.eugenia src="${ecore.location}" firstStep="gmf" lastStep="gmfgen"/>

</target>
"
Re: Eugenia Epsilon [message #1110204 is a reply to message #1110064] Mon, 16 September 2013 10:35 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 303
Registered: January 2010
Senior Member
Hi Shivakmuar,

Using Eclipse Ant tasks from Java is actually quite complicated, as I can attest from my time developing EUnit Smile.

Do you simply want to rebuild the graphical editor every time you modify it in Eclipse? In that case, you can just add an "Ant Builder" that runs the build.xml files for you whenever the project is built. That's what I usually do.

Here's a tutorial on how to use Ant Builders in Eclipse:

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-92_project_builders.htm

By the way, you can simplify your target quite a bit. Here:

<target name="generateCode">
  <!-- Generate myfile.ecore from myfile.emf and then proceed -->
  <epsilon.eugenia src="${emfatic.location}"/>
</target>


Best regards,
Antonio
Re: Eugenia Epsilon [message #1110256 is a reply to message #1110204] Mon, 16 September 2013 12:13 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi Shivakmuar,

Another option may be to invoke Eugenia using/borrowing from the GenerateAllDelegate class [1].

Cheers,
Dimitris

[1] http://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/plugins/org.eclipse.epsilon.eugenia/src/org/eclipse/epsilon/eugenia/GenerateAllDelegate.java
Re: Eugenia Epsilon [message #1110629 is a reply to message #1110256] Tue, 17 September 2013 01:53 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks Dimitris and Antonio

I want to create a Ecliplse Plug-in which includes following

1) I have program (Apache's File Util) which writes dynamically to the emfatic code
2)And build gen model, gmgraph etc based om emfatic code

Both above are present in the same build.xml (compilation and building)

What I am doing is create a plugin coomand (extension) in eclipse which need to call this build.xml file, so use of this build.xml can just invoke eclipse menu command to run this.

Greatful if you provide pointer to this

Re: Eugenia Epsilon [message #1110769 is a reply to message #1110629] Tue, 17 September 2013 06:01 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
I tried to execute Ant by calling Java, but I am getting this following error

Problem: failed to create task or type epsilon.eugenia

This is due to "Run in the same JRE as the Workspace" , works fine when I execute Ant build file directly, but fails when I call from Java.

Any Idea how to set "Run in the same JRE as the Workspace" from Java
Re: Eugenia Epsilon [message #1111018 is a reply to message #1110769] Tue, 17 September 2013 12:55 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

I'm not sure I understand how your last question is different to http://www.eclipse.org/forums/index.php/mv/msg/512479/1110064/#msg_1110064. Have you tried the solution suggested in http://www.eclipse.org/forums/index.php/mv/msg/512479/1110256/#msg_1110256?

Cheers,
Dimitris
Re: Eugenia Epsilon [message #1111515 is a reply to message #1111018] Wed, 18 September 2013 06:19 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
I tried the option of autobuild, that works fine,

(It was running fine when i run build.xml directly with set JRE as "Run in the same JRE as the workspace"
but when i try to invoke build.xml file from java (below code), it throws following error in eclipse
"build.xml:116: Problem: failed to create task or type epsilon.eugenia"

The Java code as below

File buildFile = new File("build.xml");
Project p = new Project();
p.setUserProperty("ant.file", buildFile.getAbsolutePath());
DefaultLogger consoleLogger = new DefaultLogger();
consoleLogger.setErrorPrintStream(System.err);
consoleLogger.setOutputPrintStream(System.out);
consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
p.addBuildListener(consoleLogger);

try {
p.fireBuildStarted();
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.executeTarget(p.getDefaultTarget());
p.fireBuildFinished(null);
} catch (BuildException e) {
p.fireBuildFinished(e);
}
Re: Eugenia Epsilon [message #1111540 is a reply to message #1111515] Wed, 18 September 2013 07:03 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi Shivakumar,

I've uploaded an example that demonstrates how to do this [1]. To run this, you'll need to check out the org.eclipse.epsilon.examples.runant project and follow the instructions in readme.txt.

Cheers,
Dimitris

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/org.eclipse.epsilon.examples.runant/src/org/eclipse/epsilon/examples/runant/RunAntAction.java
Re: Eugenia Epsilon [message #1112099 is a reply to message #1111540] Thu, 19 September 2013 01:56 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks, It works fine and it opens a new window

I want to open new eclipse window through ANT (This windows design window (as per http://www.eclipse.org/epsilon/cinema/
"GMF Editor Development with EuGENia" I want exactly this method in automated way

I am following same steps as above video but looking in automated way with Ant Script


Re: Eugenia Epsilon [message #1112114 is a reply to message #1112099] Thu, 19 September 2013 02:25 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi Shivakumar,

I suppose that you could try to construct and run an Eclipse launch configuration programmatically (similarly to what we do in [1] with an ANT launch configuration). I wouldn't know how to do this off the top of my head but I suspect that the good people over at the PDE forum [2] should be able to help.

Cheers,
Dimitris

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/org.eclipse.epsilon.examples.runant/src/org/eclipse/epsilon/examples/runant/RunAntAction.java
[2] http://www.eclipse.org/forums/index.php/f/14/
Re: Eugenia Epsilon [message #1112124 is a reply to message #1112114] Thu, 19 September 2013 02:40 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks for info,

One basic question, how to call RunAntAction class to execute my build.xml file

Re: Eugenia Epsilon [message #1112165 is a reply to message #1112124] Thu, 19 September 2013 03:47 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi Shivakumar,

It should say in readme.txt [1].

Cheers,
Dimitris

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/org.eclipse.epsilon.examples.runant/readme.txt
Re: Eugenia Epsilon [message #1116434 is a reply to message #1110256] Wed, 25 September 2013 08:45 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Hi Dimitris,

Please can you guide me or point me how to use this "GenerateAllDelegate" class to genereate like how to pass *.emf file etc
Re: Eugenia Epsilon [message #1116441 is a reply to message #1116434] Wed, 25 September 2013 08:56 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Hi,

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.

Cheers,
Dimitris

[1] http://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/plugins/org.eclipse.epsilon.eugenia/plugin.xml

[Updated on: Wed, 25 September 2013 15:14]

Report message to a moderator

Re: Eugenia Epsilon [message #1117209 is a reply to message #1116441] Thu, 26 September 2013 03:48 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Thanks Dimitris,

I did the plug-in.xml with objectContribution and executed the new eclipse application for Manifest file (MANIFEST.MF-->Run Eclipse Application - It opens new eclipse window) but it didn't work for me (not even menu).


Is there anything I am missing

Re: Eugenia Epsilon [message #1117246 is a reply to message #1117209] Thu, 26 September 2013 04:39 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 698
Registered: July 2009
Senior Member
Could you please put together a minimal example [1] I can use to reproduce this?

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Eugenia Epsilon [message #1117549 is a reply to message #1117246] Thu, 26 September 2013 11:01 Go to previous messageGo to next message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Hi Dimitris

I send minimal project to the following email

epsilon.devs@gmail.com
Re: Eugenia Epsilon [message #1118349 is a reply to message #1117549] Fri, 27 September 2013 06:12 Go to previous messageGo to previous message
Shivakumar goniwada is currently offline Shivakumar goniwada
Messages: 28
Registered: August 2013
Junior Member
Hi Dimitris

Is there any luck on 2 small project issues
Previous Topic:New Pallet
Next Topic:Error "Type 'A!B' not found in .etl code!"
Goto Forum:
  


Current Time: Thu Apr 17 20:55:08 EDT 2014

Powered by FUDForum. Page generated in 0.03292 seconds