/** * Adds an input Soy file, given a {@code CharSource} for the file content, as well as the * desired file path for messages. * * @param contentSource Source for the Soy file content. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(CharSource contentSource, String filePath) { return addWithKind(contentSource, SoyFileKind.SRC, filePath); }
/** * Prints an error message and the usage string, and then exits. * * @param errorMsg The error message to print. */ static final RuntimeException exitWithError(String errorMsg) { throw new CommandLineError("Error: " + errorMsg); }
/** * Generates Java classes containing Soy parse info. * * <p>If syntax errors are encountered, no output is generated and the process terminates with a * non-zero exit status. On successful parse, the process terminates with a zero exit status. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(final String[] args) throws IOException { new SoyParseInfoGenerator().runMain(args); }
/** * Compiles a set of Soy files into corresponding JS source files. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(final String[] args) throws IOException { new SoyToJsSrcCompiler().runMain(args); }
/** * Extracts messages from a set of Soy files into an output messages file. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(String... args) throws IOException { new SoyMsgExtractor().runMain(args); }
/** * Extracts messages from a set of Soy files into an output messages file. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. * @throws SoySyntaxException If a syntax error is detected. */ public static void main(String... args) throws IOException { (new SoyMsgExtractor()).execMain(args); }
/** * Compiles a set of Soy files into corresponding Python source files. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(final String[] args) throws IOException { new SoyToPySrcCompiler().runMain(args); }
@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
/** * Adds an input Soy file, given a resource {@code URL}, as well as the desired file path for * messages. * * @param inputFileUrl The Soy file. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(URL inputFileUrl, String filePath) { return addWithKind(inputFileUrl, SoyFileKind.SRC, filePath); }
/** * Compiles a set of Soy files into corresponding JS source files. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(final String[] args) throws IOException { new SoyToJsSrcCompiler().runMain(args); }
/** * Extracts messages from a set of Soy files into an output messages file. * * @param args Should contain command-line flags and the list of paths to the Soy files. * @throws IOException If there are problems reading the input files or writing the output file. */ public static void main(String... args) throws IOException { new SoyMsgExtractor().runMain(args); }
@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
/** * Adds an input Soy file, given the file content provided as a string, as well as the desired * file path for messages. * * @param content The Soy file content. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(CharSequence content, String filePath) { return addWithKind(content, SoyFileKind.SRC, filePath); }
/** * Adds an input Soy file, given a {@code File}. * * @param inputFile The Soy file. * @return This builder. */ public Builder add(File inputFile) { return addWithKind(inputFile, SoyFileKind.SRC); }
/** * Adds an input Soy file, given the file content provided as a string, as well as the desired * file path for messages. * * @param content The Soy file content. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(CharSequence content, String filePath) { return addWithKind(content, SoyFileKind.SRC, filePath); }
/** * Adds an input Soy file, given an {@code InputSupplier} for the file content, as well as the * desired file path for messages. * * @param contentSupplier Supplier of a Reader for the Soy file content. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(InputSupplier<? extends Reader> contentSupplier, String filePath) { return addWithKind(contentSupplier, SoyFileKind.SRC, filePath); }
/** * Adds an input Soy file, given a {@code File}. * * @param inputFile The Soy file. * @return This builder. */ public Builder add(File inputFile) { return addWithKind(inputFile, SoyFileKind.SRC); }
/** * Adds an input Soy file, given the file content provided as a string, as well as the desired * file path for messages. * * @param content The Soy file content. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(CharSequence content, String filePath) { return addWithKind(content, SoyFileKind.SRC, filePath); }
/** * Adds an input Soy file, given a resource {@code URL}, as well as the desired file path for * messages. * * @param inputFileUrl The Soy file. * @param filePath The path to the Soy file (used for messages only). * @return This builder. */ public Builder add(URL inputFileUrl, String filePath) { return addWithKind(inputFileUrl, SoyFileKind.SRC, filePath); }
/** * Adds an input Soy file, given a {@code File}. * * @param inputFile The Soy file. * @return This builder. */ public Builder add(File inputFile) { return addWithKind(inputFile, SoyFileKind.SRC); }