Doing a Clean Build on Xtext 2.9.1 [message #1752556] |
Wed, 25 January 2017 06:58 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
I just created a new Xtext Project with Eclipse Mars (Xtext 2.9.1)
When I generate the MWE2 Workflow, some new files were automatically generated (TestRuntimeModule.xtend and TestStandaloneSetup.xtend). These files are in the src folder. I stored all the files in a git repo, except for the generated folders (src-gen, xtend-gen and bin). But my problem is, if I do a clean clone from the repo, where the TestRuntimeModule and TestStandaloneSetup is already there, I keep getting compiler errors even if I delete all the errors and do a clean build. Refershing the workspace also did not help.
The console shows that build is successful, the src-gen and xtend-gen directories are created, and the expected files are also there, but there are all the red x icons beside the files, and under the Problems tab, a list of errors are shown.
Description Resource Path Location Type
AbstractTestRuntimeModule cannot be resolved to a type. TestRuntimeModule.xtend /test/src/org line: 10 /test/src/org/TestRuntimeModule.xtend Xtend Problem
AbstractTestScopeProvider cannot be resolved to a type. TestScopeProvider.xtend /test/src/org/scoping line: 13 /test/src/org/scoping/TestScopeProvider.xtend Xtend Problem
AbstractTestValidator cannot be resolved to a type. TestValidator.xtend /test/src/org/validation line: 12 /test/src/org/validation/TestValidator.xtend Xtend Problem
Package 'org.parser.antlr.internal' does not exist in this plug-in MANIFEST.MF /test/META-INF line 27 Plug-in Problem
Package 'org.parser.antlr' does not exist in this plug-in MANIFEST.MF /test/META-INF line 25 Plug-in Problem
Package 'org.serializer' does not exist in this plug-in MANIFEST.MF /test/META-INF line 24 Plug-in Problem
Package 'org.services' does not exist in this plug-in MANIFEST.MF /test/META-INF line 19 Plug-in Problem
Package 'org.test.impl' does not exist in this plug-in MANIFEST.MF /test/META-INF line 18 Plug-in Problem
Package 'org.test.util' does not exist in this plug-in MANIFEST.MF /test/META-INF line 23 Plug-in Problem
Package 'org.test' does not exist in this plug-in MANIFEST.MF /test/META-INF line 22 Plug-in Problem
Superclass must be a class TestRuntimeModule.xtend /test/src/org line: 10 /test/src/org/TestRuntimeModule.xtend Xtend Problem
Superclass must be a class TestScopeProvider.xtend /test/src/org/scoping line: 13 /test/src/org/scoping/TestScopeProvider.xtend Xtend Problem
Superclass must be a class TestStandaloneSetup.xtend /test/src/org line: 10 /test/src/org/TestStandaloneSetup.xtend Xtend Problem
Superclass must be a class TestValidator.xtend /test/src/org/validation line: 12 /test/src/org/validation/TestValidator.xtend Xtend Problem
TestStandaloneSetupGenerated cannot be resolved to a type. TestStandaloneSetup.xtend /test/src/org line: 10 /test/src/org/TestStandaloneSetup.xtend Xtend Problem
The method createInjectorAndDoEMFRegistration() is undefined for the type TestStandaloneSetup TestStandaloneSetup.xtend /test/src/org line: 13 /test/src/org/TestStandaloneSetup.xtend Xtend Problem
Any idea what I can do to fix this?
|
|
|
Re: Doing a Clean Build on Xtext 2.9.1 [message #1752561 is a reply to message #1752556] |
Wed, 25 January 2017 07:24 |
|
Chris,
when you do not check in src-gen and xtend-gen, then the generated files are missing after a clean clone. TestRuntimeModule might be checked in, but derives from AbstractTestRuntimeModule, which is a generated file. Thus, after a clean checkout you have to run the MWE2 Workflow. You were not indicating that you did that. The errors listed let me assume that the files in src-gen are missing, or are not on the classpath.
~Karsten
|
|
|
|
|
Re: Doing a Clean Build on Xtext 2.9.1 [message #1752566 is a reply to message #1752564] |
Wed, 25 January 2017 08:03 |
|
Ok, you have updated Xtext and use the current generator. This will generate the Runtime Module in Xtend, this is now default. The workflow can be configured to produce Java instead of Xtend:
component = XtextGenerator {
...
configuration = {
...
code = {
...
preferXtendStubs = false
}
}
|
|
|
Re: Doing a Clean Build on Xtext 2.9.1 [message #1752571 is a reply to message #1752566] |
Wed, 25 January 2017 09:00 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
Ok, thanks. it works now. I also noticed that the new workflow always generates the Validator and ScopeProvider class in src-gen.
In my MWE2, I have this:
language = StandardLanguage {
referencedResource = resource1
name = grammarURI1
fileExtensions = "myDsl"
scopeProvider = scoping.ImportNamespacesScopingFragment2 {
generateStub = false
}
generator = {
generateJavaMain = true
generateStub = false
}
serializer = {
generateStub = false
}
validator = validation.ValidatorFragment2 {
generateStub = false
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
But why does the src-gen still have the org.scoping and org.validation classes?
src-gen/org/scoping/TestScopeProvider.java.
src-gen/org/validation/TestValidator.java
In the old MWE, this is generated as an abstract class. As I do not really need these, I would prefer an abstract class. So, how can I make MWE2 generate it as abstract?
[Updated on: Wed, 25 January 2017 09:18] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03469 seconds