Search in sources :

Example 1 with Sdf2RtgStamper

use of org.metaborg.spoofax.meta.core.pluto.stamp.Sdf2RtgStamper in project spoofax by metaborg.

the class Sdf2Rtg method build.

@Override
public OutputPersisted<File> build(Input input) throws IOException {
    requireBuild(input.origin);
    if (SpoofaxContext.BETTER_STAMPERS) {
        require(input.inputFile, new Sdf2RtgStamper(input.context));
    } else {
        require(input.inputFile);
    }
    // @formatter:off
    final Arguments arguments = new Arguments().addFile("-i", input.inputFile).add("-m", input.module).addFile("-o", input.outputFile).add("--ignore-missing-cons");
    final ExecutionResult result = new StrategoExecutor().withToolsContext().withStrategy(main_sdf2rtg_0_0.instance).withTracker(newResourceTracker(Pattern.quote("Invoking native tool") + ".*")).withName("sdf2rtg").executeCLI(arguments);
    // @formatter:on
    provide(input.outputFile);
    setState(State.finished(result.success));
    return OutputPersisted.of(input.outputFile);
}
Also used : Sdf2RtgStamper(org.metaborg.spoofax.meta.core.pluto.stamp.Sdf2RtgStamper) Arguments(org.metaborg.util.cmd.Arguments) ExecutionResult(org.metaborg.spoofax.meta.core.pluto.util.StrategoExecutor.ExecutionResult) StrategoExecutor(org.metaborg.spoofax.meta.core.pluto.util.StrategoExecutor)

Aggregations

Sdf2RtgStamper (org.metaborg.spoofax.meta.core.pluto.stamp.Sdf2RtgStamper)1 StrategoExecutor (org.metaborg.spoofax.meta.core.pluto.util.StrategoExecutor)1 ExecutionResult (org.metaborg.spoofax.meta.core.pluto.util.StrategoExecutor.ExecutionResult)1 Arguments (org.metaborg.util.cmd.Arguments)1