diff --git a/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/MyIdentityFeature.xcscheme b/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/MyIdentityFeature.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..e69b1d44aa7ba292ef94bb8db602faa9111304f6 --- /dev/null +++ b/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/MyIdentityFeature.xcscheme @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1340" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "MyIdentityFeature" + BuildableName = "MyIdentityFeature" + BlueprintName = "MyIdentityFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "MyIdentityFeatureTests" + BuildableName = "MyIdentityFeatureTests" + BlueprintName = "MyIdentityFeatureTests" + ReferencedContainer = "container:"> + </BuildableReference> + </TestableReference> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "MyIdentityFeature" + BuildableName = "MyIdentityFeature" + BlueprintName = "MyIdentityFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme b/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme index ac213623f3e728760923364f7769a3ffd075fbd1..1a4d13ff4bb909932b903df885404151da086070 100644 --- a/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme +++ b/Example/example-app/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme @@ -48,6 +48,20 @@ ReferencedContainer = "container:"> </BuildableReference> </BuildActionEntry> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "MyIdentityFeature" + BuildableName = "MyIdentityFeature" + BlueprintName = "MyIdentityFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" @@ -101,6 +115,16 @@ ReferencedContainer = "container:"> </BuildableReference> </TestableReference> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "MyIdentityFeatureTests" + BuildableName = "MyIdentityFeatureTests" + BlueprintName = "MyIdentityFeatureTests" + ReferencedContainer = "container:"> + </BuildableReference> + </TestableReference> <TestableReference skipped = "NO"> <BuildableReference diff --git a/Example/example-app/Package.swift b/Example/example-app/Package.swift index 55d546265e9cafd943d11e006d1d3ddcb298cad3..cb8aead735a4ccc7be2327faf8215acbc126c23a 100644 --- a/Example/example-app/Package.swift +++ b/Example/example-app/Package.swift @@ -32,6 +32,10 @@ let package = Package( name: "LandingFeature", targets: ["LandingFeature"] ), + .library( + name: "MyIdentityFeature", + targets: ["MyIdentityFeature"] + ), .library( name: "SessionFeature", targets: ["SessionFeature"] @@ -132,6 +136,23 @@ let package = Package( ], swiftSettings: swiftSettings ), + .target( + name: "MyIdentityFeature", + dependencies: [ + .product( + name: "ComposableArchitecture", + package: "swift-composable-architecture" + ), + ], + swiftSettings: swiftSettings + ), + .testTarget( + name: "MyIdentityFeatureTests", + dependencies: [ + .target(name: "MyIdentityFeature"), + ], + swiftSettings: swiftSettings + ), .target( name: "SessionFeature", dependencies: [ diff --git a/Example/example-app/Sources/MyIdentityFeature/MyIdentityFeature.swift b/Example/example-app/Sources/MyIdentityFeature/MyIdentityFeature.swift new file mode 100644 index 0000000000000000000000000000000000000000..a9b973610534b5c0cb4f1ebe8c7bf219209045c2 --- /dev/null +++ b/Example/example-app/Sources/MyIdentityFeature/MyIdentityFeature.swift @@ -0,0 +1,19 @@ +import ComposableArchitecture + +public struct MyIdentityState: Equatable { + public init() {} +} + +public enum MyIdentityAction: Equatable {} + +public struct MyIdentityEnvironment { + public init() {} +} + +public let myIdentityReducer = Reducer<MyIdentityState, MyIdentityAction, MyIdentityEnvironment>.empty + +#if DEBUG +extension MyIdentityEnvironment { + public static let failing = MyIdentityEnvironment() +} +#endif diff --git a/Example/example-app/Sources/MyIdentityFeature/MyIdentityView.swift b/Example/example-app/Sources/MyIdentityFeature/MyIdentityView.swift new file mode 100644 index 0000000000000000000000000000000000000000..4061024b1b26ae4a758dc8f9cacdbd422f5c747d --- /dev/null +++ b/Example/example-app/Sources/MyIdentityFeature/MyIdentityView.swift @@ -0,0 +1,35 @@ +import ComposableArchitecture +import SwiftUI + +public struct MyIdentityView: View { + public init(store: Store<MyIdentityState, MyIdentityAction>) { + self.store = store + } + + let store: Store<MyIdentityState, MyIdentityAction> + + struct ViewState: Equatable { + init(state: MyIdentityState) {} + } + + public var body: some View { + WithViewStore(store.scope(state: ViewState.init)) { viewStore in + Text("MyIdentityView") + } + } +} + +#if DEBUG +public struct MyIdentityView_Previews: PreviewProvider { + public static var previews: some View { + NavigationView { + MyIdentityView(store: .init( + initialState: .init(), + reducer: .empty, + environment: () + )) + } + .navigationViewStyle(.stack) + } +} +#endif diff --git a/Example/example-app/Tests/MyIdentityFeatureTests/MyIdentityFeatureTests.swift b/Example/example-app/Tests/MyIdentityFeatureTests/MyIdentityFeatureTests.swift new file mode 100644 index 0000000000000000000000000000000000000000..f4a6a410a779bdc85e3c8742289d87012399b353 --- /dev/null +++ b/Example/example-app/Tests/MyIdentityFeatureTests/MyIdentityFeatureTests.swift @@ -0,0 +1,9 @@ +import ComposableArchitecture +import XCTest +@testable import MyIdentityFeature + +final class MyIdentityFeatureTests: XCTestCase { + func testExample() { + XCTAssert(true) + } +}