Add support for conditionally linking dependencies based on platform (#1087)

* Add initial support for conditional platform dependencies

* Add tests for conditional platforms

* Update docs and changelog

* Respond to PR feedback

* Change name of field from 'conditionalPlatforms' to 'platforms'

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
This commit is contained in:
Dalton Claybrook
2021-06-20 20:19:02 +10:00
committed by GitHub
co-authored by Yonas Kolb
parent 4455919be3
commit 81bd52be4b
9 changed files with 80 additions and 27 deletions
@@ -354,9 +354,9 @@ class PBXProjGeneratorTests: XCTestCase {
let target1 = Target(name: "TestAll", type: .application, platform: .iOS, sources: ["Sources"])
let target2 = Target(name: "TestiOS", type: .application, platform: .iOS, sources: ["Sources"])
let target3 = Target(name: "TestmacOS", type: .application, platform: .iOS, sources: ["Sources"])
let dependency1 = Dependency(type: .target, reference: "TestAll", platform: .all)
let dependency2 = Dependency(type: .target, reference: "TestiOS", platform: .iOS)
let dependency3 = Dependency(type: .target, reference: "TestmacOS", platform: .macOS)
let dependency1 = Dependency(type: .target, reference: "TestAll", platformFilter: .all)
let dependency2 = Dependency(type: .target, reference: "TestiOS", platformFilter: .iOS)
let dependency3 = Dependency(type: .target, reference: "TestmacOS", platformFilter: .macOS)
let target = Target(name: "Test", type: .application, platform: .iOS, sources: ["Sources"], dependencies: [dependency1, dependency2, dependency3])
let project = Project(basePath: directoryPath, name: "Test", targets: [target, target1, target2, target3])