use of com.facebook.buck.rules.VersionedTool in project buck by facebook.
the class AppleCxxPlatformsTest method checkSwiftPlatformUsesCorrectMinTargetSdk.
@Test
public void checkSwiftPlatformUsesCorrectMinTargetSdk() throws IOException {
AppleCxxPlatform platformWithConfiguredSwift = buildAppleCxxPlatformWithSwiftToolchain(true);
Tool swift = platformWithConfiguredSwift.getSwiftPlatform().get().getSwift();
assertThat(swift, notNullValue());
assertThat(swift, instanceOf(VersionedTool.class));
VersionedTool versionedSwift = (VersionedTool) swift;
assertThat(versionedSwift.getExtraArgs(), hasItem("i386-apple-ios7.0"));
}
use of com.facebook.buck.rules.VersionedTool in project buck by facebook.
the class AppleCxxPlatformsTest method appleCxxPlatformWhenNoSwiftToolchainPreferredShouldUseDefaultSwift.
@Test
public void appleCxxPlatformWhenNoSwiftToolchainPreferredShouldUseDefaultSwift() throws IOException {
AppleCxxPlatform platformWithDefaultSwift = buildAppleCxxPlatformWithSwiftToolchain(true);
Optional<SwiftPlatform> swiftPlatformOptional = platformWithDefaultSwift.getSwiftPlatform();
assertThat(swiftPlatformOptional.isPresent(), is(true));
Tool swiftTool = swiftPlatformOptional.get().getSwift();
assertTrue(swiftTool instanceof VersionedTool);
assertThat(((VersionedTool) swiftTool).getPath(), equalTo(Paths.get("Toolchains/XcodeDefault.xctoolchain/usr/bin/swift")));
assertThat(swiftPlatformOptional.get().getSwiftRuntimePaths(), Matchers.empty());
}
use of com.facebook.buck.rules.VersionedTool in project buck by facebook.
the class AppleCxxPlatformsTest method appleCxxPlatformShouldUsePreferredSwiftVersion.
@Test
public void appleCxxPlatformShouldUsePreferredSwiftVersion() throws IOException {
AppleCxxPlatform platformWithConfiguredSwift = buildAppleCxxPlatformWithSwiftToolchain(false);
Optional<SwiftPlatform> swiftPlatformOptional = platformWithConfiguredSwift.getSwiftPlatform();
assertThat(swiftPlatformOptional.isPresent(), is(true));
Tool swiftTool = swiftPlatformOptional.get().getSwift();
assertThat(((VersionedTool) swiftTool).getPath(), not(equalTo(Paths.get("Toolchains/Swift_2.3.xctoolchain/usr/bin/swift"))));
assertThat(swiftPlatformOptional.get().getSwiftRuntimePaths(), equalTo(ImmutableSet.of(temp.getRoot().resolve("usr/lib/swift/iphoneos"))));
}
Aggregations