From c46bf115ddc802d6a2003ec1b4e2fef0d556d659 Mon Sep 17 00:00:00 2001 From: Matt Czech Date: Tue, 18 Nov 2025 16:18:07 -0600 Subject: [PATCH 1/3] [PM-28540] Add Xcodegen templates for common and test targets --- project-bwa.yml | 67 +++++++++---------------- project-bwk.yml | 71 ++++++++++----------------- project-common.yml | 48 ++++++++++++++++++ project-pm.yml | 118 ++++++++++++++++++--------------------------- 4 files changed, 145 insertions(+), 159 deletions(-) diff --git a/project-bwa.yml b/project-bwa.yml index bad7fc5ed8..2bc6fca41b 100644 --- a/project-bwa.yml +++ b/project-bwa.yml @@ -86,19 +86,11 @@ targets: settings: base: INFOPLIST_FILE: Authenticator/Application/Support/Info.plist + templates: + - CommonTarget + templateAttributes: + sourcesPath: Authenticator sources: - - path: Authenticator - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" - - "**/swiftgen-bwa.yml" - - "**/GoogleService-Info.*.plist" - - "**/__Snapshots__/*" - - path: Authenticator - includes: - - "**/__Snapshots__/*" - - "**/GoogleService-Info.*.plist" - buildPhase: none - path: README-bwa.md buildPhase: none - path: swiftgen-bwa.yml @@ -144,11 +136,11 @@ targets: settings: base: INFOPLIST_FILE: Authenticator/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: Authenticator sources: - - path: Authenticator - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers-bwa dependencies: - target: Authenticator @@ -167,19 +159,11 @@ targets: base: APPLICATION_EXTENSION_API_ONLY: true INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/Support/Info.plist + templates: + - CommonTarget + templateAttributes: + sourcesPath: AuthenticatorShared sources: - - path: AuthenticatorShared - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" - - "**/Fixtures/*" - - "**/__Snapshots__/*" - - "**/Sourcery/Generated/*" - - "**/sourcery.yml" - - path: AuthenticatorShared - includes: - - "**/__Snapshots__/*" - buildPhase: none - path: AuthenticatorShared/UI/Platform/Application/Support/Generated/Assets.swift optional: true - path: AuthenticatorShared/Core/Vault/Services/Importers/Support/Generated/GoogleAuth.pb.swift @@ -248,14 +232,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Authenticator.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Authenticator" INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: AuthenticatorShared sources: - - path: AuthenticatorShared - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - excludes: - - "**/*SnapshotTests.*" - - "**/*ViewInspectorTests.*" - path: GlobalTestHelpers-bwa dependencies: - target: Authenticator @@ -276,11 +257,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Authenticator.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Authenticator" INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - SnapshotTestTarget + templateAttributes: + sourcesPath: AuthenticatorShared sources: - - path: AuthenticatorShared - includes: - - "**/*SnapshotTests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers-bwa dependencies: - target: Authenticator @@ -302,11 +283,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Authenticator.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Authenticator" INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - ViewInspectorTestTarget + templateAttributes: + sourcesPath: AuthenticatorShared sources: - - path: AuthenticatorShared - includes: - - "**/*ViewInspectorTests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers-bwa dependencies: - target: Authenticator diff --git a/project-bwk.yml b/project-bwk.yml index e5e39a45fe..008eaa1a70 100644 --- a/project-bwk.yml +++ b/project-bwk.yml @@ -67,14 +67,10 @@ targets: APPLICATION_EXTENSION_API_ONLY: true INFOPLIST_FILE: AuthenticatorBridgeKit/Info.plist SWIFT_STRICT_CONCURRENCY: complete - sources: - - path: AuthenticatorBridgeKit - excludes: - - "**/Fixtures/*" - - "**/Mocks/*" - - "**/Tests/*" - - "**/*Tests.*" - - "**/TestHelpers/*" + templates: + - CommonTarget + templateAttributes: + sourcesPath: AuthenticatorBridgeKit dependencies: - target: BitwardenKit AuthenticatorBridgeKitTests: @@ -84,12 +80,10 @@ targets: base: INFOPLIST_FILE: AuthenticatorBridgeKit/Tests/TestHelpers/Support/Info.plist SWIFT_STRICT_CONCURRENCY: complete - sources: - - path: AuthenticatorBridgeKit - includes: - - "**/Tests/*" - - "**/*Tests.*" - - "**/TestHelpers/*" + templates: + - TestTarget + templateAttributes: + sourcesPath: AuthenticatorBridgeKit dependencies: - target: AuthenticatorBridgeKit - target: AuthenticatorBridgeKitMocks @@ -124,21 +118,12 @@ targets: base: APPLICATION_EXTENSION_API_ONLY: true INFOPLIST_FILE: BitwardenKit/Info.plist + templates: + - CommonTarget + templateAttributes: + sourcesPath: BitwardenKit sources: - - path: BitwardenKit - excludes: - - "**/Fixtures/*" - - "**/Mocks/*" - - "**/*Tests.*" - - "**/TestHelpers/*" - - "**/__Snapshots__/*" - - "**/Sourcery/Generated/*" - - "**/sourcery.yml" - - path: BitwardenKit - includes: - - "**/__Snapshots__/*" - - "**/GoogleService-Info.*.plist" - - "**/sourcery.yml" + - path: BitwardenKit/Sourcery/sourcery.yml buildPhase: none dependencies: - package: BitwardenSdk @@ -178,14 +163,10 @@ targets: settings: base: INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist - sources: - - path: BitwardenKit - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - excludes: - - "**/*SnapshotTests.*" - - "**/*ViewInspectorTests.*" + templates: + - TestTarget + templateAttributes: + sourcesPath: BitwardenKit dependencies: - target: AuthenticatorBridgeKitMocks - target: BitwardenKit @@ -201,11 +182,10 @@ targets: settings: base: INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist - sources: - - path: BitwardenKit - includes: - - "**/*SnapshotTests.*" - - "**/TestHelpers/*" + templates: + - SnapshotTestTarget + templateAttributes: + sourcesPath: BitwardenKit dependencies: - target: AuthenticatorBridgeKitMocks - target: BitwardenKit @@ -219,11 +199,10 @@ targets: settings: base: INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist - sources: - - path: BitwardenKit - includes: - - "**/*ViewInspectorTests.*" - - "**/TestHelpers/*" + templates: + - ViewInspectorTestTarget + templateAttributes: + sourcesPath: BitwardenKit dependencies: - target: AuthenticatorBridgeKitMocks - target: BitwardenKit diff --git a/project-common.yml b/project-common.yml index a710fd8d9c..644ab1e2f9 100644 --- a/project-common.yml +++ b/project-common.yml @@ -25,3 +25,51 @@ packages: ViewInspector: url: https://github.com/nalexn/ViewInspector exactVersion: 0.10.3 +targetTemplates: + # Adds common include/excludes for app and framework targets. + CommonTarget: + sources: + - path: ${sourcesPath} + excludes: + - "**/*Tests.*" + - "**/.gitignore" + - "**/Fixtures/*" + - "**/GoogleService-Info.*.plist" + - "**/Mocks/*" + - "**/Sourcery/Generated/*" + - "**/TestHelpers/*" + - "**/Tests/*" + - "**/__Snapshots__/*" + - "**/sourcery.yml" + - path: ${sourcesPath} + includes: + - "**/__Snapshots__/*" + - "**/GoogleService-Info.*.plist" + buildPhase: none + # Adds common include/excludes for snapshot test targets. + SnapshotTestTarget: + sources: + - path: ${sourcesPath} + includes: + - "**/*SnapshotTests.*" + - "**/Fixtures/*" + - "**/TestHelpers/*" + # Adds common include/excludes for test targets. + TestTarget: + sources: + - path: ${sourcesPath} + excludes: + - "**/*SnapshotTests.*" + - "**/*ViewInspectorTests.*" + includes: + - "**/*Tests.*" + - "**/Fixtures/*" + - "**/TestHelpers/*" + # Adds common include/excludes for ViewInspector test targets. + ViewInspectorTestTarget: + sources: + - path: ${sourcesPath} + includes: + - "**/*ViewInspectorTests.*" + - "**/Fixtures/*" + - "**/TestHelpers/*" diff --git a/project-pm.yml b/project-pm.yml index 8c0aa0e317..692acff701 100644 --- a/project-pm.yml +++ b/project-pm.yml @@ -154,19 +154,11 @@ targets: settings: base: INFOPLIST_FILE: Bitwarden/Application/Support/Info.plist + templates: + - CommonTarget + templateAttributes: + sourcesPath: Bitwarden sources: - - path: Bitwarden - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" - - "**/swiftgen-pm.yml" - - "**/GoogleService-Info.*.plist" - - "**/__Snapshots__/*" - - path: Bitwarden - includes: - - "**/__Snapshots__/*" - - "**/GoogleService-Info.*.plist" - buildPhase: none - path: Bitwarden/Application/Support/GoogleService-Info.plist buildPhase: resources - path: README.md @@ -219,11 +211,11 @@ targets: settings: base: INFOPLIST_FILE: Bitwarden/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: Bitwarden sources: - - path: Bitwarden - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: Bitwarden @@ -242,11 +234,10 @@ targets: base: CODE_SIGN_ENTITLEMENTS: BitwardenActionExtension/Application/Support/BitwardenActionExtension.entitlements INFOPLIST_FILE: BitwardenActionExtension/Application/Support/Info.plist - sources: - - path: BitwardenActionExtension - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" + templates: + - CommonTarget + templateAttributes: + sourcesPath: BitwardenActionExtension dependencies: - package: BitwardenSdk - target: BitwardenShared @@ -256,11 +247,11 @@ targets: settings: base: INFOPLIST_FILE: BitwardenActionExtension/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: BitwardenActionExtension sources: - - path: BitwardenActionExtension - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: BitwardenActionExtension @@ -278,11 +269,10 @@ targets: base: CODE_SIGN_ENTITLEMENTS: BitwardenAutoFillExtension/Application/Support/BitwardenAutoFill.entitlements INFOPLIST_FILE: BitwardenAutoFillExtension/Application/Support/Info.plist - sources: - - path: BitwardenAutoFillExtension - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" + templates: + - CommonTarget + templateAttributes: + sourcesPath: BitwardenAutoFillExtension dependencies: - package: BitwardenSdk - target: BitwardenShared @@ -292,11 +282,11 @@ targets: settings: base: INFOPLIST_FILE: BitwardenAutoFillExtension/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: BitwardenAutoFillExtension sources: - - path: BitwardenAutoFillExtension - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: BitwardenAutoFillExtension @@ -314,11 +304,10 @@ targets: base: INFOPLIST_FILE: BitwardenShareExtension/Application/Support/Info.plist CODE_SIGN_ENTITLEMENTS: BitwardenShareExtension/Application/Support/BitwardenShareExtension.entitlements - sources: - - path: BitwardenShareExtension - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" + templates: + - CommonTarget + templateAttributes: + sourcesPath: BitwardenShareExtension dependencies: - package: BitwardenSdk - target: BitwardenShared @@ -328,11 +317,11 @@ targets: settings: base: INFOPLIST_FILE: BitwardenShareExtension/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: BitwardenShareExtension sources: - - path: BitwardenShareExtension - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: BitwardenShareExtension @@ -355,19 +344,11 @@ targets: - BitwardenShared/UI/Tools/PreviewContent - BitwardenShared/UI/Vault/PreviewContent INFOPLIST_FILE: BitwardenShared/UI/Platform/Application/Support/Info.plist + templates: + - CommonTarget + templateAttributes: + sourcesPath: BitwardenShared sources: - - path: BitwardenShared - excludes: - - "**/*Tests.*" - - "**/TestHelpers/*" - - "**/Fixtures/*" - - "**/__Snapshots__/*" - - "**/Sourcery/Generated/*" - - "**/sourcery.yml" - - path: BitwardenShared - includes: - - "**/__Snapshots__/*" - buildPhase: none - path: BitwardenShared/UI/Platform/Application/Support/Generated/Assets.swift optional: true - path: BitwardenWatchShared @@ -427,14 +408,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Bitwarden.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Bitwarden" INFOPLIST_FILE: BitwardenShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - TestTarget + templateAttributes: + sourcesPath: BitwardenShared sources: - - path: BitwardenShared - includes: - - "**/*Tests.*" - - "**/TestHelpers/*" - excludes: - - "**/*SnapshotTests.*" - - "**/*ViewInspectorTests.*" - path: GlobalTestHelpers dependencies: - target: Bitwarden @@ -458,11 +436,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Bitwarden.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Bitwarden" INFOPLIST_FILE: BitwardenShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - SnapshotTestTarget + templateAttributes: + sourcesPath: BitwardenShared sources: - - path: BitwardenShared - includes: - - "**/*SnapshotTests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: Bitwarden @@ -487,11 +465,11 @@ targets: BUNDLE_LOADER: "$(TEST_HOST)" TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Bitwarden.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Bitwarden" INFOPLIST_FILE: BitwardenShared/UI/Platform/Application/TestHelpers/Support/Info.plist + templates: + - ViewInspectorTestTarget + templateAttributes: + sourcesPath: BitwardenShared sources: - - path: BitwardenShared - includes: - - "**/*ViewInspectorTests.*" - - "**/TestHelpers/*" - path: GlobalTestHelpers dependencies: - target: Bitwarden From 3af7ee46a38e2eb56889fe222915850ed28320df Mon Sep 17 00:00:00 2001 From: Matt Czech Date: Tue, 18 Nov 2025 16:20:21 -0600 Subject: [PATCH 2/3] [PM-28540] Add Xcodegen template for sourcery --- project-bwa.yml | 12 +----------- project-bwk.yml | 14 +------------- project-common.yml | 15 +++++++++++++++ project-pm.yml | 12 +----------- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/project-bwa.yml b/project-bwa.yml index 2bc6fca41b..f7d4947018 100644 --- a/project-bwa.yml +++ b/project-bwa.yml @@ -161,6 +161,7 @@ targets: INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/Support/Info.plist templates: - CommonTarget + - SourceryTarget templateAttributes: sourcesPath: AuthenticatorShared sources: @@ -168,8 +169,6 @@ targets: optional: true - path: AuthenticatorShared/Core/Vault/Services/Importers/Support/Generated/GoogleAuth.pb.swift optional: true - - path: AuthenticatorShared/Sourcery/sourcery.yml - buildPhase: none dependencies: - package: BitwardenSdk - package: SwiftProtobuf @@ -197,15 +196,6 @@ targets: $SRCROOT/AuthenticatorShared/Core/Vault/Services/Importers/Support/GoogleAuth.proto outputFiles: - $(SRCROOT)/AuthenticatorShared/Core/Vault/Services/Importers/Support/Generated/GoogleAuth.pb.swift - - name: Sourcery - script: | - if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then - PATH="/opt/homebrew/bin:$PATH" - fi - mint run sourcery --config AuthenticatorShared/Sourcery/sourcery.yml - basedOnDependencyAnalysis: false - outputFiles: - - $(SRCROOT)/AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift AuthenticatorSharedMocks: type: framework platform: iOS diff --git a/project-bwk.yml b/project-bwk.yml index 008eaa1a70..e9394baa6d 100644 --- a/project-bwk.yml +++ b/project-bwk.yml @@ -120,26 +120,14 @@ targets: INFOPLIST_FILE: BitwardenKit/Info.plist templates: - CommonTarget + - SourceryTarget templateAttributes: sourcesPath: BitwardenKit - sources: - - path: BitwardenKit/Sourcery/sourcery.yml - buildPhase: none dependencies: - package: BitwardenSdk - package: SwiftUIIntrospect - target: BitwardenResources - target: Networking - preBuildScripts: - - name: Sourcery - script: | - if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then - PATH="/opt/homebrew/bin:$PATH" - fi - mint run sourcery --config BitwardenKit/Sourcery/sourcery.yml - basedOnDependencyAnalysis: false - outputFiles: - - $(SRCROOT)/BitwardenKit/Sourcery/Generated/AutoMockable.generated.swift BitwardenKitMocks: type: framework platform: iOS diff --git a/project-common.yml b/project-common.yml index 644ab1e2f9..cc2b95dc93 100644 --- a/project-common.yml +++ b/project-common.yml @@ -54,6 +54,21 @@ targetTemplates: - "**/*SnapshotTests.*" - "**/Fixtures/*" - "**/TestHelpers/*" + # Adds the Sourcery pre-build script. + SourceryTarget: + sources: + - path: ${sourcesPath}/Sourcery/sourcery.yml + buildPhase: none + preBuildScripts: + - name: Sourcery + script: | + if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then + PATH="/opt/homebrew/bin:$PATH" + fi + mint run sourcery --config ${sourcesPath}/Sourcery/sourcery.yml + basedOnDependencyAnalysis: false + outputFiles: + - $(SRCROOT)/${sourcesPath}/Sourcery/Generated/AutoMockable.generated.swift # Adds common include/excludes for test targets. TestTarget: sources: diff --git a/project-pm.yml b/project-pm.yml index 692acff701..40726c1012 100644 --- a/project-pm.yml +++ b/project-pm.yml @@ -346,14 +346,13 @@ targets: INFOPLIST_FILE: BitwardenShared/UI/Platform/Application/Support/Info.plist templates: - CommonTarget + - SourceryTarget templateAttributes: sourcesPath: BitwardenShared sources: - path: BitwardenShared/UI/Platform/Application/Support/Generated/Assets.swift optional: true - path: BitwardenWatchShared - - path: BitwardenShared/Sourcery/sourcery.yml - buildPhase: none dependencies: - package: BitwardenSdk - target: BitwardenKit/AuthenticatorBridgeKit @@ -370,15 +369,6 @@ targets: basedOnDependencyAnalysis: false outputFiles: - $(SRCROOT)/BitwardenShared/UI/Platform/Application/Support/Generated/Assets.swift - - name: Sourcery - script: | - if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then - PATH="/opt/homebrew/bin:$PATH" - fi - mint run sourcery --config BitwardenShared/Sourcery/sourcery.yml - basedOnDependencyAnalysis: false - outputFiles: - - $(SRCROOT)/BitwardenShared/Sourcery/Generated/AutoMockable.generated.swift BitwardenSharedMocks: type: framework platform: iOS From d553a80abb954614f81c6d27961aa6bbcd2ebb78 Mon Sep 17 00:00:00 2001 From: Matt Czech Date: Tue, 18 Nov 2025 17:04:30 -0600 Subject: [PATCH 3/3] [PM-28540] Add Xcodegen template for mocks target --- project-bwa.yml | 8 ++++---- project-bwk.yml | 17 ++++++++--------- project-common.yml | 10 +++++++--- project-pm.yml | 8 ++++---- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/project-bwa.yml b/project-bwa.yml index f7d4947018..ad8188fb27 100644 --- a/project-bwa.yml +++ b/project-bwa.yml @@ -203,11 +203,11 @@ targets: base: ENABLE_TESTING_SEARCH_PATHS: YES GENERATE_INFOPLIST_FILE: YES + templates: + - MocksTarget + templateAttributes: + sourcesPath: AuthenticatorShared sources: - - path: AuthenticatorShared - includes: - - "**/Fixtures/*" - - "**/Mocks/*" - path: AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift optional: true dependencies: diff --git a/project-bwk.yml b/project-bwk.yml index e9394baa6d..6ead03e027 100644 --- a/project-bwk.yml +++ b/project-bwk.yml @@ -99,11 +99,10 @@ targets: ENABLE_TESTING_SEARCH_PATHS: YES INFOPLIST_FILE: AuthenticatorBridgeKit/MocksInfo.plist SWIFT_STRICT_CONCURRENCY: complete - sources: - - path: AuthenticatorBridgeKit - includes: - - "**/Fixtures/*" - - "**/Mocks/*" + templates: + - MocksTarget + templateAttributes: + sourcesPath: AuthenticatorBridgeKit dependencies: - target: AuthenticatorBridgeKit - target: BitwardenKit @@ -135,11 +134,11 @@ targets: base: ENABLE_TESTING_SEARCH_PATHS: YES INFOPLIST_FILE: BitwardenKit/Application/Mocks/Support/Info.plist + templates: + - MocksTarget + templateAttributes: + sourcesPath: BitwardenKit sources: - - path: BitwardenKit - includes: - - "**/Fixtures/*" - - "**/Mocks/*" - path: BitwardenKit/Sourcery/Generated/AutoMockable.generated.swift optional: true dependencies: diff --git a/project-common.yml b/project-common.yml index cc2b95dc93..759d9eb1a6 100644 --- a/project-common.yml +++ b/project-common.yml @@ -46,13 +46,19 @@ targetTemplates: - "**/__Snapshots__/*" - "**/GoogleService-Info.*.plist" buildPhase: none + # Adds common include/excludes for mocks targets. + MocksTarget: + sources: + - path: ${sourcesPath} + includes: + - "**/Fixtures/*" + - "**/Mocks/*" # Adds common include/excludes for snapshot test targets. SnapshotTestTarget: sources: - path: ${sourcesPath} includes: - "**/*SnapshotTests.*" - - "**/Fixtures/*" - "**/TestHelpers/*" # Adds the Sourcery pre-build script. SourceryTarget: @@ -78,7 +84,6 @@ targetTemplates: - "**/*ViewInspectorTests.*" includes: - "**/*Tests.*" - - "**/Fixtures/*" - "**/TestHelpers/*" # Adds common include/excludes for ViewInspector test targets. ViewInspectorTestTarget: @@ -86,5 +91,4 @@ targetTemplates: - path: ${sourcesPath} includes: - "**/*ViewInspectorTests.*" - - "**/Fixtures/*" - "**/TestHelpers/*" diff --git a/project-pm.yml b/project-pm.yml index 40726c1012..8e64c9e57e 100644 --- a/project-pm.yml +++ b/project-pm.yml @@ -376,11 +376,11 @@ targets: base: ENABLE_TESTING_SEARCH_PATHS: YES GENERATE_INFOPLIST_FILE: YES + templates: + - MocksTarget + templateAttributes: + sourcesPath: BitwardenShared sources: - - path: BitwardenShared - includes: - - "**/Fixtures/*" - - "**/Mocks/*" - path: BitwardenShared/Sourcery/Generated/AutoMockable.generated.swift optional: true dependencies: