use of org.eclipse.xtext.generator.OutputConfiguration.SourceMapping in project xtext-xtend by eclipse.
the class XtendProjectConfigurator method writePreferences.
private void writePreferences(OutputConfiguration configuration, IProject project) {
ProjectScope projectPreferences = new ProjectScope(project);
IEclipsePreferences languagePreferences = projectPreferences.getNode("org.eclipse.xtend.core.Xtend");
languagePreferences.putBoolean(OptionsConfigurationBlock.isProjectSpecificPropertyKey(BuilderConfigurationBlock.PROPERTY_PREFIX), true);
languagePreferences.putBoolean(getKey(configuration, INSTALL_DSL_AS_PRIMARY_SOURCE), configuration.isInstallDslAsPrimarySource());
languagePreferences.putBoolean(getKey(configuration, HIDE_LOCAL_SYNTHETIC_VARIABLES), configuration.isHideSyntheticLocalVariables());
languagePreferences.putBoolean(getKey(configuration, USE_OUTPUT_PER_SOURCE_FOLDER), true);
for (SourceMapping sourceMapping : configuration.getSourceMappings()) {
languagePreferences.put(getOutputForSourceFolderKey(configuration, sourceMapping.getSourceFolder()), Strings.nullToEmpty(sourceMapping.getOutputDirectory()));
}
try {
languagePreferences.flush();
} catch (BackingStoreException e) {
throw new RuntimeIOException(e);
}
}
use of org.eclipse.xtext.generator.OutputConfiguration.SourceMapping in project xtext-xtend by eclipse.
the class XtendProjectConfigurator method readCompileConfig.
private void readCompileConfig(OutputConfiguration config, ProjectConfigurationRequest request, MojoExecution execution) throws CoreException {
for (String source : request.getMavenProject().getCompileSourceRoots()) {
SourceMapping mapping = new SourceMapping(makeProjectRelative(source, request));
String outputDirectory = mojoParameterValue("outputDirectory", String.class, request, execution);
mapping.setOutputDirectory(makeProjectRelative(outputDirectory, request));
config.getSourceMappings().add(mapping);
}
}
use of org.eclipse.xtext.generator.OutputConfiguration.SourceMapping in project xtext-xtend by eclipse.
the class XtendProjectConfigurator method readTestCompileConfig.
private void readTestCompileConfig(OutputConfiguration config, ProjectConfigurationRequest request, MojoExecution execution) throws CoreException {
for (String source : request.getMavenProject().getTestCompileSourceRoots()) {
SourceMapping mapping = new SourceMapping(makeProjectRelative(source, request));
String testOutputDirectory = mojoParameterValue("testOutputDirectory", String.class, request, execution);
mapping.setOutputDirectory(makeProjectRelative(testOutputDirectory, request));
config.getSourceMappings().add(mapping);
}
}
Aggregations