use of com.facebook.buck.apple.project_generator.ProjectGenerator in project buck by facebook.
the class ProjectCommandTests method generateWorkspacesForTargets.
public static Map<Path, ProjectGenerator> generateWorkspacesForTargets(TargetGraph targetGraph, ImmutableSet<BuildTarget> passedInTargetsSet, boolean isWithTests, boolean isWithDependenciesTests, boolean isReadonly, boolean isBuildWithBuck, boolean isCombinedProjects) throws IOException, InterruptedException {
TargetGraphAndTargets targetGraphAndTargets = ProjectCommandTests.createTargetGraph(targetGraph, ProjectCommand.Ide.XCODE, passedInTargetsSet, isWithTests, isWithDependenciesTests);
Map<Path, ProjectGenerator> projectGenerators = new HashMap<>();
ProjectCommand.generateWorkspacesForTargets(ProjectCommandTests.createCommandRunnerParamsForTests(), targetGraphAndTargets, passedInTargetsSet, ProjectCommand.buildWorkspaceGeneratorOptions(isReadonly, isWithTests, isWithDependenciesTests, isCombinedProjects, true, /* shouldUseHeaderMaps */
false, /* shouldMergeHeaderMaps */
false), ImmutableList.of(), Optional.empty(), projectGenerators, isBuildWithBuck, isCombinedProjects);
return projectGenerators;
}
use of com.facebook.buck.apple.project_generator.ProjectGenerator in project buck by facebook.
the class ProjectCommand method runXcodeProjectGenerator.
/**
* Run xcode specific project generation actions.
*/
int runXcodeProjectGenerator(final CommandRunnerParams params, ListeningExecutorService executor, final TargetGraphAndTargets targetGraphAndTargets, ImmutableSet<BuildTarget> passedInTargetsSet) throws IOException, InterruptedException {
int exitCode = 0;
AppleConfig appleConfig = new AppleConfig(params.getBuckConfig());
ImmutableSet<ProjectGenerator.Option> options = buildWorkspaceGeneratorOptions(getReadOnly(params.getBuckConfig()), isWithTests(params.getBuckConfig()), isWithDependenciesTests(params.getBuckConfig()), getCombinedProject(), appleConfig.shouldUseHeaderMapsInXcodeProject(), appleConfig.shouldMergeHeaderMapsInXcodeProject(), appleConfig.shouldGenerateHeaderSymlinkTreesOnly());
boolean shouldBuildWithBuck = buildWithBuck || shouldForceBuildingWithBuck(params.getBuckConfig(), passedInTargetsSet);
if (modulesToFocusOn != null && buildWithBuck && isBuildWithBuckDisabledWithFocus(params.getBuckConfig())) {
shouldBuildWithBuck = false;
}
ImmutableSet<BuildTarget> requiredBuildTargets = generateWorkspacesForTargets(params, targetGraphAndTargets, passedInTargetsSet, options, super.getOptions(), getFocusModules(params, executor), new HashMap<Path, ProjectGenerator>(), getCombinedProject(), shouldBuildWithBuck);
if (!requiredBuildTargets.isEmpty()) {
BuildCommand buildCommand = new BuildCommand(requiredBuildTargets.stream().map(Object::toString).collect(MoreCollectors.toImmutableList()));
exitCode = buildCommand.runWithoutHelp(params);
}
return exitCode;
}
Aggregations