4

私は学士論文の日食アプリケーション用のxtextプラグインプロジェクトを開発しています。

Mwe2Launcherクラスを実行するantスクリプトを使用して、実行時に「Xtextアーティファクトの生成」を実行し、一時フォルダーで生成を実行したいと思います。

tempフォルダーにプロジェクトフォルダーを作成し、mwe2ファイル、文法ファイル、およびantスクリプトをコピーするアクティベーターを作成しました。

Antスクリプトを実行すると、次のエラーが発生します。

osgi> start 360
gen:
 [java] 0    INFO  StandaloneSetup    - Registering platform uri 'C:\Foo-test'
 [java] 2461 INFO  DirectoryCleaner   - Cleaning C:\Foo-test\org.xtext.example.foobar\..\org.xtext.example.foobar\src-gen
 [java] 2503 INFO  DirectoryCleaner   - Cleaning C:\Foo-test\org.xtext.example.foobar\..\org.xtext.example.foobar.ui\src-gen
 [java] 3056 INFO  LanguageConfig     - generating infrastructure for org.xtext.example.foobar.Foo with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, GeneratorFragment, FormatterFragment, LabelProviderFragment, OutlineTreeProviderFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment, TypesGeneratorFragment, XbaseGeneratorFragment, CodetemplatesGeneratorFragment
 [java] 6253 INFO  GenModelHelper     - Registered GenModel 'http://www.xtext.org/example/foobar/Foo' from 'file:/C:/Foo-test/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/Foo.genmodel'
 [java] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/FooPackage.java' is unmapped
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageInterface(GenPackageGeneratorAdapter.java:467)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generateModel(GenPackageGeneratorAdapter.java:219)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:290)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:617)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:528)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.doGenerate(EcoreGeneratorFragment.java:144)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.generate(EcoreGeneratorFragment.java:211)
 [java]     at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:81)
 [java]     at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:108)
 [java]     at org.eclipse.xtext.generator.Generator.generate(Generator.java:352)
 [java]     at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
 [java] Caused by: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/FooPackage.java' is unmapped
 [java]     at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createOutputStream(PlatformResourceURIHandlerImpl.java:428)
 [java]     at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:339)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.createOutputStream(AbstractGeneratorAdapter.java:1440)
 [java]     at org.eclipse.emf.mwe2.ecore.CvsIdFilteringGeneratorAdapterFactoryDescriptor$IdFilteringGenModelGeneratorAdapterFactory$IdFilteringGenPackageAdapter.createOutputStream(CvsIdFilteringGeneratorAdapterFactoryDescriptor.java:39)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1104)
 [java]     ... 21 more
 [java] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Model.java' is unmapped
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateInterface(GenClassGeneratorAdapter.java:123)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateModel(GenClassGeneratorAdapter.java:106)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:290)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:617)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:528)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.doGenerate(EcoreGeneratorFragment.java:144)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.generate(EcoreGeneratorFragment.java:211)
 [java]     at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:81)
 [java]     at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:108)
 [java]     at org.eclipse.xtext.generator.Generator.generate(Generator.java:352)
 [java]     at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
 [java] Caused by: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Model.java' is unmapped
 [java]     at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createOutputStream(PlatformResourceURIHandlerImpl.java:428)
 [java]     at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:339)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.createOutputStream(AbstractGeneratorAdapter.java:1440)
 [java]     at org.eclipse.emf.mwe2.ecore.CvsIdFilteringGeneratorAdapterFactoryDescriptor$IdFilteringGenModelGeneratorAdapterFactory$IdFilteringGenClassAdapter.createOutputStream(CvsIdFilteringGeneratorAdapterFactoryDescriptor.java:73)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1104)
 [java]     ... 21 more
 [java] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Greeting.java' is unmapped
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateInterface(GenClassGeneratorAdapter.java:123)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateModel(GenClassGeneratorAdapter.java:106)
 [java]     at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:290)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:617)
 [java]     at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:528)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.doGenerate(EcoreGeneratorFragment.java:144)
 [java]     at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.generate(EcoreGeneratorFragment.java:211)
 [java]     at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:81)
 [java]     at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:108)
 [java]     at org.eclipse.xtext.generator.Generator.generate(Generator.java:352)
 [java]     at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
 [java]     at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
 [java]     at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
 [java]     at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
 [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
 [java] Caused by: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Greeting.java' is unmapped
 [java]     at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createOutputStream(PlatformResourceURIHandlerImpl.java:428)
 [java]     at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:339)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.createOutputStream(AbstractGeneratorAdapter.java:1440)
 [java]     at org.eclipse.emf.mwe2.ecore.CvsIdFilteringGeneratorAdapterFactoryDescriptor$IdFilteringGenModelGeneratorAdapterFactory$IdFilteringGenClassAdapter.createOutputStream(CvsIdFilteringGeneratorAdapterFactoryDescriptor.java:73)
 [java]     at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1104)
 [java]     ... 21 more
 [java] 6768 INFO  EcoreGeneratorFragment - Diagnostic ERROR source=org.eclipse.emf.codegen.ecore code=0 Generating code data=[] [Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic ERROR source=org.eclipse.emf.codegen.ecore code=0 Generating Java interface org.xtext.example.foobar.foo.FooPackage failed with an unhandled exception data=[] [Diagnostic ERROR source=org.eclipse.emf.common code=0 IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/FooPackage.java' is unmapped data=[java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/FooPackage.java' is unmapped]], Diagnostic ERROR source=org.eclipse.emf.codegen.ecore code=0 Generating Java interface org.xtext.example.foobar.foo.Model failed with an unhandled exception data=[] [Diagnostic ERROR source=org.eclipse.emf.common code=0 IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Model.java' is unmapped data=[java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Model.java' is unmapped]], Diagnostic ERROR source=org.eclipse.emf.codegen.ecore code=0 Generating Java interface org.xtext.example.foobar.foo.Greeting failed with an unhandled exception data=[] [Diagnostic ERROR source=org.eclipse.emf.common code=0 IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Greeting.java' is unmapped data=[java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/Greeting.java' is unmapped]], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[], Diagnostic OK source=org.eclipse.emf.common code=0 OK data=[]]
 [java] 10385 INFO  JavaValidatorFragment - generating Java-based EValidator API
 [java] 13246 INFO  Workflow           - Done. BUILD SUCCESSFUL Total time: 27 seconds

マップされていない「.java」ファイルも生成されませんでした。「/src-gen/...../foobar/foo」フォルダ全体がありません。

これが理由であり、修正する必要があると思います。

問題がどこにあるのか、本当にわかりません。私はすでにEclipseフォーラムで議論をしましたが、build.xmlを見つけることができますが、別のプロジェクトでは、プラグインをアクティブにしてコピーを実行し、antスクリプトを実行するActivatorクラスもあります。また、私が使用するmwe2ファイルもあります。

4

1 に答える 1

1

ワークフローで一時フォルダーをプラットフォーム URI として登録する必要があります。Xtext は、EMF の platform:/resource URI スキームを使用します。したがって、ファイルシステム上の絶対的な場所からプラットフォーム パスに従って論理的な場所へのパス マッピングを定義するには、プラットフォーム ルートを登録する必要があります。.project ファイルもコピーしてみてください。一時フォルダーをプラットフォームパスとして既に登録している場合に役立つと思います。

于 2012-04-10T19:42:36.567 に答える