ios/project-bwa.yml
2025-12-09 12:09:44 -06:00

321 lines
11 KiB
YAML

name: Authenticator
fileGroups:
- Configs-bwa
configs:
Debug: debug
Release: release
include:
- path: project-common.yml
options:
fileTypes:
"icon":
file: true
settings:
MARKETING_VERSION: 2024.6.1
CURRENT_PROJECT_VERSION: 1
packages:
SwiftProtobuf:
url: https://github.com/apple/swift-protobuf
exactVersion: 1.31.0
projectReferences:
BitwardenKit:
path: BitwardenKit.xcodeproj
schemes:
Authenticator:
build:
targets:
Authenticator: all
AuthenticatorTests: [test]
run:
commandLineArguments:
"-com.apple.CoreData.ConcurrencyDebug 1": true
test:
commandLineArguments:
"-testing": true
environmentVariables:
TZ: UTC
gatherCoverageData: true
coverageTargets:
- Authenticator
- AuthenticatorShared
- BitwardenKit/AuthenticatorBridgeKit
- BitwardenKit/BitwardenKit
- BitwardenKit/Networking
targets:
- AuthenticatorTests
- AuthenticatorSharedTests
- BitwardenKit/AuthenticatorBridgeKitTests
- BitwardenKit/BitwardenKitTests
- BitwardenKit/NetworkingTests
testPlans:
- path: TestPlans/Authenticator-Default.xctestplan
defaultPlan: true
- path: TestPlans/Authenticator-Unit.xctestplan
- path: TestPlans/Authenticator-Snapshot.xctestplan
- path: TestPlans/Authenticator-ViewInspector.xctestplan
AuthenticatorShared:
build:
targets:
AuthenticatorShared: all
AuthenticatorSharedTests: [test]
AuthenticatorSharedSnapshotTests: [test]
AuthenticatorSharedViewInspectorTests: [test]
test:
commandLineArguments:
"-testing": true
environmentVariables:
TZ: UTC
gatherCoverageData: true
targets:
- AuthenticatorSharedTests
- AuthenticatorSharedSnapshotTests
- AuthenticatorSharedViewInspectorTests
testPlans:
- path: TestPlans/Authenticator-Default.xctestplan
defaultPlan: true
- path: TestPlans/Authenticator-Unit.xctestplan
- path: TestPlans/Authenticator-Snapshot.xctestplan
- path: TestPlans/Authenticator-ViewInspector.xctestplan
targets:
Authenticator:
type: application
platform: iOS
configFiles:
Debug: Configs/Authenticator-Debug.xcconfig
Release: Configs/Authenticator-Release.xcconfig
settings:
base:
INFOPLIST_FILE: Authenticator/Application/Support/Info.plist
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
buildPhase: none
dependencies:
- target: AuthenticatorShared
- target: BitwardenKit/AuthenticatorBridgeKit
- target: BitwardenKit/BitwardenKit
- target: BitwardenKit/BitwardenResources
- target: BitwardenKit/Networking
- package: Firebase
product: FirebaseCrashlytics
preBuildScripts:
- path: Scripts-bwa/update_acknowledgements.sh
name: "Settings.bundle: Update Acknowledgements"
outputFiles:
- $(SRCROOT)/Authenticator/Application/Support/Settings.bundle/Acknowledgements.plist
- $(SRCROOT)/Authenticator/Application/Support/Settings.bundle/Acknowledgements.latest_results.txt
- $(SRCROOT)/Authenticator/Application/Support/Settings.bundle/Acknowledgements
postCompileScripts:
- script: |
if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then
PATH="/opt/homebrew/bin:$PATH"
fi
mint run swiftlint
name: Swiftlint
basedOnDependencyAnalysis: false
- script: |
if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then
PATH="/opt/homebrew/bin:$PATH"
fi
mint run swiftformat --lint --lenient .
name: SwiftFormat Lint
basedOnDependencyAnalysis: false
postBuildScripts:
- path: Scripts-bwa/update_settings_version_number.sh
name: "Settings.bundle: Update Version Number"
basedOnDependencyAnalysis: false
AuthenticatorTests:
type: bundle.unit-test
platform: iOS
settings:
base:
INFOPLIST_FILE: Authenticator/Application/TestHelpers/Support/Info.plist
sources:
- path: Authenticator
includes:
- "**/*Tests.*"
- "**/TestHelpers/*"
- path: GlobalTestHelpers-bwa
dependencies:
- target: Authenticator
- target: BitwardenKit/AuthenticatorBridgeKit
- target: BitwardenKit/TestHelpers
- package: SnapshotTesting
randomExecutionOrder: true
AuthenticatorShared:
type: framework
platform: iOS
configFiles:
Debug: Configs/AuthenticatorShared-Debug.xcconfig
Release: Configs/AuthenticatorShared-Release.xcconfig
settings:
base:
APPLICATION_EXTENSION_API_ONLY: true
INFOPLIST_FILE: AuthenticatorShared/UI/Platform/Application/Support/Info.plist
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
- target: BitwardenKit/AuthenticatorBridgeKit
- target: BitwardenKit/BitwardenKit
- target: BitwardenKit/BitwardenResources
- target: BitwardenKit/Networking
preBuildScripts:
- name: SwiftGen
script: |
if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then
PATH="/opt/homebrew/bin:$PATH"
fi
mint run swiftgen config run --config "swiftgen-bwa.yml"
basedOnDependencyAnalysis: false
outputFiles:
- $(SRCROOT)/AuthenticatorShared/UI/Platform/Application/Support/Generated/Assets.swift
- name: Protobuf
script: |
if [[ ! "$PATH" =~ "/opt/homebrew/bin" ]]; then
PATH="/opt/homebrew/bin:$PATH"
fi
protoc --proto_path=$SRCROOT/AuthenticatorShared/Core/Vault/Services/Importers/Support \
--swift_out=$SRCROOT/AuthenticatorShared/Core/Vault/Services/Importers/Support/Generated \
$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
settings:
base:
ENABLE_TESTING_SEARCH_PATHS: YES
GENERATE_INFOPLIST_FILE: YES
sources:
- path: AuthenticatorShared
includes:
- "**/Fixtures/*"
- "**/Mocks/*"
- path: AuthenticatorShared/Sourcery/Generated/AutoMockable.generated.swift
optional: true
dependencies:
- target: AuthenticatorShared
- target: BitwardenKit/AuthenticatorBridgeKitMocks
- target: BitwardenKit/TestHelpers
AuthenticatorSharedTests:
type: bundle.unit-test
platform: iOS
settings:
base:
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
sources:
- path: AuthenticatorShared
includes:
- "**/*Tests.*"
- "**/TestHelpers/*"
excludes:
- "**/*SnapshotTests.*"
- "**/*ViewInspectorTests.*"
- path: GlobalTestHelpers-bwa
dependencies:
- target: Authenticator
- target: AuthenticatorShared
- target: AuthenticatorSharedMocks
- target: BitwardenKit/AuthenticatorBridgeKitMocks
- target: BitwardenKit/BitwardenKitMocks
- target: BitwardenKit/TestHelpers
- package: BitwardenSdk
- package: SnapshotTesting
product: InlineSnapshotTesting
randomExecutionOrder: true
AuthenticatorSharedSnapshotTests:
type: bundle.unit-test
platform: iOS
settings:
base:
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
sources:
- path: AuthenticatorShared
includes:
- "**/*SnapshotTests.*"
- "**/TestHelpers/*"
- path: GlobalTestHelpers-bwa
dependencies:
- target: Authenticator
- target: AuthenticatorShared
- target: AuthenticatorSharedMocks
- target: BitwardenKit/AuthenticatorBridgeKitMocks
- target: BitwardenKit/BitwardenKitMocks
- target: BitwardenKit/TestHelpers
- package: BitwardenSdk
- package: SnapshotTesting
- package: SnapshotTesting
product: InlineSnapshotTesting
randomExecutionOrder: true
AuthenticatorSharedViewInspectorTests:
type: bundle.unit-test
platform: iOS
settings:
base:
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
sources:
- path: AuthenticatorShared
includes:
- "**/*ViewInspectorTests.*"
- "**/TestHelpers/*"
- path: GlobalTestHelpers-bwa
dependencies:
- target: Authenticator
- target: AuthenticatorShared
- target: AuthenticatorSharedMocks
- target: BitwardenKit/AuthenticatorBridgeKitMocks
- target: BitwardenKit/BitwardenKitMocks
- target: BitwardenKit/TestHelpers
- target: BitwardenKit/ViewInspectorTestHelpers
- package: BitwardenSdk
- package: ViewInspector
randomExecutionOrder: true