Skip to content

Commit 4cb5144

Browse files
stephencelismluisbrown
authored andcommitted
Swift Package Index fixes (#272)
* Swift Package Index fixes * format * Remove list
1 parent 43bd98d commit 4cb5144

File tree

4 files changed

+161
-50
lines changed

4 files changed

+161
-50
lines changed

.spi.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- platform: watchos
5+
scheme: ComposableArchitecture_watchOS
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1200"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "ComposableArchitecture"
18+
BuildableName = "ComposableArchitecture"
19+
BlueprintName = "ComposableArchitecture"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "ComposableCoreLocation"
32+
BuildableName = "ComposableCoreLocation"
33+
BlueprintName = "ComposableCoreLocation"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "ComposableCoreMotion"
46+
BuildableName = "ComposableCoreMotion"
47+
BlueprintName = "ComposableCoreMotion"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
</BuildActionEntries>
52+
</BuildAction>
53+
<TestAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
shouldUseLaunchSchemeArgsEnv = "YES">
58+
<Testables>
59+
</Testables>
60+
</TestAction>
61+
<LaunchAction
62+
buildConfiguration = "Debug"
63+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
64+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
65+
launchStyle = "0"
66+
useCustomWorkingDirectory = "NO"
67+
ignoresPersistentStateOnLaunch = "NO"
68+
debugDocumentVersioning = "YES"
69+
debugServiceExtension = "internal"
70+
allowLocationSimulation = "YES">
71+
</LaunchAction>
72+
<ProfileAction
73+
buildConfiguration = "Release"
74+
shouldUseLaunchSchemeArgsEnv = "YES"
75+
savedToolIdentifier = ""
76+
useCustomWorkingDirectory = "NO"
77+
debugDocumentVersioning = "YES">
78+
<MacroExpansion>
79+
<BuildableReference
80+
BuildableIdentifier = "primary"
81+
BlueprintIdentifier = "ComposableArchitecture"
82+
BuildableName = "ComposableArchitecture"
83+
BlueprintName = "ComposableArchitecture"
84+
ReferencedContainer = "container:">
85+
</BuildableReference>
86+
</MacroExpansion>
87+
</ProfileAction>
88+
<AnalyzeAction
89+
buildConfiguration = "Debug">
90+
</AnalyzeAction>
91+
<ArchiveAction
92+
buildConfiguration = "Release"
93+
revealArchiveInOrganizer = "YES">
94+
</ArchiveAction>
95+
</Scheme>

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
22
PLATFORM_MACOS = macOS
33
PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p)
4+
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 4 - 44mm
45

56
default: test
67

