Search in sources :

Example 1 with TargetGraphAndTargets

use of com.facebook.buck.rules.TargetGraphAndTargets in project buck by facebook.

the class ProjectCommandIntellijTest method testCreateTargetGraphWithTests.

@Test
public void testCreateTargetGraphWithTests() {
    TargetGraphAndTargets targetGraphAndTargets = ProjectCommandTests.createTargetGraph(targetGraph, ProjectCommand.Ide.INTELLIJ, ImmutableSet.of(), /* withTests = */
    true, /* withDependenciesTests = */
    true);
    assertEquals(ImmutableSortedSet.<TargetNode<?, ?>>of(dummyRootBinNode, dummyProjectNode, fooProjectNode, fooBinNode, fooLibNode, fooBinTestNode, fooTestNode, barLibNode, bazProjectNode, bazLibNode, bazTestNode), ImmutableSortedSet.copyOf(targetGraphAndTargets.getTargetGraph().getNodes()));
}
Also used : TargetGraphAndTargets(com.facebook.buck.rules.TargetGraphAndTargets) Test(org.junit.Test)

Example 2 with TargetGraphAndTargets

use of com.facebook.buck.rules.TargetGraphAndTargets in project buck by facebook.

the class ProjectCommandIntellijTest method testCreateTargetGraphForSmallSliceWithoutTests.

@Test
public void testCreateTargetGraphForSmallSliceWithoutTests() {
    TargetGraphAndTargets targetGraphAndTargets = ProjectCommandTests.createTargetGraph(targetGraph, ProjectCommand.Ide.INTELLIJ, ImmutableSet.of(bazProjectNode.getBuildTarget()), /* withTests = */
    false, /* withDependenciesTests = */
    false);
    assertEquals(ImmutableSortedSet.of(dummyRootBinNode, dummyProjectNode, bazProjectNode, bazLibNode), ImmutableSortedSet.copyOf(targetGraphAndTargets.getTargetGraph().getNodes()));
}
Also used : TargetGraphAndTargets(com.facebook.buck.rules.TargetGraphAndTargets) Test(org.junit.Test)

Example 3 with TargetGraphAndTargets

use of com.facebook.buck.rules.TargetGraphAndTargets in project buck by facebook.

the class ProjectCommandIntellijTest method testCreateTargetGraphWithoutTests.

@Test
public void testCreateTargetGraphWithoutTests() {
    TargetGraphAndTargets targetGraphAndTargets = ProjectCommandTests.createTargetGraph(targetGraph, ProjectCommand.Ide.INTELLIJ, ImmutableSet.of(), /* withTests = */
    false, /* withDependenciesTests = */
    false);
    assertEquals(ImmutableSortedSet.<TargetNode<?, ?>>of(dummyRootBinNode, dummyProjectNode, fooProjectNode, fooBinNode, fooLibNode, barLibNode, bazProjectNode, bazLibNode), ImmutableSortedSet.copyOf(targetGraphAndTargets.getTargetGraph().getNodes()));
}
Also used : TargetGraphAndTargets(com.facebook.buck.rules.TargetGraphAndTargets) Test(org.junit.Test)

Example 4 with TargetGraphAndTargets

use of com.facebook.buck.rules.TargetGraphAndTargets 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 5 with TargetGraphAndTargets

use of com.facebook.buck.rules.TargetGraphAndTargets in project buck by facebook.

the class ProjectCommandXcodeTest method testCreateTargetGraphForSmallSliceWithoutTests.

@Test
public void testCreateTargetGraphForSmallSliceWithoutTests() {
    TargetGraphAndTargets targetGraphAndTargets = ProjectCommandTests.createTargetGraph(targetGraph, ProjectCommand.Ide.XCODE, ImmutableSet.of(smallWorkspaceNode.getBuildTarget()), /* withTests = */
    false, /* withDependenciesTests */
    false);
    assertEquals(ImmutableSortedSet.of(smallWorkspaceNode, bazLibNode), ImmutableSortedSet.copyOf(targetGraphAndTargets.getTargetGraph().getNodes()));
}
Also used : TargetGraphAndTargets(com.facebook.buck.rules.TargetGraphAndTargets) Test(org.junit.Test)

Aggregations

TargetGraphAndTargets (com.facebook.buck.rules.TargetGraphAndTargets)14 Test (org.junit.Test)12 ProjectGenerator (com.facebook.buck.apple.project_generator.ProjectGenerator)1 BuildFileParseException (com.facebook.buck.json.BuildFileParseException)1 BuildTarget (com.facebook.buck.model.BuildTarget)1 BuildTargetException (com.facebook.buck.model.BuildTargetException)1 UnflavoredBuildTarget (com.facebook.buck.model.UnflavoredBuildTarget)1 ParserConfig (com.facebook.buck.parser.ParserConfig)1 TargetGraph (com.facebook.buck.rules.TargetGraph)1 HumanReadableException (com.facebook.buck.util.HumanReadableException)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Path (java.nio.file.Path)1 HashMap (java.util.HashMap)1