|
Re: OutputConfigurationProvider with empty output-directory [message #998038 is a reply to message #996980] |
Wed, 09 January 2013 08:42 |
|
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
>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
Re: OutputConfigurationProvider with empty output-directory [message #998541 is a reply to message #998251] |
Thu, 10 January 2013 07:45 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Tom,
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
>>>
>>
>>
>
|
|
|
Re: OutputConfigurationProvider with empty output-directory [message #999228 is a reply to message #996980] |
Fri, 11 January 2013 15:49 |
|
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 "../".
>
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.
I have set
projectRootOutput.setOutputDirectory("src");
projectRootOutput.setOverrideExistingResources(true);
projectRootOutput.setCreateOutputDirectory(true);
projectRootOutput.setCanClearOutputDirectory(false);
projectRootOutput.setCleanUpDerivedResources(true);
projectRootOutput.setSetDerivedProperty(true);
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 ;)
has a feature request already been filed?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
Powered by
FUDForum. Page generated in 0.02732 seconds