Skip to content

Commit 44f4770

Browse files
committed
Pass library identifier unconditionally
1 parent bc2b0be commit 44f4770

4 files changed

Lines changed: 35 additions & 39 deletions

File tree

Sources/SWBCore/SpecImplementations/Tools/ProcessXCFrameworkLibrary.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ public final class ProcessXCFrameworkLibrarySpec: CommandLineToolSpec, SpecImple
4343
commandLine.append(contentsOf: ["--environment", env])
4444
}
4545

46-
// Per-arch (non-Apple) slices share a platform and library file name, so pass the identifier of the slice
47-
// task construction already selected by architecture.
48-
if XCFramework.hasPerArchSlices(platform) {
49-
commandLine.append(contentsOf: ["--library-identifier", libraryIdentifier])
50-
}
46+
commandLine.append(contentsOf: ["--library-identifier", libraryIdentifier])
5147

5248
// Use the calculated paths above to inform the process step what to copy instead of needing the action to perform the same work.
5349
commandLine.append(contentsOf: ["--target-path", copyLibraryToPath.str])

Tests/SWBBuildSystemTests/MergeableLibrariesBuildOperationTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,10 +1139,10 @@ fileprivate struct MergeableLibrariesBuildOperationTests: CoreBasedTests {
11391139
results.consumeTasksMatchingRuleTypes(taskTypesToExclude)
11401140

11411141
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1142-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1142+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
11431143
}
11441144
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1145-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1145+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
11461146
}
11471147

11481148
// Check the tasks in the target.
@@ -1252,10 +1252,10 @@ fileprivate struct MergeableLibrariesBuildOperationTests: CoreBasedTests {
12521252
results.consumeTasksMatchingRuleTypes(taskTypesToExclude)
12531253

12541254
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1255-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1255+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
12561256
}
12571257
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1258-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1258+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
12591259
}
12601260

12611261
// Check the tasks in the target.
@@ -1530,10 +1530,10 @@ fileprivate struct MergeableLibrariesBuildOperationTests: CoreBasedTests {
15301530
results.consumeTasksMatchingRuleTypes(taskTypesToExclude)
15311531

15321532
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1533-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1533+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15341534
}
15351535
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1536-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1536+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/Sources/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "ios-arm64", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15371537
}
15381538

15391539
// Check MergedFwkTarget

Tests/SWBTaskConstructionTests/MergeableLibraryTests.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,10 +1407,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
14071407
results.consumeTasksMatchingRuleTypes(tasksToIgnore)
14081408

14091409
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1410-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1410+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
14111411
}
14121412
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1413-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1413+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
14141414
}
14151415

14161416
results.checkTarget("App") { target in
@@ -1505,10 +1505,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
15051505
results.consumeTasksMatchingRuleTypes(tasksToIgnore)
15061506

15071507
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1508-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1508+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--library-identifier", "\(iossimLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15091509
}
15101510
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1511-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1511+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--library-identifier", "\(iossimLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15121512
}
15131513

15141514
results.checkTarget("App") { target in
@@ -1586,10 +1586,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
15861586
results.consumeTasksMatchingRuleTypes(tasksToIgnore)
15871587

15881588
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1589-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1589+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15901590
}
15911591
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1592-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1592+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
15931593
}
15941594

15951595
results.checkTarget("App") { target in
@@ -1659,10 +1659,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
16591659
results.consumeTasksMatchingRuleTypes(tasksToIgnore)
16601660

16611661
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1662-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1662+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
16631663
}
16641664
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1665-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1665+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--library-identifier", "\(iosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
16661666
}
16671667

16681668
results.checkTarget("App") { target in
@@ -1739,10 +1739,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
17391739
results.consumeTasksMatchingRuleTypes()
17401740

17411741
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1742-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1742+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--library-identifier", "\(iossimLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
17431743
}
17441744
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1745-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1745+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "ios", "--environment", "simulator", "--library-identifier", "\(iossimLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
17461746
}
17471747

17481748
results.checkTarget("App") { target in
@@ -1895,10 +1895,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
18951895
results.consumeTasksMatchingRuleTypes()
18961896

18971897
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1898-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "macos", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1898+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "macos", "--library-identifier", "\(macosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
18991899
}
19001900
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1901-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "macos", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1901+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "macos", "--library-identifier", "\(macosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
19021902
}
19031903

19041904
results.checkTarget("App") { target in
@@ -1993,10 +1993,10 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests {
19931993
results.consumeTasksMatchingRuleTypes()
19941994

19951995
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(fwkBaseName).xcframework")) { task in
1996-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "macos", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1996+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(fwkBaseName).xcframework", "--platform", "macos", "--library-identifier", "\(macosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
19971997
}
19981998
results.checkTask(.matchRuleType("ProcessXCFramework"), .matchRuleItemBasename("\(libBaseName).xcframework")) { task in
1999-
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "macos", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
1999+
task.checkCommandLine(["builtin-process-xcframework", "--xcframework", "\(SRCROOT)/\(libBaseName).xcframework", "--platform", "macos", "--library-identifier", "\(macosLibraryIdentifier)", "--target-path", "\(BUILT_PRODUCTS_DIR)"])
20002000
}
20012001

20022002
results.checkTarget("App") { target in

0 commit comments

Comments
 (0)