Loading plugins/org.etsi.mts.tdl.model.gen/src/org/etsi/mts/tdl/gen/OCLinEcoreGenerator.java +14 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ import org.eclipse.ocl.pivot.utilities.OCL; import org.eclipse.ocl.xtext.oclinecore.OCLinEcoreStandaloneSetup; public class OCLinEcoreGenerator extends EcoreGeneratorCustom { private String projectRoot = ""; @Override public void invoke(IWorkflowContext ctx) { System.out.println("Running on: "+projectRoot); //TODO: handle if unresolved? String codeGenJar = locateContainingJar(Generator.class); EcorePlugin.ExtensionProcessor.process(null); Loading @@ -29,12 +32,8 @@ public class OCLinEcoreGenerator extends EcoreGeneratorCustom { URI.createURI(codeGenJar) ); File projectRoot = new File("").getAbsoluteFile(); //TODO: a bit of a hack when running from parent -> needs to be configured in maven directly.. if (projectRoot.getName().equals("org.etsi.mts.tdl.parent")) { File pluginsRoot = projectRoot.getParentFile().listFiles(f->f.getName().equals("plugins"))[0]; projectRoot = pluginsRoot.listFiles(f->f.getName().equals("org.etsi.mts.tdl.model"))[0]; } File projectRoot = new File(getProjectRoot()).getAbsoluteFile(); URIConverter.URI_MAP.put( URI.createURI("platform:/resource/"+projectRoot.getName()+"/"), URI.createFileURI(projectRoot.getAbsolutePath() + File.separator) Loading Loading @@ -78,5 +77,13 @@ public class OCLinEcoreGenerator extends EcoreGeneratorCustom { return null; } public String getProjectRoot() { return projectRoot; } public void setProjectRoot(String projectRoot) { this.projectRoot = projectRoot; } } plugins/org.etsi.mts.tdl.model/model/GenerateTDL.mwe2 +2 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ var rootPath = "platform:/resource/org.etsi.mts.tdl.model" //var rootPath = "platform:/resource/" var rootPaths = "org.etsi.mts.tdl.model" var srcGen = "src-gen" //this does not seem to matter... -> only for cleaning var projectRoot = "" Workflow { bean = org.eclipse.emf.mwe.utils.StandaloneSetup { Loading @@ -27,6 +27,7 @@ Workflow { generateModel = true generateEdit = false generateEditor = false projectRoot = "${projectRoot}" genModel = "platform:/resource/${rootPaths}/model/tdl.genmodel" srcPath = "platform:/resource/${rootPaths}/${srcGen}" } Loading plugins/org.etsi.mts.tdl.model/pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ <arguments> <argument>/${project.basedir}/model/GenerateTDL.mwe2</argument> <argument>-p</argument> <argument>rootPath=/${project.basedir}/..</argument> <argument>projectRoot=${project.basedir}</argument> </arguments> <classpathScope>compile</classpathScope> <includePluginDependencies>true</includePluginDependencies> Loading Loading
plugins/org.etsi.mts.tdl.model.gen/src/org/etsi/mts/tdl/gen/OCLinEcoreGenerator.java +14 −7 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ import org.eclipse.ocl.pivot.utilities.OCL; import org.eclipse.ocl.xtext.oclinecore.OCLinEcoreStandaloneSetup; public class OCLinEcoreGenerator extends EcoreGeneratorCustom { private String projectRoot = ""; @Override public void invoke(IWorkflowContext ctx) { System.out.println("Running on: "+projectRoot); //TODO: handle if unresolved? String codeGenJar = locateContainingJar(Generator.class); EcorePlugin.ExtensionProcessor.process(null); Loading @@ -29,12 +32,8 @@ public class OCLinEcoreGenerator extends EcoreGeneratorCustom { URI.createURI(codeGenJar) ); File projectRoot = new File("").getAbsoluteFile(); //TODO: a bit of a hack when running from parent -> needs to be configured in maven directly.. if (projectRoot.getName().equals("org.etsi.mts.tdl.parent")) { File pluginsRoot = projectRoot.getParentFile().listFiles(f->f.getName().equals("plugins"))[0]; projectRoot = pluginsRoot.listFiles(f->f.getName().equals("org.etsi.mts.tdl.model"))[0]; } File projectRoot = new File(getProjectRoot()).getAbsoluteFile(); URIConverter.URI_MAP.put( URI.createURI("platform:/resource/"+projectRoot.getName()+"/"), URI.createFileURI(projectRoot.getAbsolutePath() + File.separator) Loading Loading @@ -78,5 +77,13 @@ public class OCLinEcoreGenerator extends EcoreGeneratorCustom { return null; } public String getProjectRoot() { return projectRoot; } public void setProjectRoot(String projectRoot) { this.projectRoot = projectRoot; } }
plugins/org.etsi.mts.tdl.model/model/GenerateTDL.mwe2 +2 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ var rootPath = "platform:/resource/org.etsi.mts.tdl.model" //var rootPath = "platform:/resource/" var rootPaths = "org.etsi.mts.tdl.model" var srcGen = "src-gen" //this does not seem to matter... -> only for cleaning var projectRoot = "" Workflow { bean = org.eclipse.emf.mwe.utils.StandaloneSetup { Loading @@ -27,6 +27,7 @@ Workflow { generateModel = true generateEdit = false generateEditor = false projectRoot = "${projectRoot}" genModel = "platform:/resource/${rootPaths}/model/tdl.genmodel" srcPath = "platform:/resource/${rootPaths}/${srcGen}" } Loading
plugins/org.etsi.mts.tdl.model/pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ <arguments> <argument>/${project.basedir}/model/GenerateTDL.mwe2</argument> <argument>-p</argument> <argument>rootPath=/${project.basedir}/..</argument> <argument>projectRoot=${project.basedir}</argument> </arguments> <classpathScope>compile</classpathScope> <includePluginDependencies>true</includePluginDependencies> Loading