Closed farhan5248 closed 9 months ago
Trying to get something simple like this working. I took this from here: https://www.eclipse.org/forums/index.php/t/1090396/
public static void main(String[] args) {
Model model = MyDslFactory.eINSTANCE.createModel();
ModelObject newCstic = MyDslFactory.eINSTANCE.createCstic();
model.getObjects().add(newCstic);
((Cstic) newCstic).setDesc("MyNewCstic");
newCstic.setName("MyNewCstic");
Injector injector = new MyDslStandaloneSetup().createInjectorAndDoEMFRegistration();
ResourceSet rs = injector.getInstance(ResourceSet.class);
Resource r = rs.createResource(URI.createURI("charts/test2.mydsl"));
r.getContents().add(model);
try {
r.save(null);
} catch (IOException e) {
e.printStackTrace();
}
}
Got this working, will now integrate it with a mojo
This is done but it's not complete. I haven't tested the round trip of feature file to uml to feature file. It's not that important right now since I want to get to refactoring the code. After refactoring, I'll review the test cases and as I add missing ones, I'll complete the code.
I can create Java code from the UML model but not feature files. I need to look at how to create a feature file with Xtext, I might work on that from the 29th to the 31st.