Skip to content

Commit

Permalink
Rename method for resolving platformFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
waltflanagan committed Nov 27, 2023
1 parent 92939aa commit 842c4a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Sources/TuistCore/Graph/GraphTraverser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public class GraphTraverser: GraphTraversing {
/// - Returns: PlatformFilters to apply to transitive dependency or `nil` if there isnt a path or path to a dependency results
/// in a disjoint
/// set of platform filters
func platformFilters(from rootDependency: GraphDependency, to transitiveDependency: GraphDependency) -> PlatformFilters {
func platformFilters(to transitiveDependency: GraphDependency, from rootDependency: GraphDependency) -> PlatformFilters {
var visited: Set<GraphDependency> = []

func find(from root: GraphDependency, to other: GraphDependency) -> PlatformFilters {
Expand Down Expand Up @@ -830,7 +830,7 @@ public class GraphTraverser: GraphTraversing {
to toDependency: GraphDependency,
from fromDependency: GraphDependency
) -> GraphDependencyReference? {
let platformFilters = platformFilters(from: fromDependency, to: toDependency)
let platformFilters = platformFilters(to: toDependency, from: fromDependency)
guard platformFilters != .invalid else {
return nil
}
Expand Down
16 changes: 8 additions & 8 deletions Tests/TuistCoreTests/Graph/GraphTraverserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4277,7 +4277,7 @@ final class GraphTraverserTests: TuistUnitTestCase {
let subject = GraphTraverser(graph: graph)

// When
let results = try XCTUnwrap(subject.platformFilters(from: appkGraphDependency, to: sdkGraphDependency))
let results = try XCTUnwrap(subject.platformFilters(to: sdkGraphDependency, from: appkGraphDependency))

// Then
XCTAssertEqual(results.sorted(), [
Expand Down Expand Up @@ -4327,7 +4327,7 @@ final class GraphTraverserTests: TuistUnitTestCase {
let subject = GraphTraverser(graph: graph)

// When
let results = subject.platformFilters(from: appkGraphDependency, to: sdkGraphDependency)
let results = subject.platformFilters(to: sdkGraphDependency, from: appkGraphDependency)

// Then
XCTAssertEqual(results, .invalid)
Expand Down Expand Up @@ -4372,7 +4372,7 @@ final class GraphTraverserTests: TuistUnitTestCase {
let subject = GraphTraverser(graph: graph)

// When
let results = subject.platformFilters(from: appkGraphDependency, to: sdkGraphDependency)
let results = subject.platformFilters(to: sdkGraphDependency, from: appkGraphDependency)

// Then
XCTAssertEqual(results.sorted(), [
Expand Down Expand Up @@ -4440,13 +4440,13 @@ final class GraphTraverserTests: TuistUnitTestCase {

// When
let appToStaticFilters = subject.platformFilters(
from: appkGraphDependency,
to: staticFrameworkCGraphDependency
to: staticFrameworkCGraphDependency,
from: appkGraphDependency
)

let appToSDKFilters = subject.platformFilters(
from: appkGraphDependency,
to: sdkGraphDependency
to: sdkGraphDependency,
from: appkGraphDependency
)

// Then
Expand Down Expand Up @@ -4517,7 +4517,7 @@ final class GraphTraverserTests: TuistUnitTestCase {
let subject = GraphTraverser(graph: graph)

// When
let results = subject.platformFilters(from: appkGraphDependency, to: staticFrameworkCGraphDependency)
let results = subject.platformFilters(to: staticFrameworkCGraphDependency, from: appkGraphDependency)

// Then
XCTAssertEqual(results, .all)
Expand Down

0 comments on commit 842c4a6

Please sign in to comment.