2

I have created an EMF model with extension .system which will generate the code for my work.

Now I can generate code using launch code generation action from Eclipse. But I want to generate the code by launching the code generation from a stand-alone program.

How do I achieve this?

Details: I have created a plugin from EMF model and have inlcluded in the Eclipse.

I will created .system files from out of my plugin and I can generate code from my plugins.

I have observed that when I click launch the code generation it is starting a LauchAction class from my plugin.

How do I start my LaunchAction class from a stand-alone Java program?

My aim is to run my created .system model and generate the code from a stand-alone Java program.

How do I achieve this?

1
  • You might consider refactoring this question. 1. Turn it into a question. 2. What is the exact step you are missing? Example: What snip of code and configuration do I need to make an EMF model into Java Stubs. 3. Proof read. I typically can help in this space. You might message me through this site if you still need help and you update the question. Commented Dec 12, 2009 at 2:33

2 Answers 2

5

You could call Eclipse from the command line. Something similar to this:

eclipse.exe -noSplash -data ${workspace_location} -model -edit -editor -tests -application org.eclipse.emf.codegen.ecore.Generator ${genmodel}

This command will start Eclipse silently and will generate mode code (-model), edit plug-in (-edit), editor plug-in (-editor), and the test plug-in (-tests). Leave out any of these parameters if they are not needed.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't know how to solve your problem, but I think it is doable. I think you have to look at the EMF source code to check how the code generation works.

Here are some starting points:

  • If you have PDE and the EMF tools, use use Import > Plug-ins and Fragments to get the EMF plugin into your Eclipse workspace.

  • Otherwise, clone and import the following Git repository:

    https://git.eclipse.org/c/emf/org.eclipse.emf.git/
    
  • Have a look at the following file, maybe you can find what you need there:

    plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/handler/GenerateHandler.java
    
  • Otherwise, look in the org.eclipse.emf.codegen.ecore plugin.

Good luck! It's an interesting problem! Please report back here if you solve it!

EDIT: Ops, this question is 10 years old, I didn't notice!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.