use of com.facebook.buck.json.JsonConcatenate in project buck by facebook.
the class CxxDescriptionEnhancer method createUberCompilationDatabase.
public static BuildRule createUberCompilationDatabase(BuildRuleParams params, BuildRuleResolver ruleResolver) throws NoSuchBuildTargetException {
Optional<CxxCompilationDatabaseDependencies> compilationDatabases = ruleResolver.requireMetadata(params.withoutFlavor(CxxCompilationDatabase.UBER_COMPILATION_DATABASE).withAppendedFlavor(CxxCompilationDatabase.COMPILATION_DATABASE).getBuildTarget(), CxxCompilationDatabaseDependencies.class);
Preconditions.checkState(compilationDatabases.isPresent());
SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(ruleResolver);
SourcePathResolver pathResolver = new SourcePathResolver(ruleFinder);
return new JsonConcatenate(params.copyReplacingDeclaredAndExtraDeps(Suppliers.ofInstance(ImmutableSortedSet.copyOf(ruleFinder.filterBuildRuleInputs(compilationDatabases.get().getSourcePaths()))), Suppliers.ofInstance(ImmutableSortedSet.of())), pathResolver.getAllAbsolutePaths(compilationDatabases.get().getSourcePaths()), "compilation-database-concatenate", "Concatenate compilation databases", "uber-compilation-database", "compile_commands.json");
}
Aggregations