Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » A slot with name 'uml-gen' has not been configured exception
A slot with name 'uml-gen' has not been configured exception [message #1755647] Mon, 06 March 2017 14:11
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 98
Registered: March 2010
Member
We are working on extended Domainmodel. This produces two kinds of code, Java source code and PlantUML data (text data). Currently we do not have issues under eclipse, but when we move to outside of eclipse, things change a lot.

We use maven for grammar project, and gradle for example project. We followed xtextcast EPISODE #16 for output configuration. When trying to build example project, I get 'A slot with name 'uml-gen' has not been configured' exception ('uml-gen' is a folder/directory to store generated PlantUML data). I tried various modifications but no luck.

I searched 'uml-gen' in our grammar project, and found the following occurrences (BTW project name is modified).

- ModelOutputConfigurationProvider.java (grammar project)
public class ModelOutputConfigurationProvider implements IOutputConfigurationProvider {

	public static final String DEFAULT_OUTPUT = "src-gen";
	public static final String DIAGRAM_OUTPUT = "uml-gen";

	/**
	 * @return a set of {@link OutputConfiguration} available for the generator
	 */
	public Set<OutputConfiguration> getOutputConfigurations() {
		
		OutputConfiguration 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);

		OutputConfiguration diagramOutput = new OutputConfiguration(DIAGRAM_OUTPUT);
		diagramOutput.setDescription("PlantUML output Folder");
		diagramOutput.setOutputDirectory("./uml-gen");
		diagramOutput.setOverrideExistingResources(false);
		diagramOutput.setCreateOutputDirectory(true);
		diagramOutput.setCleanUpDerivedResources(true);
		diagramOutput.setSetDerivedProperty(true);

		return newHashSet(defaultOutput, diagramOutput);
	}
}


- generator workflow file (grammar project)
module com.example.domain.Generator

import org.eclipse.emf.mwe.utils.*

var srcDirModel = "src/main/model"
var targetDir = "uml-gen"

Workflow {
    component = DirectoryCleaner {
        directory = "${targetDir}"
    }
    
    component = org.eclipse.xtext.mwe.Reader {
    	register = ModelStandaloneSetup {}
    	loadResource = {
    		slot = "model"
    	}
    	path = srcDirModel
    }
    component = org.eclipse.xtext.generator.GeneratorComponent {
    	register = ModelStandaloneSetup {}
    	slot = "model"
    	outlet = {
    		outletName = "uml-gen"
    		path = targetDir
    	}
    }
}


and, 'build.gradle' (example project)
xtext {
    languages {
        model {
            fileExtension = 'model'
            setup = 'com.example.domain.ModelStandaloneSetup'
            qualifiedName = 'com.example.domain.Model'
			generator.outlet.producesJava = true
        }
    }
    sourceSets {
        main {
            srcDir 'src/main/model'
			output {
				dir(xtext.languages.model.generator.outlet,'uml-gen')
			}
        }
    }
}


Before applying this setting/configuration, I tested with MyDsl, and I got no such exception by doing the same gradle build ("./gradlew clean build").

I would appreciate any advice on which part of the code (and what) I should check.

Akira
Previous Topic:How to run automatically generated java file has a method main in Xtext generator ?
Next Topic:Inheriting from Java based validator fails due to changed naming
Goto Forum:
  


Current Time: Fri Apr 19 22:53:26 GMT 2024

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

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

Back to the top