78
test:
8-
instruments -s devices
99
xcodebuild test \
1010
-scheme ComposableArchitecture \
1111
-destination platform="$(PLATFORM_IOS)"
@@ -15,6 +15,9 @@ test:
1515
xcodebuild test \
1616
-scheme ComposableArchitecture \
1717
-destination platform="$(PLATFORM_TVOS)"
18+
xcodebuild \
19+
-scheme ComposableArchitecture_watchOS \
20+
-destination platform="$(PLATFORM_WATCHOS)"
1821
xcodebuild test \
1922
-scheme ComposableCoreLocation \
2023
-destination platform="$(PLATFORM_IOS)"
@@ -27,6 +30,12 @@ test:
2730
xcodebuild test \
2831
-scheme ComposableCoreMotion \
2932
-destination platform="$(PLATFORM_IOS)"
33+
xcodebuild test \
34+
-scheme ComposableCoreMotion \
35+
-destination platform="$(PLATFORM_MACOS)"
36+
xcodebuild test \
37+
-scheme ComposableCoreMotion \
38+
-destination platform="$(PLATFORM_TVOS)"
3039
xcodebuild test \
3140
-scheme "CaseStudies (SwiftUI)" \
3241
-destination platform="$(PLATFORM_IOS)"
Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
1-
import XCTest
2-
3-
@testable import ComposableCoreMotion
4-
5-
class ComposableCoreMotionTests: XCTestCase {
6-
func testQuaternionInverse() {
7-
let q = CMQuaternion(x: 1, y: 2, z: 3, w: 4)
8-
let inv = q.inverse
9-
let result = q.multiplied(by: inv)
10-
11-
XCTAssertEqual(result.x, 0)
12-
XCTAssertEqual(result.y, 0)
13-
XCTAssertEqual(result.z, 0)
14-
XCTAssertEqual(result.w, 1)
15-
}
16-
17-
func testQuaternionMultiplication() {
18-
let q1 = CMQuaternion(x: 1, y: 2, z: 3, w: 4)
19-
let q2 = CMQuaternion(x: -4, y: 3, z: -2, w: 1)
20-
let result = q1.multiplied(by: q2)
21-
22-
XCTAssertEqual(result.x, -28)
23-
XCTAssertEqual(result.y, 4)
24-
XCTAssertEqual(result.z, 6)
25-
XCTAssertEqual(result.w, 8)
26-
}
27-
28-
func testRollPitchYaw() {
29-
let q1 = Attitude(quaternion: .init(x: 1, y: 0, z: 0, w: 0))
30-
let q2 = Attitude(quaternion: .init(x: 0, y: 1, z: 0, w: 0))
31-
let q3 = Attitude(quaternion: .init(x: 0, y: 0, z: 1, w: 0))
32-
let q4 = Attitude(quaternion: .init(x: 0, y: 0, z: 0, w: 1))
33-
34-
XCTAssertEqual(q1.roll, Double.pi)
35-
XCTAssertEqual(q1.pitch, 0)
36-
XCTAssertEqual(q1.yaw, 0)
37-
38-
XCTAssertEqual(q2.roll, Double.pi)
39-
XCTAssertEqual(q2.pitch, 0)
40-
XCTAssertEqual(q2.yaw, Double.pi)
41-
42-
XCTAssertEqual(q3.roll, 0)
43-
XCTAssertEqual(q3.pitch, 0)
44-
XCTAssertEqual(q3.yaw, Double.pi)
45-
46-
XCTAssertEqual(q4.roll, 0)
47-
XCTAssertEqual(q4.pitch, 0)
48-
XCTAssertEqual(q4.yaw, 0)
1+
#if canImport(CoreMotion)
2+
import XCTest
3+
4+
@testable import ComposableCoreMotion
5+
6+
class ComposableCoreMotionTests: XCTestCase {
7+
func testQuaternionInverse() {
8+
let q = CMQuaternion(x: 1, y: 2, z: 3, w: 4)
9+
let inv = q.inverse
10+
let result = q.multiplied(by: inv)
11+
12+
XCTAssertEqual(result.x, 0)
13+
XCTAssertEqual(result.y, 0)
14+
XCTAssertEqual(result.z, 0)
15+
XCTAssertEqual(result.w, 1)
16+
}
17+
18+
func testQuaternionMultiplication() {
19+
let q1 = CMQuaternion(x: 1, y: 2, z: 3, w: 4)
20+
let q2 = CMQuaternion(x: -4, y: 3, z: -2, w: 1)
21+
let result = q1.multiplied(by: q2)
22+
23+
XCTAssertEqual(result.x, -28)
24+
XCTAssertEqual(result.y, 4)
25+
XCTAssertEqual(result.z, 6)
26+
XCTAssertEqual(result.w, 8)
27+
}
28+
29+
func testRollPitchYaw() {
30+
let q1 = Attitude(quaternion: .init(x: 1, y: 0, z: 0, w: 0))
31+
let q2 = Attitude(quaternion: .init(x: 0, y: 1, z: 0, w: 0))
32+
let q3 = Attitude(quaternion: .init(x: 0, y: 0, z: 1, w: 0))
33+
let q4 = Attitude(quaternion: .init(x: 0, y: 0, z: 0, w: 1))
34+
35+
XCTAssertEqual(q1.roll, Double.pi)
36+
XCTAssertEqual(q1.pitch, 0)
37+
XCTAssertEqual(q1.yaw, 0)
38+
39+
XCTAssertEqual(q2.roll, Double.pi)
40+
XCTAssertEqual(q2.pitch, 0)
41+
XCTAssertEqual(q2.yaw, Double.pi)
42+
43+
XCTAssertEqual(q3.roll, 0)
44+
XCTAssertEqual(q3.pitch, 0)
45+
XCTAssertEqual(q3.yaw, Double.pi)
46+
47+
XCTAssertEqual(q4.roll, 0)
48+
XCTAssertEqual(q4.pitch, 0)
49+
XCTAssertEqual(q4.yaw, 0)
50+
}
4951
}
50-
}
52+
#endif

0 commit comments

Comments
 (0)