Java Code Examples for org.eclipse.xtext.generator.OutputConfiguration.SourceMapping#setOutputDirectory()

The following examples show how to use org.eclipse.xtext.generator.OutputConfiguration.SourceMapping#setOutputDirectory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandaloneBuilderTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Set<OutputConfiguration> getOutputConfigurations() {
	OutputConfiguration config = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	config.setOutputDirectory("src-gen");
	if (useOutputPerSource) {
		SourceMapping sourceMapping = new OutputConfiguration.SourceMapping("src2");
		sourceMapping.setOutputDirectory("src2-gen");
		config.getSourceMappings().add(sourceMapping);
		config.setUseOutputPerSourceFolder(true);
	}
	return ImmutableSet.of(config);
}
 
Example 2
Source File: StandaloneBuilderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Set<OutputConfiguration> getOutputConfigurations() {
	OutputConfiguration config = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	config.setOutputDirectory("src-gen");
	if (useOutputPerSource) {
		SourceMapping sourceMapping = new OutputConfiguration.SourceMapping("src2");
		sourceMapping.setOutputDirectory("src2-gen");
		config.getSourceMappings().add(sourceMapping);
		config.setUseOutputPerSourceFolder(true);
	}
	return ImmutableSet.of(config);
}
 
Example 3
Source File: EclipseOutputConfigurationProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.6
 */
protected OutputConfiguration createAndOverlayOutputConfiguration(IProject project, IPreferenceStore store, OutputConfiguration output) {
	OutputConfiguration result = createAndOverlayOutputConfiguration(store, output);
	if (project != null && sourceFolderProvider != null) {
		for (IContainer sourceContainer : sourceFolderProvider.getSourceFolders(project)) {
			String sourceFolder = toProjectRelativePath(sourceContainer).toString();
			SourceMapping mapping = new SourceMapping(sourceFolder);
			mapping.setOutputDirectory(getOutputForSourceFolder(store, output, sourceFolder));
			mapping.setIgnore(isIgnoreSourceFolder(store, output, sourceFolder));
			result.getSourceMappings().add(mapping);
		}
	}
	return result;
}
 
Example 4
Source File: XtendProjectConfigurator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
private void readCompileConfig(OutputConfiguration config, ProjectConfigurationRequest request,
		MojoExecution execution, SubMonitor progress) throws CoreException {
	List<String> roots = request.getMavenProject().getCompileSourceRoots();
	progress = SubMonitor.convert(progress, roots.size());
	for (String source : roots) {
		SourceMapping mapping = new SourceMapping(makeProjectRelative(source, request));
		String outputDirectory = mojoParameterValue("outputDirectory", String.class, request, execution, progress);
		mapping.setOutputDirectory(makeProjectRelative(outputDirectory, request));
		config.getSourceMappings().add(mapping);
	}
}
 
Example 5
Source File: XtendProjectConfigurator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
private void readTestCompileConfig(OutputConfiguration config, ProjectConfigurationRequest request,
		MojoExecution execution, SubMonitor progress) throws CoreException {
	List<String> roots = request.getMavenProject().getTestCompileSourceRoots();
	progress = SubMonitor.convert(progress, roots.size());
	for (String source : roots) {
		SourceMapping mapping = new SourceMapping(makeProjectRelative(source, request));
		String testOutputDirectory = mojoParameterValue("testOutputDirectory", String.class, request, execution, progress);
		mapping.setOutputDirectory(makeProjectRelative(testOutputDirectory, request));
		config.getSourceMappings().add(mapping);
	}
}