use of org.eclipse.xtext.generator.OutputConfiguration in project mechanoid by robotoworks.
the class Compiler method compile.
public void compile(String source, String sourceFolder, String stubFolder, boolean recurse) {
Map<String, OutputConfiguration> outputConfigurations = createOutputConfigurations(sourceFolder, stubFolder);
mFileSystemAccess.setOutputConfigurations(outputConfigurations);
File file = new File(System.getProperty("user.dir"), source);
if (!file.exists()) {
throw new IllegalStateException("invalid input source");
}
ArrayList<String> resourcePaths = new ArrayList<String>();
getResourcePaths(resourcePaths, file, recurse);
loadResources(resourcePaths);
List<Issue> issues = validate();
for (Issue issue : issues) {
System.out.println(issue.getCode() + ":" + issue.getMessage());
}
if (issues.size() == 0) {
generate();
}
}
use of org.eclipse.xtext.generator.OutputConfiguration in project mechanoid by robotoworks.
the class Compiler method createStubGenOutputConfiguration.
private OutputConfiguration createStubGenOutputConfiguration(String outDir) {
OutputConfiguration out = new OutputConfiguration("DEFAULT_STUB_OUTPUT");
out.setDescription("Generated Source Stubs");
out.setOutputDirectory(outDir);
out.setOverrideExistingResources(false);
out.setCreateOutputDirectory(true);
out.setCleanUpDerivedResources(false);
out.setSetDerivedProperty(false);
out.setCanClearOutputDirectory(false);
return out;
}
use of org.eclipse.xtext.generator.OutputConfiguration in project mechanoid by robotoworks.
the class Compiler method createSourceGenOutputConfiguration.
private OutputConfiguration createSourceGenOutputConfiguration(String outDir) {
OutputConfiguration out = new OutputConfiguration("DEFAULT_OUTPUT");
out.setDescription("Generated Source");
out.setOutputDirectory(outDir);
out.setOverrideExistingResources(true);
out.setCreateOutputDirectory(true);
out.setCleanUpDerivedResources(true);
out.setSetDerivedProperty(true);
out.setCanClearOutputDirectory(true);
return out;
}
use of org.eclipse.xtext.generator.OutputConfiguration in project mechanoid by robotoworks.
the class MechanoidOutputConfigurationProvider method getOutputConfigurations.
@Override
public Set<OutputConfiguration> getOutputConfigurations() {
Set<OutputConfiguration> outputConfigurations = super.getOutputConfigurations();
OutputConfiguration defaultOutput = new OutputConfiguration(DEFAULT_STUB_OUTPUT);
defaultOutput.setDescription("Stub Folder");
defaultOutput.setOutputDirectory("./src");
defaultOutput.setOverrideExistingResources(false);
defaultOutput.setCreateOutputDirectory(false);
defaultOutput.setCleanUpDerivedResources(false);
defaultOutput.setSetDerivedProperty(false);
defaultOutput.setCanClearOutputDirectory(false);
outputConfigurations.add(defaultOutput);
return outputConfigurations;
}
use of org.eclipse.xtext.generator.OutputConfiguration in project applause by applause.
the class ApplauseBuilderParticipant method getGeneratorMarkers.
/**
* @since 2.4
*/
protected Map<OutputConfiguration, Iterable<IMarker>> getGeneratorMarkers(IProject builtProject, Collection<OutputConfiguration> outputConfigurations) throws CoreException {
Map<OutputConfiguration, Iterable<IMarker>> generatorMarkers = newHashMap();
for (OutputConfiguration config : outputConfigurations) {
if (config.isCleanUpDerivedResources()) {
IContainer container = getContainer(builtProject, config.getOutputDirectory());
final Iterable<IMarker> markers = derivedResourceMarkers.findDerivedResourceMarkers(container, generatorIdProvider.getGeneratorIdentifier());
generatorMarkers.put(config, markers);
}
}
return generatorMarkers;
}
Aggregations