Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsOutputConfigurationProvider with empty output-directory
https://www.eclipse.org/forums/index.php/mv/msg/446353/996980/#msg_996980
In my project I want the generator to write file directly to the
project-folder instead of some subfolder.
I tried the following settings: "", "." but they all lead to an
exception, the only possible solution for now is that I define "src" and
then when creating the path in the generator i prefix it with "../".
The exception thrown is:
> !STACK 0
> java.lang.IllegalArgumentException: Path must include project and resource name: /my.fx.test
> at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
> at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
> at org.eclipse.core.internal.resources.Container.getFolder(Container.java:215)
> at org.eclipse.xtext.builder.BuilderParticipant.refreshOutputFolders(BuilderParticipant.java:231)
> at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:125)
> at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
> at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:161)
> at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
The drawback with this is that if the user does not have src-directory
it gets created.
Is there a possibility to make the xtext generate relative to the
root-folder?
Tom]]>Thomas Schindl2013-01-03T10:35:19-00:00Re: OutputConfigurationProvider with empty output-directory
https://www.eclipse.org/forums/index.php/mv/msg/446353/998038/#msg_998038
I have exactly the same problem (I'd like to generate a
plugin.xml_my_gen) in the root folder...
the trick of "../" does not work for me either could you please share to
code Tom?
thanks
cheers
Lorenzo
On 01/03/2013 11:35 AM, Tom Schindl wrote:
> Hi,
>
> In my project I want the generator to write file directly to the
> project-folder instead of some subfolder.
>
> I tried the following settings: "", "." but they all lead to an
> exception, the only possible solution for now is that I define "src" and
> then when creating the path in the generator i prefix it with "../".
>
> The exception thrown is:
>> !STACK 0
>> java.lang.IllegalArgumentException: Path must include project and resource name: /my.fx.test
>> at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
>> at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
>> at org.eclipse.core.internal.resources.Container.getFolder(Container.java:215)
>> at org.eclipse.xtext.builder.BuilderParticipant.refreshOutputFolders(BuilderParticipant.java:231)
>> at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:125)
>> at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
>> at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:161)
>> at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
>> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>
>
> The drawback with this is that if the user does not have src-directory
> it gets created.
>
> Is there a possibility to make the xtext generate relative to the
> root-folder?
>
> Tom
>
Am 09.01.13 09:42, schrieb Lorenzo Bettini:
> Hi
>
> I have exactly the same problem (I'd like to generate a
> plugin.xml_my_gen) in the root folder...
>
> the trick of "../" does not work for me either could you please share to
> code Tom?
>
> thanks
> cheers
> Lorenzo
>
> On 01/03/2013 11:35 AM, Tom Schindl wrote:
>> Hi,
>>
>> In my project I want the generator to write file directly to the
>> project-folder instead of some subfolder.
>>
>> I tried the following settings: "", "." but they all lead to an
>> exception, the only possible solution for now is that I define "src" and
>> then when creating the path in the generator i prefix it with "../".
>>
>> The exception thrown is:
>>> !STACK 0
>>> java.lang.IllegalArgumentException: Path must include project and resource name: /my.fx.test
>>> at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
>>> at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
>>> at org.eclipse.core.internal.resources.Container.getFolder(Container.java:215)
>>> at org.eclipse.xtext.builder.BuilderParticipant.refreshOutputFolders(BuilderParticipant.java:231)
>>> at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:125)
>>> at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
>>> at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:161)
>>> at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
>>> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
>>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
>>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
>>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
>>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
>>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>>
>>
>> The drawback with this is that if the user does not have src-directory
>> it gets created.
>>
>> Is there a possibility to make the xtext generate relative to the
>> root-folder?
>>
>> Tom
>>
>
>]]>Thomas Schindl2013-01-09T16:46:18-00:00Re: OutputConfigurationProvider with empty output-directory
https://www.eclipse.org/forums/index.php/mv/msg/446353/998541/#msg_998541
would you mind filing a ticket with a patch attached? That would be great.
Best regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 09.01.13 17:46, schrieb Tom Schindl:
> Hi Lorenzo,
>
> All my code is opensource.
>
> The generator:
> https://github.com/tomsontom/e-fx-clipse/blob/master/at.bestsolution.efxclipse.tooling.fxgraph/src/at/bestsolution/efxclipse/tooling/fxgraph/generator/FXGraphGenerator.xtend
>
> The outputconfig provider:
> https://github.com/tomsontom/e-fx-clipse/blob/master/at.bestsolution.efxclipse.tooling.fxgraph/src/at/bestsolution/efxclipse/tooling/fxgraph/compiler/FXGraphOutputConfigurationProvider.java
>
> Tom
>
> Am 09.01.13 09:42, schrieb Lorenzo Bettini:
>> Hi
>>
>> I have exactly the same problem (I'd like to generate a
>> plugin.xml_my_gen) in the root folder...
>>
>> the trick of "../" does not work for me either could you please share to
>> code Tom?
>>
>> thanks
>> cheers
>> Lorenzo
>>
>> On 01/03/2013 11:35 AM, Tom Schindl wrote:
>>> Hi,
>>>
>>> In my project I want the generator to write file directly to the
>>> project-folder instead of some subfolder.
>>>
>>> I tried the following settings: "", "." but they all lead to an
>>> exception, the only possible solution for now is that I define "src" and
>>> then when creating the path in the generator i prefix it with "../".
>>>
>>> The exception thrown is:
>>>> !STACK 0
>>>> java.lang.IllegalArgumentException: Path must include project and resource name: /my.fx.test
>>>> at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
>>>> at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
>>>> at org.eclipse.core.internal.resources.Container.getFolder(Container.java:215)
>>>> at org.eclipse.xtext.builder.BuilderParticipant.refreshOutputFolders(BuilderParticipant.java:231)
>>>> at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:125)
>>>> at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
>>>> at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:161)
>>>> at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
>>>> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
>>>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
>>>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
>>>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
>>>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
>>>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
>>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>>>
>>>
>>> The drawback with this is that if the user does not have src-directory
>>> it gets created.
>>>
>>> Is there a possibility to make the xtext generate relative to the
>>> root-folder?
>>>
>>> Tom
>>>
>>
>>
>]]>Sebastian Zarnekow2013-01-10T07:45:44-00:00Re: OutputConfigurationProvider with empty output-directory
https://www.eclipse.org/forums/index.php/mv/msg/446353/999228/#msg_999228
> Hi,
>
> In my project I want the generator to write file directly to the
> project-folder instead of some subfolder.
>
> I tried the following settings: "", "." but they all lead to an
> exception, the only possible solution for now is that I define "src" and
> then when creating the path in the generator i prefix it with "../".
>
OK, now this hack works for me, but there's a drawback of this approach:
if I remove an element in my program which corresponds to a generated
resource, the previously generated file is not removed.
but when the build participant executes these lines
Map<OutputConfiguration, Iterable<IMarker>> generatorMarkers =
newHashMap();
for (OutputConfiguration config : outputConfigurations.values()) {
if (config.isCleanUpDerivedResources()) {
final IFolder outputFolder =
builtProject.getFolder(config.getOutputDirectory());
final Iterable<IMarker> markers =
derivedResourceMarkers.findDerivedResourceMarkers(outputFolder,
generatorIdProvider.getGeneratorIdentifier());
generatorMarkers.put(config, markers);
}
}
it search for markers in the output directory (which is "src"), thus it
cannot find the generated resources in the project root...
probably a custom version of
DerivedResourceMarkers.findDerivedResourceMarkers could solve the
problem by using a modified IFolder... that would be a hack built upon
another hack ;)