use of org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfig in project spoofax by metaborg.
the class LanguageSpecBuilder method packageBuilderInput.
private PackageBuilder.Input packageBuilderInput(LanguageSpecBuildInput input, Origin origin) throws FileSystemException {
final ISpoofaxLanguageSpec languageSpec = input.languageSpec();
final ISpoofaxLanguageSpecConfig config = languageSpec.config();
final FileObject baseLoc = input.languageSpec().location();
final SpoofaxLangSpecCommonPaths paths = new SpoofaxLangSpecCommonPaths(baseLoc);
final FileObject buildInfoLoc = paths.plutoBuildInfoDir();
final SpoofaxContext context = new SpoofaxContext(baseLoc, buildInfoLoc);
final StrategoFormat strFormat = config.strFormat();
final FileObject strJavaStratFileCandidate = paths.strMainJavaStratFile(config.identifier().id);
@Nullable final File strJavaStratFile;
if (strJavaStratFileCandidate.exists()) {
strJavaStratFile = resourceService.localPath(strJavaStratFileCandidate);
} else {
strJavaStratFile = null;
}
final File javaStratClassesDir = resourceService.localPath(paths.strTargetClassesJavaStratDir(config.identifier().id));
final File dsGeneratedClassesDir = resourceService.localPath(paths.dsTargetClassesGenerateDir());
final File dsManualClassesDir = resourceService.localPath(paths.dsTargetClassesManualDir());
final List<File> strJavaStratIncludeDirs = Lists.newArrayList(javaStratClassesDir, dsGeneratedClassesDir, dsManualClassesDir);
return new PackageBuilder.Input(context, config.identifier().id, origin, strFormat, strJavaStratFile, strJavaStratIncludeDirs);
}
Aggregations