@Test public void failsToLoad() { List<TsConfigFile> tsConfigFiles = singletonList(new TsConfigFile("tsconfig/path", emptyList(), emptyList())); Map<TsConfigFile, List<InputFile>> result = TsConfigFile.inputFilesByTsConfig(tsConfigFiles, emptyList()); assertThat(result).isEmpty(); }
static Map<TsConfigFile, List<InputFile>> inputFilesByTsConfig(List<TsConfigFile> tsConfigFiles, List<InputFile> inputFiles) { Map<TsConfigFile, List<InputFile>> result = new LinkedHashMap<>(); inputFiles.forEach(inputFile -> { TsConfigFile tsconfig = tsConfigFiles.stream() .filter(tsConfigFile -> tsConfigFile.test(inputFile)) .findFirst().orElse(UNMATCHED_CONFIG); LOG.debug("{} matched {}", inputFile.absolutePath(), tsconfig); result.computeIfAbsent(tsconfig, t -> new ArrayList<>()).add(inputFile); }); return result; }
TsConfigFile implements Predicate<InputFile> { static Map<TsConfigFile, List<InputFile>> inputFilesByTsConfig(List<TsConfigFile> tsConfigFiles, List<InputFile> inputFiles) { Map<TsConfigFile, List<InputFile>> result = new LinkedHashMap<>(); inputFiles.forEach(inputFile -> { TsConfigFile tsconfig = tsConfigFiles.stream() .filter(tsConfigFile -> tsConfigFile.test(inputFile)) .findFirst().orElse(UNMATCHED_CONFIG); LOG.debug("{} matched {}", inputFile.absolutePath(), tsconfig); result.computeIfAbsent(tsconfig, t -> new ArrayList<>()).add(inputFile); }); return result; } }
TsConfigFile implements Predicate<InputFile> { static Map<TsConfigFile, List<InputFile>> inputFilesByTsConfig(List<TsConfigFile> tsConfigFiles, List<InputFile> inputFiles) { Map<TsConfigFile, List<InputFile>> result = new LinkedHashMap<>(); inputFiles.forEach(inputFile -> { TsConfigFile tsconfig = tsConfigFiles.stream() .filter(tsConfigFile -> tsConfigFile.test(inputFile)) .findFirst().orElse(UNMATCHED_CONFIG); LOG.debug("{} matched {}", inputFile.absolutePath(), tsconfig); result.computeIfAbsent(tsconfig, t -> new ArrayList<>()).add(inputFile); }); return result; } TsConfigFile(String filename, List<String> files, List<String> projectReferences); }
TsConfigFile implements Predicate<InputFile> { static Map<TsConfigFile, List<InputFile>> inputFilesByTsConfig(List<TsConfigFile> tsConfigFiles, List<InputFile> inputFiles) { Map<TsConfigFile, List<InputFile>> result = new LinkedHashMap<>(); inputFiles.forEach(inputFile -> { TsConfigFile tsconfig = tsConfigFiles.stream() .filter(tsConfigFile -> tsConfigFile.test(inputFile)) .findFirst().orElse(UNMATCHED_CONFIG); LOG.debug("{} matched {}", inputFile.absolutePath(), tsconfig); result.computeIfAbsent(tsconfig, t -> new ArrayList<>()).add(inputFile); }); return result; } TsConfigFile(String filename, List<String> files, List<String> projectReferences); @Override boolean test(InputFile inputFile); @Override String toString(); }
TsConfigFile implements Predicate<InputFile> { static Map<TsConfigFile, List<InputFile>> inputFilesByTsConfig(List<TsConfigFile> tsConfigFiles, List<InputFile> inputFiles) { Map<TsConfigFile, List<InputFile>> result = new LinkedHashMap<>(); inputFiles.forEach(inputFile -> { TsConfigFile tsconfig = tsConfigFiles.stream() .filter(tsConfigFile -> tsConfigFile.test(inputFile)) .findFirst().orElse(UNMATCHED_CONFIG); LOG.debug("{} matched {}", inputFile.absolutePath(), tsconfig); result.computeIfAbsent(tsconfig, t -> new ArrayList<>()).add(inputFile); }); return result; } TsConfigFile(String filename, List<String> files, List<String> projectReferences); @Override boolean test(InputFile inputFile); @Override String toString();  }