@@ -0,0 +1,2543 @@
+package org.metaborg.spoofax.meta.core.stratego.primitive;%0A%0Aimport org.apache.commons.vfs2.FileSystemException;%0Aimport org.metaborg.core.MetaborgException;%0Aimport org.metaborg.core.build.CommonPaths;%0Aimport org.metaborg.core.context.IContext;%0Aimport org.metaborg.core.project.IProject;%0Aimport org.metaborg.spoofax.core.stratego.primitive.generic.ASpoofaxContextPrimitive;%0Aimport org.metaborg.spoofax.meta.core.project.ISpoofaxLanguageSpecService;%0Aimport org.metaborg.util.log.ILogger;%0Aimport org.metaborg.util.log.LoggerUtils;%0Aimport org.metaborg.util.resource.ResourceUtils;%0Aimport org.spoofax.interpreter.core.Tools;%0Aimport org.spoofax.interpreter.stratego.Strategy;%0Aimport org.spoofax.interpreter.terms.IStrategoTerm;%0Aimport org.spoofax.interpreter.terms.ITermFactory;%0A%0Aimport com.google.inject.Inject;%0Aimport com.google.inject.Provider;%0A%0Apublic class LanguageSpecSrcGenDirectory extends ASpoofaxContextPrimitive %7B%0A    private static final ILogger logger = LoggerUtils.logger(LanguageSpecSrcGenDirectory.class);%0A%0A    @Inject private static Provider%3CISpoofaxLanguageSpecService%3E languageSpecServiceProvider;%0A%0A%0A    @Inject public LanguageSpecSrcGenDirectory() %7B%0A        super(%22language_spec_srcgen_dir%22, 0, 0);%0A    %7D%0A%0A%0A    @Override protected IStrategoTerm call(IStrategoTerm current, Strategy%5B%5D svars, IStrategoTerm%5B%5D tvars,%0A            ITermFactory factory, IContext context) throws MetaborgException %7B%0A        final IProject project = context.project();%0A        if(project == null) %7B%0A            return null;%0A        %7D%0A        final CommonPaths paths = new CommonPaths(project.location());%0A%0A        if(languageSpecServiceProvider == null) %7B%0A            // Indicates that meta-Spoofax is not available (ISpoofaxLanguageSpecService cannot be injected), but this%0A            // should never happen because this primitive is inside meta-Spoofax. Check for null just in case.%0A            logger.debug(%22Language specification service is not available; static injection failed%22);%0A            return null;%0A        %7D%0A%0A        if(!Tools.isTermString(current)) %7B%0A            throw new MetaborgException(%22Expect a string as argument term, got %22 + current);%0A        %7D%0A        String name = Tools.asJavaString(current);%0A%0A        final String srcGenDir;%0A        try %7B%0A            srcGenDir = ResourceUtils.relativeName(paths.srcGenDir().resolveFile(name).getName(),%0A                    project.location().getName(), true);%0A        %7D catch(FileSystemException e) %7B%0A            return null;%0A        %7D%0A%0A        return factory.makeString(srcGenDir);%0A    %7D%0A%7D%0A

Add primitive as well.