String outputPathFormat, String inputFilePathPrefix, SoyJsSrcOptions jsSrcOptions,
List<String> locales, @Nullable String messageFilePathFormat)
throws SoySyntaxException, IOException {
boolean doEnforceSyntaxVersionV2 = ! jsSrcOptions.shouldAllowDeprecatedSyntax();
SoyFileSetNode soyTree = (new SoyFileSetParser(soyFileSuppliers))
.setDoEnforceSyntaxVersionV2(doEnforceSyntaxVersionV2).parse();
runMiddleendPasses(soyTree, doEnforceSyntaxVersionV2);
if (locales.size() == 0) {
// Not generating localized JS.
jsSrcMainProvider.get().genJsFiles(
soyTree, jsSrcOptions, null, null, outputPathFormat, inputFilePathPrefix);
} else {
// Generating localized JS.
for (String locale : locales) {
SoyFileSetNode soyTreeClone = soyTree.clone();
String msgFilePath =
JsSrcUtils.buildFilePath(messageFilePathFormat, locale, null, inputFilePathPrefix);
SoyMsgBundle msgBundle =