Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIT-58: Configure the project to allow customizing bundle identifiers and versions #14

Merged
merged 5 commits into from
Sep 1, 2023
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ fastlane/README.md

# XcodeGen
/*.xcodeproj

# Local xcconfig
Configs/Local.xcconfig
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "AppIcon-Dev.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "Icon-1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions Bitwarden/Application/Support/Bitwarden.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.8bit.bitwarden</string>
<string>group.$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.8bit.bitwarden</string>
<string>$(AppIdentifierPrefix)$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
<key>com.apple.developer.associated-domains</key>
Expand Down
8 changes: 0 additions & 8 deletions Bitwarden/Application/Support/Configs/Debug.xcconfig

This file was deleted.

8 changes: 0 additions & 8 deletions Bitwarden/Application/Support/Configs/Release.xcconfig

This file was deleted.

8 changes: 5 additions & 3 deletions Bitwarden/Application/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleShortVersionString</key>
<string>2023.7.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.8bit.bitwarden</string>
<string>group.$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.8bit.bitwarden</string>
<string>$(AppIdentifierPrefix)$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
</dict>
</plist>
6 changes: 3 additions & 3 deletions BitwardenActionExtension/Application/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden.find-login-action-extension</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleShortVersionString</key>
<string>2023.7.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
Expand Down Expand Up @@ -101,6 +101,6 @@
<string>com.apple.ui-services</string>
</dict>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
101 changes: 101 additions & 0 deletions BitwardenActionExtension/Application/Support/extension.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.8bit.bitwarden</string>
<string>group.$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.8bit.bitwarden</string>
<string>$(AppIdentifierPrefix)$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
</dict>
</plist>
6 changes: 3 additions & 3 deletions BitwardenAutoFillExtension/Application/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden.autofill</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleShortVersionString</key>
<string>2023.7.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.8bit.bitwarden</string>
<string>group.$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.8bit.bitwarden</string>
<string>$(AppIdentifierPrefix)$(ORGANIZATION_IDENTIFIER).bitwarden</string>
</array>
</dict>
</plist>
8 changes: 5 additions & 3 deletions BitwardenShareExtension/Application/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<string>Bitwarden Share</string>
<key>CFBundleName</key>
<string>Bitwarden Share Extension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden.share-extension</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -17,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2023.7.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>
Expand Down
8 changes: 8 additions & 0 deletions Configs/Bitwarden-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "./Common.xcconfig"
#include? "./Local.xcconfig"

ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon-Dev
CODE_SIGN_ENTITLEMENTS = Bitwarden/Application/Support/Bitwarden.entitlements
FIREBASE_CONFIG_FILENAME = GoogleService-Info.plist
PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) PREVIEWS
10 changes: 10 additions & 0 deletions Configs/Bitwarden-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Prevents Xcodegen from overriding the CODE_SIGN_IDENTITY value from an included xcconfig.
CODE_SIGN_IDENTITY = Apple Development

#include "./Common.xcconfig"
#include? "./Local.xcconfig"

ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
CODE_SIGN_ENTITLEMENTS = Bitwarden/Application/Support/Bitwarden.entitlements
FIREBASE_CONFIG_FILENAME = GoogleService-Info.plist
PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden
5 changes: 5 additions & 0 deletions Configs/BitwardenActionExtension.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "./Common.xcconfig"
#include? "./Local.xcconfig"

PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden.find-login-action-extension
PROVISIONING_PROFILE_SPECIFIER = $(PROVISIONING_PROFILE_SPECIFIER_ACTION_EXTENSION)
5 changes: 5 additions & 0 deletions Configs/BitwardenAutoFillExtension.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "./Common.xcconfig"
#include? "./Local.xcconfig"

PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden.autofill
PROVISIONING_PROFILE_SPECIFIER = $(PROVISIONING_PROFILE_SPECIFIER_AUTOFILL_EXTENSION)
5 changes: 5 additions & 0 deletions Configs/BitwardenShareExtension.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "./Common.xcconfig"
#include? "./Local.xcconfig"

PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden.share-extension
PROVISIONING_PROFILE_SPECIFIER = $(PROVISIONING_PROFILE_SPECIFIER_SHARE_EXTENSION)
4 changes: 4 additions & 0 deletions Configs/BitwardenShared.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "./Common.xcconfig"
#include? "./Local.xcconfig"

PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).bitwarden.bitwarden-shared
19 changes: 19 additions & 0 deletions Configs/Common.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CODE_SIGN_STYLE = Automatic
DEVELOPMENT_TEAM = LTZ2PFU5D6
ORGANIZATION_IDENTIFIER = com.8bit

// The above code signing settings can be overriden by adding a Local.xcconfig
// file in the Configs directory.
//
// As an example, add the file Local.xcconfig with the following contents:
//
// DEVELOPMENT_TEAM = <Your team ID>
// ORGANIZATION_IDENTIFIER = <Your reversed domain name>
// PROVISIONING_PROFILE_SPECIFIER = <Optional provisioning profile specifier for the main app>
// PROVISIONING_PROFILE_SPECIFIER_ACTION_EXTENSION = <Optional provisioning profile specifier for the action extension>
// PROVISIONING_PROFILE_SPECIFIER_AUTOFILL_EXTENSION = <Optional provisioning profile specifier for the autofill extension>
// PROVISIONING_PROFILE_SPECIFIER_SHARE_EXTENSION = <Optional provisioning profile specifier for the share extension>
//
// This should allow Xcode to build the application based on these settings without
// code signing errors or having to modify the project itself.
//
2 changes: 1 addition & 1 deletion Scripts/update_settings_version_number.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e

SETTINGS_BUNDLE_PATH="${CODESIGNING_FOLDER_PATH}/Settings.bundle/Root.plist"
BUILD_VERSION=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' "${PROJECT_FILE_PATH}/project.pbxproj")
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}")
BUILD_NUMBER=$(sed -n '/CURRENT_PROJECT_VERSION/{s/CURRENT_PROJECT_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' "${PROJECT_FILE_PATH}/project.pbxproj")
BUILD_STRING="${BUILD_VERSION} (${BUILD_NUMBER})"

/usr/libexec/PlistBuddy -c "Set PreferenceSpecifiers:0:DefaultValue $BUILD_STRING" "${SETTINGS_BUNDLE_PATH}"
33 changes: 21 additions & 12 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ configs:
Debug: debug
Release: release
options:
bundleIdPrefix: com.8bit
createIntermediateGroups: true
deploymentTarget:
iOS: 15.0
Expand Down Expand Up @@ -91,6 +90,12 @@ targets:
Bitwarden:
type: application
platform: iOS
configFiles:
Debug: Configs/Bitwarden-Debug.xcconfig
Release: Configs/Bitwarden-Release.xcconfig
settings:
base:
INFOPLIST_FILE: Bitwarden/Application/Support/Info.plist
sources:
- path: Bitwarden
excludes:
Expand All @@ -116,11 +121,6 @@ targets:
- target: BitwardenShareExtension
- package: Firebase
product: FirebaseCrashlytics
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.8bit.bitwarden
INFOPLIST_FILE: Bitwarden/Application/Support/Info.plist
CODE_SIGN_ENTITLEMENTS: Bitwarden/Application/Support/Bitwarden.entitlements
preBuildScripts:
- path: Scripts/update_acknowledgements.sh
name: "Settings.bundle: Update Acknowledgements"
Expand Down Expand Up @@ -161,11 +161,13 @@ targets:
BitwardenActionExtension:
type: app-extension
platform: iOS
configFiles:
Debug: Configs/BitwardenActionExtension.xcconfig
Release: Configs/BitwardenActionExtension.xcconfig
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.8bit.bitwarden.find-login-action-extension
INFOPLIST_FILE: BitwardenActionExtension/Application/Support/Info.plist
CODE_SIGN_ENTITLEMENTS: BitwardenActionExtension/Application/Support/BitwardenActionExtension.entitlements
INFOPLIST_FILE: BitwardenActionExtension/Application/Support/Info.plist
sources:
- path: BitwardenActionExtension
excludes:
Expand Down Expand Up @@ -195,11 +197,13 @@ targets:
BitwardenAutoFillExtension:
type: app-extension
platform: iOS
configFiles:
Debug: Configs/BitwardenAutoFillExtension.xcconfig
Release: Configs/BitwardenAutoFillExtension.xcconfig
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.8bit.bitwarden.autofill
INFOPLIST_FILE: BitwardenAutoFillExtension/Application/Support/Info.plist
CODE_SIGN_ENTITLEMENTS: BitwardenAutoFillExtension/Application/Support/BitwardenAutoFill.entitlements
INFOPLIST_FILE: BitwardenAutoFillExtension/Application/Support/Info.plist
sources:
- path: BitwardenAutoFillExtension
excludes:
Expand Down Expand Up @@ -229,11 +233,13 @@ targets:
BitwardenShareExtension:
type: app-extension
platform: iOS
configFiles:
Debug: Configs/BitwardenShareExtension.xcconfig
Release: Configs/BitwardenShareExtension.xcconfig
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.8bit.bitwarden.share-extension
INFOPLIST_FILE: BitwardenShareExtension/Application/Support/Info.plist
CODE_SIGN_ENTITLEMENTS: BitwardenShareExtension/Application/Support/BitwardenShareExtension.entitlements
INFOPLIST_FILE: BitwardenShareExtension/Application/Support/Info.plist
sources:
- path: BitwardenShareExtension
excludes:
Expand Down Expand Up @@ -263,6 +269,9 @@ targets:
BitwardenShared:
type: framework
platform: iOS
configFiles:
Debug: Configs/BitwardenShared.xcconfig
Release: Configs/BitwardenShared.xcconfig
settings:
base:
APPLICATION_EXTENSION_API_ONLY: true
Expand Down