use of com.facebook.buck.model.Flavor in project buck by facebook.
the class ObjectPathsAbsolutifierIntegrationTest method testAbsolutifyingPathsForIntel64Bit.
@Test
public void testAbsolutifyingPathsForIntel64Bit() throws IOException, InterruptedException {
Flavor platformFlavor = InternalFlavor.of("iphonesimulator-x86_64");
runAndCheckAbsolutificationWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class ObjectPathsAbsolutifierIntegrationTest method testAbsolutifyingPathsForArm64Bit.
@Test
public void testAbsolutifyingPathsForArm64Bit() throws IOException, InterruptedException {
Flavor platformFlavor = InternalFlavor.of("iphoneos-arm64");
runAndCheckAbsolutificationWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class ObjectPathsAbsolutifierIntegrationTest method testAbsolutifyingPathsForArm32Bit.
@Test
public void testAbsolutifyingPathsForArm32Bit() throws IOException, InterruptedException {
Flavor platformFlavor = InternalFlavor.of("iphoneos-armv7");
runAndCheckAbsolutificationWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class CompDirReplacerIntegrationTest method testCompDirReplacerForIntel64Bit.
@Test
public void testCompDirReplacerForIntel64Bit() throws Exception {
Flavor platformFlavor = InternalFlavor.of("iphonesimulator-x86_64");
runCompDirReplacerWithPlatformFlavor(platformFlavor);
}
use of com.facebook.buck.model.Flavor in project buck by facebook.
the class AndroidPrebuiltAarDescription method createBuildRule.
@Override
public <A extends Arg> BuildRule createBuildRule(TargetGraph targetGraph, BuildRuleParams params, BuildRuleResolver buildRuleResolver, A args) throws NoSuchBuildTargetException {
SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(buildRuleResolver);
ImmutableSet<Flavor> flavors = params.getBuildTarget().getFlavors();
if (flavors.contains(AAR_UNZIP_FLAVOR)) {
Preconditions.checkState(flavors.size() == 1);
BuildRuleParams unzipAarParams = params.copyReplacingDeclaredAndExtraDeps(Suppliers.ofInstance(ImmutableSortedSet.of()), Suppliers.ofInstance(ImmutableSortedSet.copyOf(ruleFinder.filterBuildRuleInputs(args.aar))));
return new UnzipAar(unzipAarParams, args.aar);
}
BuildRule unzipAarRule = buildRuleResolver.requireRule(params.getBuildTarget().withFlavors(AAR_UNZIP_FLAVOR));
Preconditions.checkState(unzipAarRule instanceof UnzipAar, "aar_unzip flavor created rule of unexpected type %s for target %s", unzipAarRule.getClass(), params.getBuildTarget());
UnzipAar unzipAar = (UnzipAar) unzipAarRule;
if (CalculateAbi.isAbiTarget(params.getBuildTarget())) {
return CalculateAbi.of(params.getBuildTarget(), ruleFinder, params, new ExplicitBuildTargetSourcePath(unzipAar.getBuildTarget(), unzipAar.getPathToClassesJar()));
}
SourcePathResolver pathResolver = new SourcePathResolver(ruleFinder);
Iterable<PrebuiltJar> javaDeps = Iterables.concat(Iterables.filter(buildRuleResolver.getAllRules(args.deps), PrebuiltJar.class), Iterables.transform(Iterables.filter(buildRuleResolver.getAllRules(args.deps), AndroidPrebuiltAar.class), AndroidPrebuiltAar::getPrebuiltJar));
if (flavors.contains(AAR_PREBUILT_JAR_FLAVOR)) {
Preconditions.checkState(flavors.size() == 1, "Expected only flavor to be %s but also found %s", AAR_PREBUILT_JAR_FLAVOR, flavors);
BuildRuleParams buildRuleParams = params.copyReplacingDeclaredAndExtraDeps(Suppliers.ofInstance(ImmutableSortedSet.copyOf(javaDeps)), Suppliers.ofInstance(ImmutableSortedSet.of(unzipAar)));
return new PrebuiltJar(/* params */
buildRuleParams, /* resolver */
pathResolver, /* binaryJar */
new ExplicitBuildTargetSourcePath(unzipAar.getBuildTarget(), unzipAar.getPathToClassesJar()), /* sourceJar */
Optional.empty(), /* gwtJar */
Optional.empty(), /* javadocUrl */
Optional.empty(), /* mavenCoords */
Optional.empty(), /* provided */
false);
}
BuildRule prebuiltJarRule = buildRuleResolver.requireRule(BuildTargets.createFlavoredBuildTarget(params.getBuildTarget().checkUnflavored(), AAR_PREBUILT_JAR_FLAVOR));
Preconditions.checkState(prebuiltJarRule instanceof PrebuiltJar, "%s flavor created rule of unexpected type %s for target %s", AAR_PREBUILT_JAR_FLAVOR, unzipAarRule.getType(), params.getBuildTarget());
PrebuiltJar prebuiltJar = (PrebuiltJar) prebuiltJarRule;
Preconditions.checkArgument(flavors.isEmpty(), "Unexpected flavors for android_prebuilt_aar: %s", flavors);
BuildRuleParams androidLibraryParams = params.copyReplacingDeclaredAndExtraDeps(/* declaredDeps */
Suppliers.ofInstance(ImmutableSortedSet.of(prebuiltJar)), /* extraDeps */
Suppliers.ofInstance(ImmutableSortedSet.of(unzipAar)));
return new AndroidPrebuiltAar(androidLibraryParams, /* resolver */
pathResolver, ruleFinder, /* proguardConfig */
new ExplicitBuildTargetSourcePath(unzipAar.getBuildTarget(), unzipAar.getProguardConfig()), /* nativeLibsDirectory */
new ExplicitBuildTargetSourcePath(unzipAar.getBuildTarget(), unzipAar.getNativeLibsDirectory()), /* prebuiltJar */
prebuiltJar, /* unzipRule */
unzipAar, /* javacOptions */
javacOptions, new JavacToJarStepFactory(javacOptions, new BootClasspathAppender()), /* exportedDeps */
javaDeps, JavaLibraryRules.getAbiInputs(buildRuleResolver, androidLibraryParams.getDeps()));
}
Aggregations