use of org.metaborg.core.project.ProjectException in project spoofax by metaborg.
the class LangSpecGeneratorSettingsBuilder method build.
public LangSpecGeneratorSettings build(FileObject projectLocation, final ISpoofaxLanguageSpecConfigBuilder languageSpecConfigBuilder) throws ProjectException {
if (!canBuild()) {
throw new ProjectException("Cannot build incomplete configuration, missing " + Joiner.on(", ").join(stillMissing()));
}
if (groupId == null) {
groupId = defaultGroupId;
}
if (version == null) {
version = defaultVersion;
}
if (syntaxType == null) {
syntaxType = defaultSyntaxType;
}
if (analysisType == null) {
analysisType = defaultAnalysisType;
}
if (metaborgVersion == null) {
metaborgVersion = defaultMetaborgVersion;
}
final LanguageIdentifier identifier = new LanguageIdentifier(groupId, id, version);
final ISpoofaxLanguageSpecConfig config = languageSpecConfigBuilder.withIdentifier(identifier).withName(name).build(projectLocation);
final GeneratorSettings generatorSettings = new GeneratorSettings(projectLocation, config, analysisType);
generatorSettings.setMetaborgVersion(metaborgVersion);
return new LangSpecGeneratorSettings(generatorSettings, extensions, syntaxType);
}
Aggregations