use of com.facebook.buck.model.Flavor in project buck by facebook.
the class CxxBinaryDescriptionTest method mkSandboxNode.
private TargetNode<CxxBinaryDescription.Arg, ?> mkSandboxNode(BuildTarget libTarget) {
Optional<Map.Entry<Flavor, CxxLibraryDescription.Type>> type = CxxLibraryDescription.getLibType(libTarget);
Set<Flavor> flavors = Sets.newHashSet(libTarget.getFlavors());
if (type.isPresent()) {
flavors.remove(type.get().getKey());
}
BuildTarget target = BuildTarget.builder(libTarget.getUnflavoredBuildTarget()).addAllFlavors(flavors).addFlavors(CxxLibraryDescription.Type.SANDBOX_TREE.getFlavor()).build();
return new CxxBinaryBuilder(target, cxxBuckConfig).build();
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class CompDirReplacerIntegrationTest method testCompDirReplacerForArm32Bit.
@Test
public void testCompDirReplacerForArm32Bit() throws Exception {
Flavor platformFlavor = InternalFlavor.of("iphoneos-armv7");
runCompDirReplacerWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class ObjectPathsAbsolutifierIntegrationTest method testAbsolutifyingPathsForIntel32Bit.
@Test
public void testAbsolutifyingPathsForIntel32Bit() throws IOException, InterruptedException {
Flavor platformFlavor = InternalFlavor.of("iphonesimulator-i386");
runAndCheckAbsolutificationWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class KnownBuildRuleTypesTest method ocamlUsesConfiguredDefaultPlatform.
@Test
public void ocamlUsesConfiguredDefaultPlatform() throws Exception {
ProjectFilesystem filesystem = new ProjectFilesystem(temporaryFolder.getRoot());
Flavor flavor = InternalFlavor.of("flavor");
ImmutableMap<String, ImmutableMap<String, String>> sections = ImmutableMap.of("cxx", ImmutableMap.of("default_platform", flavor.toString()), "cxx#" + flavor, ImmutableMap.of());
BuckConfig buckConfig = FakeBuckConfig.builder().setSections(sections).build();
KnownBuildRuleTypes knownBuildRuleTypes = KnownBuildRuleTypes.createBuilder(buckConfig, filesystem, createExecutor(), new FakeAndroidDirectoryResolver()).build();
OcamlLibraryDescription ocamlLibraryDescription = (OcamlLibraryDescription) knownBuildRuleTypes.getDescription(knownBuildRuleTypes.getBuildRuleType("ocaml_library"));
assertThat(ocamlLibraryDescription.getOcamlBuckConfig().getCxxPlatform(), Matchers.equalTo(knownBuildRuleTypes.getCxxPlatforms().getValue(flavor)));
OcamlBinaryDescription ocamlBinaryDescription = (OcamlBinaryDescription) knownBuildRuleTypes.getDescription(knownBuildRuleTypes.getBuildRuleType("ocaml_binary"));
assertThat(ocamlBinaryDescription.getOcamlBuckConfig().getCxxPlatform(), Matchers.equalTo(knownBuildRuleTypes.getCxxPlatforms().getValue(flavor)));
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class KnownBuildRuleTypesTest method canOverrideDefaultHostPlatform.
@Test
public void canOverrideDefaultHostPlatform() throws Exception {
ProjectFilesystem filesystem = new ProjectFilesystem(temporaryFolder.getRoot());
Flavor flavor = InternalFlavor.of("flavor");
String flag = "-flag";
ImmutableMap<String, ImmutableMap<String, String>> sections = ImmutableMap.of("cxx#" + flavor, ImmutableMap.of("cflags", flag));
BuckConfig buckConfig = FakeBuckConfig.builder().setSections(sections).build();
KnownBuildRuleTypes knownBuildRuleTypes = KnownBuildRuleTypes.createBuilder(buckConfig, filesystem, createExecutor(), new FakeAndroidDirectoryResolver()).build();
assertThat(knownBuildRuleTypes.getCxxPlatforms().getValue(flavor).getCflags(), Matchers.contains(flag));
}
Aggregations