Search in sources :

Example 1 with PySrcMain

use of com.google.template.soy.pysrc.internal.PySrcMain in project closure-templates by google.

the class SoyFileSet method compileToPySrcFiles.

/**
 * Compiles this Soy file set into Python source code files and writes these Python files to disk.
 *
 * @param outputPathFormat The format string defining how to build the output file path
 *     corresponding to an input file path.
 * @param inputFilePathPrefix The prefix prepended to all input file paths (can be empty string).
 * @param pySrcOptions The compilation options for the Python Src output target.
 * @throws SoyCompilationException If compilation fails.
 * @throws IOException If there is an error in opening/reading a message file or opening/writing
 *     an output JS file.
 */
void compileToPySrcFiles(String outputPathFormat, String inputFilePathPrefix, SoyPySrcOptions pySrcOptions) throws IOException {
    resetErrorReporter();
    requireStrictAutoescaping();
    ParseResult result = parse(SyntaxVersion.V2_0);
    throwIfErrorsPresent();
    new PySrcMain(apiCallScopeProvider).genPyFiles(result.fileSet(), pySrcOptions, outputPathFormat, inputFilePathPrefix, errorReporter);
    throwIfErrorsPresent();
    reportWarnings();
}
Also used : PySrcMain(com.google.template.soy.pysrc.internal.PySrcMain) ParseResult(com.google.template.soy.SoyFileSetParser.ParseResult)

Aggregations

ParseResult (com.google.template.soy.SoyFileSetParser.ParseResult)1 PySrcMain (com.google.template.soy.pysrc.internal.PySrcMain)1