We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative solution for creating eCore model (without needing to start/restart another eclipse)
package org.eclipse.acceleo.module.droid.main;
import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.List;
import org.eclipse.emf.common.util.BasicMonitor; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.Resource.Diagnostic; import org.eclipse.xtext.resource.XtextResource; import org.eclipse.xtext.resource.XtextResourceSet; import org.xtext.example.droid.DroidStandaloneSetup; import org.xtext.example.droid.droid.Application;
import com.google.inject.Injector;
public class TestMe {
/** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../"); Injector injector = new DroidStandaloneSetup().createInjectorAndDoEMFRegistration(); XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class); resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); Resource resource = resourceSet.createResource(URI.createURI("dummy:/example.droid")); InputStream in = TestMe.class.getResourceAsStream("test.droid"); //InputStream in = new FileInputStream("test.droid"); //new ByteArrayInputStream("type foo type bar".getBytes()); resource.load(in, resourceSet.getLoadOptions()); for (Diagnostic diag : resource.getErrors()) { System.out.println(diag.getMessage()); } Application model = (Application) resource.getContents().get(0); System.out.println(model.getName()); List<String> arguments = new ArrayList<String>(); Generate generator = new Generate(model, new File("src-gen"), arguments);
// for (int i = 2; i < args.length; i++) { // generator.addPropertiesFile(args[i]); // }
generator.doGenerate(new BasicMonitor()); }
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Alternative solution for creating eCore model (without needing to start/restart another eclipse)
package org.eclipse.acceleo.module.droid.main;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.xtext.example.droid.DroidStandaloneSetup;
import org.xtext.example.droid.droid.Application;
import com.google.inject.Injector;
public class TestMe {
// for (int i = 2; i < args.length; i++) {
// generator.addPropertiesFile(args[i]);
// }
}
The text was updated successfully, but these errors were encountered: