private static void addAllIfNotPresent( SoyFileSet.Builder builder, SoyFileKind kind, String inputPrefix, Collection<String> files, Set<String> soFar) { for (String file : files) { if (soFar.add(file)) { builder.addWithKind(new File(inputPrefix + file), kind); } } } }
sfsBuilder.addWithKind(new File(inputPrefix + src), SoyFileKind.SRC); sfsBuilder.addWithKind(new File(inputPrefix + src), SoyFileKind.SRC); sfsBuilder.addWithKind(new File(inputPrefix + dep), SoyFileKind.DEP);
private void addAllIfNotPresent( SoyFileSet.Builder builder, SoyFileKind kind, Collection<String> files, Set<String> soFar) { for (String file : files) { if (soFar.add(file)) { builder.addWithKind( soyCompilerFileReader.read(file).asCharSource(StandardCharsets.UTF_8), kind, file); } } } }
/** * Adds an input Soy file, given a resource {@code URL}. * * <p> Important: This function assumes that the desired file path is returned by * {@code inputFileUrl.toString()}. If this is not the case, please use * {@link #add(URL, String)} instead. * * @see #add(URL, String) * @param inputFileUrl The Soy file. * @return This builder. */ public Builder add(URL inputFileUrl) { return addWithKind(inputFileUrl, SoyFileKind.SRC); }
/** * Adds an input Soy file, given a resource {@code URL}. * * <p>Important: This function assumes that the desired file path is returned by {@code * inputFileUrl.toString()}. If this is not the case, please use {@link #add(URL, String)} * instead. * * @see #add(URL, String) * @param inputFileUrl The Soy file. * @return This builder. */ public Builder add(URL inputFileUrl) { return addWithKind(inputFileUrl, SoyFileKind.SRC); }
/** * Adds an input Soy file, given a resource {@code URL}. * * <p>Important: This function assumes that the desired file path is returned by {@code * inputFileUrl.toString()}. If this is not the case, please use {@link #add(URL, String)} * instead. * * @see #add(URL, String) * @param inputFileUrl The Soy file. * @return This builder. */ public Builder add(URL inputFileUrl) { return addWithKind(inputFileUrl, 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 {@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 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 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 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); }
/** * 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 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 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); }
/** * 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 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); }