Search in sources :

Example 6 with ISpoofaxLanguageSpecConfig

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);
}
Also used : BuildInput(org.metaborg.core.build.BuildInput) ISpoofaxLanguageSpec(org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpec) StrategoFormat(org.metaborg.spoofax.meta.core.config.StrategoFormat) SpoofaxContext(org.metaborg.spoofax.meta.core.pluto.SpoofaxContext) ISpoofaxLanguageSpecConfig(org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfig) FileObject(org.apache.commons.vfs2.FileObject) File(java.io.File) Nullable(javax.annotation.Nullable)

Aggregations

ISpoofaxLanguageSpecConfig (org.metaborg.spoofax.meta.core.config.ISpoofaxLanguageSpecConfig)6 FileObject (org.apache.commons.vfs2.FileObject)5 ISpoofaxLanguageSpec (org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpec)4 Nullable (javax.annotation.Nullable)3 BuildInput (org.metaborg.core.build.BuildInput)3 SpoofaxContext (org.metaborg.spoofax.meta.core.pluto.SpoofaxContext)3 File (java.io.File)2 LanguageIdentifier (org.metaborg.core.language.LanguageIdentifier)2 StrategoFormat (org.metaborg.spoofax.meta.core.config.StrategoFormat)2 GeneratorSettings (org.metaborg.spoofax.meta.core.generator.GeneratorSettings)2 AllFileSelector (org.apache.commons.vfs2.AllFileSelector)1 MetaborgException (org.metaborg.core.MetaborgException)1 ConfigException (org.metaborg.core.config.ConfigException)1 IExportConfig (org.metaborg.core.config.IExportConfig)1 ILanguageComponentConfig (org.metaborg.core.config.ILanguageComponentConfig)1 Sdf2tableVersion (org.metaborg.core.config.Sdf2tableVersion)1 StreamMessagePrinter (org.metaborg.core.messages.StreamMessagePrinter)1 ProjectException (org.metaborg.core.project.ProjectException)1 SdfVersion (org.metaborg.spoofax.meta.core.config.SdfVersion)1 ContinuousLanguageSpecGenerator (org.metaborg.spoofax.meta.core.generator.general.ContinuousLanguageSpecGenerator)1