use of com.google.template.soy.jssrc.SoyJsSrcOptions in project closure-templates by google.
the class SoyToJsSrcCompiler method compile.
@Override
void compile(SoyFileSet.Builder sfsBuilder) throws IOException {
if (!syntaxVersion.isEmpty()) {
sfsBuilder.setDeclaredSyntaxVersionName(syntaxVersion);
}
sfsBuilder.setAllowExternalCalls(allowExternalCalls);
SoyFileSet sfs = sfsBuilder.build();
// Create SoyJsSrcOptions.
SoyJsSrcOptions jsSrcOptions = new SoyJsSrcOptions();
jsSrcOptions.setShouldProvideRequireSoyNamespaces(shouldProvideRequireSoyNamespaces);
jsSrcOptions.setShouldGenerateGoogMsgDefs(shouldGenerateGoogMsgDefs);
jsSrcOptions.setGoogMsgsAreExternal(googMsgsAreExternal);
jsSrcOptions.setBidiGlobalDir(bidiGlobalDir);
jsSrcOptions.setUseGoogIsRtlForBidiGlobalDir(useGoogIsRtlForBidiGlobalDir);
// Compile.
boolean generateLocalizedJs = !locales.isEmpty();
if (generateLocalizedJs) {
sfs.compileToJsSrcFiles(outputPathFormat, inputPrefix, jsSrcOptions, locales, messagePlugin, messageFilePathFormat);
} else {
sfs.compileToJsSrcFiles(outputPathFormat, inputPrefix, jsSrcOptions, locales, null, null);
}
}
Aggregations