1

.system作業用のコードを生成する拡張機能付きの EMF モデルを作成しました。

これで、Eclipse から起動コード生成アクションを使用してコードを生成できます。しかし、スタンドアロン プログラムからコード生成を起動してコードを生成したいと考えています。

どうすればこれを達成できますか?

詳細: EMF モデルからプラグインを作成し、Eclipse に組み込みました。

プラグインからファイルを作成.systemし、プラグインからコードを生成できます。

LauchActionコード生成をクリックすると、プラグインからクラスが開始されることがわかりました。

LaunchActionスタンドアロン Java プログラムからクラスを開始するにはどうすればよいですか?

私の目的は、作成した.systemモデルを実行し、スタンドアロンの Java プログラムからコードを生成することです。

どうすればこれを達成できますか?

4

2 に答える 2

3

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.

于 2010-07-07T06:46:31.087 に答える