Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 25 additions & 63 deletions project-bwa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,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
Expand Down Expand Up @@ -140,11 +132,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
Expand All @@ -163,25 +155,16 @@ targets:
base:
APPLICATION_EXTENSION_API_ONLY: true
INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/Support/Info.plist
templates:
- CommonTarget
- SourceryTarget
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
optional: true
- path: AuthenticatorShared/Sourcery/sourcery.yml
buildPhase: none
dependencies:
- package: BitwardenSdk
- package: SwiftProtobuf
Expand Down Expand Up @@ -209,15 +192,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
AuthenticatorSharedTests:
type: bundle.unit-test
platform: iOS
Expand All @@ -226,18 +200,12 @@ 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/*"
- "**/Fixtures/*"
excludes:
- "**/*SnapshotTests.*"
- "**/*ViewInspectorTests.*"
- path: GlobalTestHelpers-bwa
- path: AuthenticatorShared/Sourcery/Generated
optional: true
- path: AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift
optional: true
dependencies:
Expand All @@ -257,15 +225,12 @@ 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/*"
- "**/Fixtures/*"
- path: GlobalTestHelpers-bwa
- path: AuthenticatorShared/Sourcery/Generated
optional: true
- path: AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift
optional: true
dependencies:
Expand All @@ -286,15 +251,12 @@ 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/*"
- "**/Fixtures/*"
- path: GlobalTestHelpers-bwa
- path: AuthenticatorShared/Sourcery/Generated
optional: true
- path: AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift
optional: true
dependencies:
Expand Down
59 changes: 19 additions & 40 deletions project-bwk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -124,36 +118,15 @@ targets:
base:
APPLICATION_EXTENSION_API_ONLY: true
INFOPLIST_FILE: BitwardenKit/Info.plist
sources:
- path: BitwardenKit
excludes:
- "**/Fixtures/*"
- "**/Mocks/*"
- "**/*Tests.*"
- "**/TestHelpers/*"
- "**/__Snapshots__/*"
- "**/Sourcery/Generated/*"
- "**/sourcery.yml"
- path: BitwardenKit
includes:
- "**/__Snapshots__/*"
- "**/GoogleService-Info.*.plist"
- "**/sourcery.yml"
buildPhase: none
templates:
- CommonTarget
- SourceryTarget
templateAttributes:
sourcesPath: BitwardenKit
dependencies:
- 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
Expand All @@ -177,6 +150,8 @@ targets:
settings:
base:
INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist
# Can't use the TestTarget template here because it includes Fixtures, but those should be excluded
# here and included in BitwardenKitMocks instead.
sources:
- path: BitwardenKit
includes:
Expand All @@ -199,6 +174,8 @@ targets:
settings:
base:
INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist
# Can't use the SnapshotTestTarget template here because it includes Fixtures, but those should be excluded
# here and included in BitwardenKitMocks instead.
sources:
- path: BitwardenKit
includes:
Expand All @@ -217,6 +194,8 @@ targets:
settings:
base:
INFOPLIST_FILE: BitwardenKit/Application/TestHelpers/Support/Info.plist
# Can't use the ViewInspectorTestTarget template here because it includes Fixtures, but those should be excluded
# here and included in BitwardenKitMocks instead.
sources:
- path: BitwardenKit
includes:
Expand Down
63 changes: 63 additions & 0 deletions project-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,66 @@ 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 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:
- 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/*"
Loading