Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » 2 OutputConfiguration's on Idea with Error(Error during auto build.: A slot with name 'SRC_GEN_ONCE' has not been configured.)
2 OutputConfiguration's on Idea with Error [message #1756002] Thu, 09 March 2017 21:20 Go to next message
Hartmut Kalk is currently offline Hartmut KalkFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I've configured a second OutputConfiguration in my Eclipse XText-Project with Idea-Plugin. In Eclipse it works as expected. But if i start Intellij the Exception
is thrown:
Error during auto build.: A slot with name 'SRC_GEN_ONCE' has not been configured.
.

This is the Provider-Class:
class CustomOutputConfigurationProvider  extends OutputConfigurationProvider {

    public static final String GEN_ONCE_OUTPUT = "SRC_GEN_ONCE";

    override getOutputConfigurations() {
 
        val defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
        defaultOutput.setDescription("Output Folder") ;
        defaultOutput.setOutputDirectory("./src-gen");
        defaultOutput.setOverrideExistingResources(true);
        defaultOutput.setCreateOutputDirectory(true);
        defaultOutput.setCleanUpDerivedResources(true);
        defaultOutput.setSetDerivedProperty(true);
       
        val readonlyOutput = new OutputConfiguration(GEN_ONCE_OUTPUT);
        readonlyOutput.setDescription("Read-only Output Folder");
        readonlyOutput.setOutputDirectory("./src-once");
        readonlyOutput.setOverrideExistingResources(false);
        readonlyOutput.setCreateOutputDirectory(true);
        readonlyOutput.setCleanUpDerivedResources(false);
        readonlyOutput.setSetDerivedProperty(false);

        return newHashSet(defaultOutput, readonlyOutput);
    }
}



it ist bind in RuntimeModule and UiModule:

def Class<? extends IOutputConfigurationProvider> bindIOutputConfigurationProvider() {
        return CustomOutputConfigurationProvider
    }


I'm new on XText in this version. I've worked with older version which has outlet's in mwe and no plugin.

Thanks for any ideas

Hartmut



Version:
Eclipse: Neon
IntelliJ: 163.13906.18
XText: 2.10.0
Re: 2 OutputConfiguration's on Idea with Error [message #1756093 is a reply to message #1756002] Fri, 10 March 2017 21:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10424
Registered: July 2009
Senior Member
DefaultIdeaModule binds a IContextualOutputConfigurationProvider (IdeaOutputConfigurationProvider)

you should have a look what org.eclipse.xtext.idea.build.IdeaOutputConfigurationProvider.getOutputConfigurations(Module) dos
=> i assue you need to subclass / customize this one in MyDslIdeaModule
Re: 2 OutputConfiguration's on Idea with Error [message #1756196 is a reply to message #1756093] Mon, 13 March 2017 18:26 Go to previous messageGo to next message
Hartmut Kalk is currently offline Hartmut KalkFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Christian,

I've tried this (Code shows only a simple way, this should work for the first check), but if i set the readonlyOutput.setOverrideExistingResources(...) to false, no files in src-once will created. If i set both readOnly and default to override, the src-once-dir is filled as expected. But will overwriten on every change

class CustomContextualOutputConfigurationProvider extends IdeaOutputConfigurationProvider {

    public static final String GEN_ONCE_OUTPUT = "SRC_GEN_ONCE";

    def Set<OutputConfiguration> getOutConf() {
        val defaultOutputLoc = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
        defaultOutputLoc.setDescription("Gen. Output Folder") ;
        defaultOutputLoc.setOutputDirectory("./src-gen");
        defaultOutputLoc.setOverrideExistingResources(true);
        defaultOutputLoc.setCreateOutputDirectory(true);
        defaultOutputLoc.setCleanUpDerivedResources(false);
        defaultOutputLoc.setSetDerivedProperty(false);

        val readonlyOutput = new OutputConfiguration(GEN_ONCE_OUTPUT);
        readonlyOutput.setDescription("Read-only Output Folder");
        readonlyOutput.setOutputDirectory("./src-once");
        readonlyOutput.setOverrideExistingResources(false);
        readonlyOutput.setCreateOutputDirectory(true);
        readonlyOutput.setCleanUpDerivedResources(false);
        readonlyOutput.setSetDerivedProperty(false);

        return newHashSet(defaultOutputLoc,readonlyOutput)
    }

    override Set<OutputConfiguration> getOutputConfigurations( Module module ){
       return getOutConf()
    }

    override Set<OutputConfiguration> getOutputConfigurations( Resource context) {
       return getOutConf()
    }

    override Set<OutputConfiguration> getOutputConfigurations(ResourceSet context)  {
        return getOutConf()
    }




Any further Ideas?

Hartmut
Re: 2 OutputConfiguration's on Idea with Error [message #1756198 is a reply to message #1756196] Mon, 13 March 2017 18:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10424
Registered: July 2009
Senior Member
Sorry I have no idea
Did you do some debugging?
Re: 2 OutputConfiguration's on Idea with Error [message #1756201 is a reply to message #1756198] Mon, 13 March 2017 19:10 Go to previous message
Hartmut Kalk is currently offline Hartmut KalkFriend
Messages: 3
Registered: July 2009
Junior Member
I did the same in eclipse and everything is working well. I thing i'll use eclipse for first time.
Thx for your help!
Previous Topic:Input with multiple alternatives
Next Topic:Maven not able to find MWE2 file referred by unit tests.
Goto Forum:
  


Current Time: Tue Apr 25 07:30:42 GMT 2017

Powered by FUDForum. Page generated in 0.03422 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software