eclipse-emfatic / emfatic

Emfatic is a textual syntax for EMF Ecore (meta-)models.
https://eclipse.dev/emfatic
Eclipse Public License 2.0
1 stars 0 forks source link

[Eugenia] Diagram code generation from headless ant build using epsilon.eugenia task #1

Open eclipsewebmaster opened 12 months ago

eclipsewebmaster commented 12 months ago

/There should be a clean way to generate all codes ( model, edit, test , diagram etc ) using emfactic file referred in an ant script ( in headless mode ).

Right now even after manually adding all dependencies. Running the ant script

For example,

java -jar C:\eclipse\plugins\org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar -application org.eclipse.ant.core.antRunner -buildfile C:\epsilon\workspace\is\model\build.xml

Produces,

BUILD FAILED C:\epsilon\workspace\is\model\build.xml:17: java.lang.IllegalStateException: Wor kbench has not been created yet. at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:93) at org.eclipse.epsilon.workflow.tasks.eugenia.EugeniaTask.executeImpl(Eu geniaTask.java:139) at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.ja va:40) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:392) at org.apache.tools.ant.Target.performTasks(Target.java:413) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTarge ts(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:672) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu nner.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

Total time: 1 second An error has occurred. See the log file C:\Users\shrikanth_n_c\workspace.metadata.log.

log.log

My guess epsilon.eugenia task is tightly coupled with eclipse dependencies ( IFile, Workspace, workbench etc)

Thanks, Shrikanth NC

eclipsewebmaster commented 12 months ago

Dimitris Kolovos CLA 2014-03-08 09:03:58 EST Thanks for reporting this. You're right - Eugenia assumes a running Eclipse workbench. We could probably get rid of some Eclipse dependencies but I can't immediately see how we could produce a version that can run in headless mode given that eventually we need to call the GMF code generator (see lines 133-138 of [1])

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/plugins/org.eclipse.epsilon.workflow.eugenia/src/org/eclipse/epsilon/workflow/tasks/eugenia/EugeniaTask.java

eclipsewebmaster commented 12 months ago

Sina Madani CLA 2020-05-24 11:12:51 EDT Closing since version 2.0.

eclipsewebmaster commented 12 months ago

Joern Guy Suess CLA 2021-08-20 06:59:06 EDT Please reopen, I understand the reasoning for GMF, but GMF is unmaintained and probably deprecated. Not providing this even for basic EMF/Ecore workflow cuts all CI use of. You cannot run a window station to drive a build process. And you cannot have an engineering process unless you can automate. This (generating model code modules) is the start of the model driven process. If that does not work, what will?

eclipsewebmaster commented 12 months ago

Dimitris Kolovos CLA 2021-08-20 07:19:07 EDT I agree that it'd make sense to refactor Eugenia so that a larger part of it does not require a running workbench and any contributions in this direction would be more than welcome. Alternatively, if you are interested only in the EMF-related capabilities of the Eugenia ANT task, it may be worth considering EMF's Ecore2Java ANT task [1, 2] instead, which also offers more configuration options.

[1] http://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ant/taskdefs/codegen/ecore/GeneratorTask.html [2] http://cubussapiens.hu/2010/12/generating-java-code-from-emf-models-automatically/

eclipsewebmaster commented 12 months ago

Joern Guy Suess CLA 2021-08-22 18:52:45 EDT It would be so good if the Emfatic toolchain up to Codegen could be factored out. The design is just so slick. I presented it to some developers and especially the built-in model transform got accolades.

I am now working around it with Java2Ecore just as you have described, but that tool is very brittle. In addition, to keep the functionality that I get from Eugenia, I have to run a script for an emfatic semantic load, an xmi semantic save, a genmodel generate, a model transformation to tie in the annotation model, and then a second generation step to create the actual code.

Even explaining that procedure to a developer is tedious, never mind packaging it and placing it in a lot of modules.

Sorry for driving so hard for the CI/CD side of things. I fervently believe that if we have Model-Driven Engineering it is not worth much without the ability to create an Engine that automates our work. If that is not true, MDE will forever be a mouse-click farm.

eclipsewebmaster commented 12 months ago

Dimitris Kolovos CLA 2021-08-23 12:47:22 EDT I agree that this would be very nice to have; it's just a matter of finding the time and resources to refactor the Eugenia code which underpins the ANT task and eliminate the assumption that it always runs within an Eclipse workbench.