Problem migrating Standalone generator to 2.3 [message #885210] |
Tue, 12 June 2012 16:07 |
Andrew Clark Messages: 23 Registered: June 2010 |
Junior Member |
|
|
Hi,
I am trying to migrate some Xtext projects to 2.3 and I have encountered the following problem.
When trying to run the Main class I load a resource I wish to link to via the resource set as follows
Resource resource2 = set.getResource(URI.createURI("src/xxx.mydsl"), true);
i.e.
protected void runGenerator(String string) {
// load the resource
ResourceSet set = resourceSetProvider.get();
Resource resource2 = set.getResource(URI.createURI("src/xxx.mydsl"), true); Resource resource = set.getResource(URI.createURI(string), true);
// validate the resource
List<Issue> list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
if (!list.isEmpty()) {
for (Issue issue : list) {
System.err.println(issue);
}
return;
}
// configure and start the generator
fileAccess.setOutputPath("src-gen/");
generator.doGenerate(resource, fileAccess);
System.out.println("Code generation finished.");
}
This code runs with our current Xtext installation (Xtext SDK 2.2.1.v201112130541) but not with Xtext SDK 2.3.0.v201206051055 .
I have tried to track down the problem and it seems the new code modifies the StateBasedContainer created by the DefaultGlobalScopeProvider to a DescriptionAddingContainer, which then leads to a SelectableBasedScope with a selectable of FilterUriContainer (old code selectable = StateBasedContainer).
Now I am out of my depth I have no idea why this is not working.
I have attached a couple of example projects, the Main in MyDsl1 runs with Xtext 2.2 and not with 2.3 (linking error).
Any help/hints as to what I am doing wrong would be appreciated.
Note : Everything works fine inside Eclipse.
-
Attachment: example.zip
(Size: 331.80KB, Downloaded 219 times)
|
|
|
Re: Problem migrating Standalone generator to 2.3 [message #885247 is a reply to message #885210] |
Tue, 12 June 2012 17:17 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Andrew,
could you please add information about the actual problem that you face?
What does not work for you? Do you get exceptions?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 12.06.12 18:07, schrieb Andrew Clark:
> Hi,
>
> I am trying to migrate some Xtext projects to 2.3 and I have encountered the following problem.
>
> When trying to run the Main class I load a resource I wish to link to via the resource set as follows
>
> Resource resource2 = set.getResource(URI.createURI("src/xxx.mydsl"), true);
> i.e.
>
>
> protected void runGenerator(String string) {
> // load the resource
> ResourceSet set = resourceSetProvider.get();
> Resource resource2 = set.getResource(URI.createURI("src/xxx.mydsl"), true); Resource resource = set.getResource(URI.createURI(string), true);
>
> // validate the resource
> List<Issue> list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
> if (!list.isEmpty()) {
> for (Issue issue : list) {
> System.err.println(issue);
> }
> return;
> }
>
> // configure and start the generator
> fileAccess.setOutputPath("src-gen/");
> generator.doGenerate(resource, fileAccess);
>
> System.out.println("Code generation finished.");
> }
>
>
>
> This code runs with our current Xtext installation (Xtext SDK 2.2.1.v201112130541) but not with Xtext SDK 2.3.0.v201206051055 .
>
> I have tried to track down the problem and it seems the new code modifies the StateBasedContainer created by the DefaultGlobalScopeProvider to a DescriptionAddingContainer, which then leads to a SelectableBasedScope with a selectable of FilterUriContainer (old code selectable = StateBasedContainer).
>
> Now I am out of my depth :( I have no idea why this is not working.
>
> I have attached a couple of example projects, the Main in MyDsl1 runs with Xtext 2.2 and not with 2.3 (linking error).
>
> Any help/hints as to what I am doing wrong would be appreciated.
>
> Note : Everything works fine inside Eclipse.
>
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03505 seconds