Search in sources :

Example 1 with JsonConcatenate

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");
}
Also used : SourcePathRuleFinder(com.facebook.buck.rules.SourcePathRuleFinder) SourcePathResolver(com.facebook.buck.rules.SourcePathResolver) JsonConcatenate(com.facebook.buck.json.JsonConcatenate)

Aggregations

JsonConcatenate (com.facebook.buck.json.JsonConcatenate)1 SourcePathResolver (com.facebook.buck.rules.SourcePathResolver)1 SourcePathRuleFinder (com.facebook.buck.rules.SourcePathRuleFinder)1