Package com.google.javascript.jscomp.deps

Examples of com.google.javascript.jscomp.deps.ClosureBundler


   * the input file name (using root-relative paths) before each file.
   */
  @VisibleForTesting
  void printBundleTo(Iterable<CompilerInput> inputs, Appendable out)
      throws IOException {
    ClosureBundler bundler = new ClosureBundler();

    for (CompilerInput input : inputs) {
      // Every module has an empty file in it. This makes it easier to implement
      // cross-module code motion.
      //
      // But it also leads to a weird edge case because
      // a) If we don't have a module spec, we create a singleton module, and
      // b) If we print a bundle file, we copy the original input files.
      //
      // This means that in the (rare) case where we have no inputs, and no
      // module spec, and we're printing a bundle file, we'll have a fake
      // input file that shouldn't be copied. So we special-case this, to
      // make all the other cases simpler.
      if (input.getName().equals(
              Compiler.createFillFileName(Compiler.SINGLETON_MODULE_NAME))) {
        Preconditions.checkState(1 == Iterables.size(inputs));
        return;
      }

      String rootRelativePath = rootRelativePathsMap.get(input.getName());
      String displayName = rootRelativePath != null
          ? rootRelativePath
          : input.getName();
      File file = new File(input.getName());
      out.append("//");
      out.append(displayName);
      out.append("\n");

      bundler.appendTo(out, input, file, inputCharset);

      out.append("\n");
    }
  }
View Full Code Here

TOP

Related Classes of com.google.javascript.jscomp.deps.ClosureBundler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.