CoastalHacking / semiotics-main

Semiotics models and stand-alone product / UI
Apache License 2.0
0 stars 0 forks source link

Autogenerate Ecore files via tycho-eclipserun-plugin #10

Open jpasski opened 8 years ago

jpasski commented 8 years ago

From @jonpasski on March 27, 2016 0:39

https://gist.github.com/hwellmann/6044835

Can do this no problem with the -model switch when configured w/ the .assessment project. Duplicated the command and changed -model to -edit for the .assessment.edit project, got errors.

Contains: Nature does not exist: org.eclipse.pde.PluginNature.

Similar error to the issue here. However, both the .assessment and .assessment.edit projects had the org.eclipse.pde as a dependency on the plugin. (I tried making it also a dependency on the tycho-eclipserun-plugin plugin in the pom.xml for each. No love it seemed.

Copied from original issue: OpenSemanticsIO/semiotics-main#14

jpasski commented 8 years ago

Random notes

target/generated-sources/emf ("target-root-directory")

target/workspace

So here's the idea:

target-root-directory

-  ... ${basedir}/model/assessment.genmodel target/generated-sources/emf</appArgLine>
+  ... ${basedir}/model/assessment.genmodel ${basedir}</appArgLine>
mvn -f builds/io.opensemantics.semiotics.parent/pom.xml clean verify
...

>>> Generating /Users/jonpasski/src/OpenSemantics/semiotics-main/bundles/io.opensemantics.semiotics.model.assessment/model/assessment.genmodel
>>  Examining project 'io.opensemantics.semiotics.model.assessment'
>>  Refreshing '/io.opensemantics.semiotics.model.assessment'.
Usage arguments:
  [-projects <project-root-directory>]
  [-dynamicTemplates] [-forceOverwrite | -diff]
  [-generateSchema] [-nonNLSMarkers]
  [-codeFormatting { default | <profile-file> } ]
  [-model] [-edit] [-editor] [-tests]
  [-autoBuild <true|false>]
  [-reconcile]
  <genmodel-file-or-platform-resource-uri>
  [ <target-root-directory> ]

For example:

  generate result/model/Extended.genmodel
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
  at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:168)
  at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:52)
  at org.eclipse.core.internal.resources.Project.create(Project.java:268)
  at org.eclipse.core.internal.resources.Project.create(Project.java:252)
  at org.eclipse.emf.codegen.util.CodeGenUtil$EclipseUtil.findOrCreateContainer(CodeGenUtil.java:1276)
  at org.eclipse.emf.codegen.util.CodeGenUtil$EclipseUtil.findOrCreateContainer(CodeGenUtil.java:1251)
  at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable$1.run(Generator.java:363)
  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2225)
  at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:466)
  at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:134)
  at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.start(Generator.java:120)
  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
  at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
  at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Contains: OK
Contains: /Users/jonpasski/src/OpenSemantics/semiotics-main/bundles/io.opensemantics.semiotics.model.assessment overlaps the workspace location: /Users/jonpasski/src/OpenSemantics/semiotics-main/bundles/io.opensemantics.semiotics.model.assessment/target/workspace

^^^ So target/workspace cannot overlap the project. fuck a duck

This occurs in :

  if (!project.exists())
  {
    project.create(projectDescription, new SubProgressMonitor(progressMonitor, 1));
    project.open(new SubProgressMonitor(progressMonitor, 1));
  }

At the project.create call in org.eclipse.emf.codegen.util.CodeGenUtil$EclipseUtil.findOrCreateContainer

OK, so the plugin opens the target-root-directory project in the workspace. The project cannot overlap the workspace, which makes sense.