@@ -13,11 +13,45 @@ class XcodeToolsTests: XCTestCase {
13
13
14
14
let projectDirectoryPath = " PROJECT_DIRECTORY_PATH "
15
15
let scheme = " SCHEME "
16
- let projectType = ProjectType . swiftPackage
16
+
17
+ try await testArchiving (
18
+ projectDirectoryPath: projectDirectoryPath,
19
+ scheme: scheme,
20
+ projectType: . swiftPackage
21
+ )
22
+ }
23
+
24
+ func test_archive_xcodeProject( ) async throws {
25
+
26
+ let projectDirectoryPath = " PROJECT_DIRECTORY_PATH "
27
+ let scheme = " SCHEME "
28
+
29
+ try await testArchiving (
30
+ projectDirectoryPath: projectDirectoryPath,
31
+ scheme: scheme,
32
+ projectType: . xcodeProject( scheme: scheme)
33
+ )
34
+ }
35
+ }
36
+
37
+ private extension XcodeToolsTests {
38
+
39
+ func testArchiving(
40
+ projectDirectoryPath: String ,
41
+ scheme: String ,
42
+ projectType: ProjectType
43
+ ) async throws {
17
44
18
45
let archiveResult = " ARCHIVE_RESULT "
19
46
let expectedDerivedDataPath = " \( projectDirectoryPath) /.build "
20
- var expectedHandleExecuteCalls = [ " cd \( projectDirectoryPath) ; xcodebuild clean build -scheme \" \( scheme) \" -destination \" generic/platform=iOS \" -derivedDataPath .build -sdk `xcrun --sdk iphonesimulator --show-sdk-path` BUILD_LIBRARY_FOR_DISTRIBUTION=YES -skipPackagePluginValidation " ]
47
+ var expectedHandleExecuteCalls : [ String ] = {
48
+ switch projectType {
49
+ case . swiftPackage:
50
+ [ " cd \( projectDirectoryPath) ; xcodebuild clean build -scheme \" \( scheme) \" -destination \" generic/platform=iOS \" -derivedDataPath .build -sdk `xcrun --sdk iphonesimulator --show-sdk-path` BUILD_LIBRARY_FOR_DISTRIBUTION=YES -skipPackagePluginValidation " ]
51
+ case . xcodeProject( let scheme) :
52
+ [ " cd \( projectDirectoryPath) ; xcodebuild clean build -scheme \" \( scheme) \" -destination \" generic/platform=iOS \" -derivedDataPath .build -sdk `xcrun --sdk iphonesimulator --show-sdk-path` BUILD_LIBRARY_FOR_DISTRIBUTION=YES " ]
53
+ }
54
+ } ( )
21
55
var expectedHandleLogCalls : [ ( message: String , subsystem: String ) ] = [
22
56
( " 📦 Archiving SCHEME from PROJECT_DIRECTORY_PATH " , " XcodeTools " )
23
57
]
0 commit comments