@GwtIncompatible("Unnecessary")
  private List<SourceFile> createSourceInputs(
      List<JsModuleSpec> jsModuleSpecs,
      List<FlagEntry<JsSourceType>> files,
      List<JsonFileSpec> jsonFiles,
      List<String> moduleRoots)
      throws IOException {
    if (isInTestMode()) {
      return inputsSupplierForTesting != null ? inputsSupplierForTesting.get()
          : null;
    }
    if (files.isEmpty() && jsonFiles == null) {
      // Request to read from stdin.
      files = ImmutableList.of(new FlagEntry<JsSourceType>(JsSourceType.JS, "-"));
    }

    for (JSError error : deduplicateIjsFiles(files, moduleRoots, !jsModuleSpecs.isEmpty())) {
      compiler.report(error);
    }

    try {
      if (jsonFiles != null) {
        return createInputs(files, jsonFiles, jsModuleSpecs);
      } else {
        return createInputs(files, true, jsModuleSpecs);
      }
    } catch (FlagUsageException e) {
      throw new FlagUsageException("Bad --js flag. " + e.getMessage());
    }
  }
@ GwtIncompatible ( "Unnecessary" ) private List < SourceFile > createSourceInputs ( List < JsModuleSpec > jsModuleSpecs , List < FlagEntry < JsSourceType > > files , List < JsonFileSpec > jsonFiles , List < String > moduleRoots ) throws IOException { if ( isInTestMode ( ) ) { return inputsSupplierForTesting != null ? inputsSupplierForTesting . get ( ) : null ; } if ( files . isEmpty ( ) && jsonFiles == null ) { files = ImmutableList . of ( new FlagEntry < JsSourceType > ( JsSourceType . JS , "-" ) ) ; } for ( JSError error : deduplicateIjsFiles ( files , moduleRoots , ! jsModuleSpecs . isEmpty ( ) ) ) { compiler . report ( error ) ; } try { if ( jsonFiles != null ) { return createInputs ( files , jsonFiles , jsModuleSpecs ) ; } else { return createInputs ( files , true , jsModuleSpecs ) ; } } catch ( FlagUsageException e ) { throw new FlagUsageException ( "Bad --js flag. " + e . getMessage ( ) ) ; } }
Creates JS source code inputs from a list of files.