Search in sources :

Example 1 with CxxPlatforms

use of com.facebook.buck.cxx.CxxPlatforms in project buck by facebook.

the class RustTestDescription method createBuildRule.

@Override
public <A extends Arg> BuildRule createBuildRule(TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver resolver, A args) throws NoSuchBuildTargetException {
    BuildTarget exeTarget = params.getBuildTarget().withAppendedFlavors(InternalFlavor.of("unittest"));
    BinaryWrapperRule testExeBuild = resolver.addToIndex(RustCompileUtils.createBinaryBuildRule(params.withBuildTarget(exeTarget), resolver, rustBuckConfig, cxxPlatforms, defaultCxxPlatform, args.crate, args.features, Stream.of(args.framework ? Stream.of("--test") : Stream.<String>empty(), rustBuckConfig.getRustTestFlags().stream(), args.rustcFlags.stream()).flatMap(x -> x).iterator(), args.linkerFlags.iterator(), RustCompileUtils.getLinkStyle(params.getBuildTarget(), args.linkStyle), args.rpath, args.srcs, args.crateRoot, ImmutableSet.of("lib.rs", "main.rs")));
    SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(resolver);
    Tool testExe = testExeBuild.getExecutableCommand();
    BuildRuleParams testParams = params.copyAppendingExtraDeps(testExe.getDeps(ruleFinder));
    return new RustTest(testParams, ruleFinder, testExeBuild, args.labels, args.contacts);
}
Also used : Linker(com.facebook.buck.cxx.Linker) BinaryWrapperRule(com.facebook.buck.rules.BinaryWrapperRule) CellPathResolver(com.facebook.buck.rules.CellPathResolver) ToolProvider(com.facebook.buck.rules.ToolProvider) SourcePathRuleFinder(com.facebook.buck.rules.SourcePathRuleFinder) SourcePath(com.facebook.buck.rules.SourcePath) InternalFlavor(com.facebook.buck.model.InternalFlavor) Flavored(com.facebook.buck.model.Flavored) BuildRule(com.facebook.buck.rules.BuildRule) FlavorDomain(com.facebook.buck.model.FlavorDomain) Tool(com.facebook.buck.rules.Tool) ImmutableList(com.google.common.collect.ImmutableList) CxxPlatforms(com.facebook.buck.cxx.CxxPlatforms) NoSuchBuildTargetException(com.facebook.buck.parser.NoSuchBuildTargetException) ImplicitDepsInferringDescription(com.facebook.buck.rules.ImplicitDepsInferringDescription) BuildRuleParams(com.facebook.buck.rules.BuildRuleParams) ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) ImmutableSet(com.google.common.collect.ImmutableSet) TargetGraph(com.facebook.buck.rules.TargetGraph) CxxPlatform(com.facebook.buck.cxx.CxxPlatform) BuildTarget(com.facebook.buck.model.BuildTarget) SuppressFieldNotInitialized(com.facebook.infer.annotation.SuppressFieldNotInitialized) Stream(java.util.stream.Stream) AbstractDescriptionArg(com.facebook.buck.rules.AbstractDescriptionArg) VersionRoot(com.facebook.buck.versions.VersionRoot) Optional(java.util.Optional) Flavor(com.facebook.buck.model.Flavor) BuildRuleResolver(com.facebook.buck.rules.BuildRuleResolver) Description(com.facebook.buck.rules.Description) BuildRuleParams(com.facebook.buck.rules.BuildRuleParams) BuildTarget(com.facebook.buck.model.BuildTarget) SourcePathRuleFinder(com.facebook.buck.rules.SourcePathRuleFinder) BinaryWrapperRule(com.facebook.buck.rules.BinaryWrapperRule) Tool(com.facebook.buck.rules.Tool)

Aggregations

CxxPlatform (com.facebook.buck.cxx.CxxPlatform)1 CxxPlatforms (com.facebook.buck.cxx.CxxPlatforms)1 Linker (com.facebook.buck.cxx.Linker)1 BuildTarget (com.facebook.buck.model.BuildTarget)1 Flavor (com.facebook.buck.model.Flavor)1 FlavorDomain (com.facebook.buck.model.FlavorDomain)1 Flavored (com.facebook.buck.model.Flavored)1 InternalFlavor (com.facebook.buck.model.InternalFlavor)1 NoSuchBuildTargetException (com.facebook.buck.parser.NoSuchBuildTargetException)1 AbstractDescriptionArg (com.facebook.buck.rules.AbstractDescriptionArg)1 BinaryWrapperRule (com.facebook.buck.rules.BinaryWrapperRule)1 BuildRule (com.facebook.buck.rules.BuildRule)1 BuildRuleParams (com.facebook.buck.rules.BuildRuleParams)1 BuildRuleResolver (com.facebook.buck.rules.BuildRuleResolver)1 CellPathResolver (com.facebook.buck.rules.CellPathResolver)1 Description (com.facebook.buck.rules.Description)1 ImplicitDepsInferringDescription (com.facebook.buck.rules.ImplicitDepsInferringDescription)1 SourcePath (com.facebook.buck.rules.SourcePath)1 SourcePathRuleFinder (com.facebook.buck.rules.SourcePathRuleFinder)1 TargetGraph (com.facebook.buck.rules.TargetGraph)1