Search in sources :

Example 1 with ProjectGenerator

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;
}
Also used : Path(java.nio.file.Path) HashMap(java.util.HashMap) TargetGraphAndTargets(com.facebook.buck.rules.TargetGraphAndTargets) ProjectGenerator(com.facebook.buck.apple.project_generator.ProjectGenerator)

Example 2 with ProjectGenerator

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;
}
Also used : AppleConfig(com.facebook.buck.apple.AppleConfig) Path(java.nio.file.Path) BuildTarget(com.facebook.buck.model.BuildTarget) UnflavoredBuildTarget(com.facebook.buck.model.UnflavoredBuildTarget) Option(org.kohsuke.args4j.Option) WorkspaceAndProjectGenerator(com.facebook.buck.apple.project_generator.WorkspaceAndProjectGenerator) ProjectGenerator(com.facebook.buck.apple.project_generator.ProjectGenerator)

Aggregations

ProjectGenerator (com.facebook.buck.apple.project_generator.ProjectGenerator)2 Path (java.nio.file.Path)2 AppleConfig (com.facebook.buck.apple.AppleConfig)1 WorkspaceAndProjectGenerator (com.facebook.buck.apple.project_generator.WorkspaceAndProjectGenerator)1 BuildTarget (com.facebook.buck.model.BuildTarget)1 UnflavoredBuildTarget (com.facebook.buck.model.UnflavoredBuildTarget)1 TargetGraphAndTargets (com.facebook.buck.rules.TargetGraphAndTargets)1 HashMap (java.util.HashMap)1 Option (org.kohsuke.args4j.Option)1