Last active
August 24, 2021 06:57
-
-
Save MrSmart00/5a963da697f0ae91554060dd5faba5c8 to your computer and use it in GitHub Desktop.
Xcode Project handling with XcodeGen and an environment value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# DEVELOPMENT / STAGING / PRODUCTION | |
export ENVIRONMENT=PRODUCTION | |
export DISPLAY_NAME=Sample | |
export BUNDLE_IDENTIFIER=com.example.sample | |
export PROVISIONING_PROFILE=Sample\ Provisioning\(Adhoc\) | |
# Generate Project | |
mint run xcodegen generate | |
bundle exec fastlane bootstrap | |
echo "🏁 \033[32mBootstrap Completed!\033[m 🏁" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SampleApp | |
options: | |
deploymentTarget: | |
iOS: 13.0 | |
xcodeVersion: "12.5" | |
bundleIdPrefix: com.exam | |
settings: | |
MARKETING_VERSION: 1.0.1 | |
CURRENT_PROJECT_VERSION: 1 | |
targetTemplates: | |
framework-base: | |
type: framework | |
platform: iOS | |
sources: | |
- path: ${target_name} | |
unit-test-base: | |
type: bundle.unit-test | |
platform: iOS | |
sources: | |
- path: ${target_name} | |
ui-test-base: | |
type: bundle.ui-testing | |
platform: iOS | |
sources: | |
- path: ${target_name} | |
targets: | |
App: | |
type: application | |
platform: iOS | |
settings: | |
base: | |
TARGETED_DEVICE_FAMILY: 1 | |
ENVIRONMENT: ${ENVIRONMENT} | |
BUNDLE_DISPLAY_NAME: ${DISPLAY_NAME} | |
PRODUCT_BUNDLE_IDENTIFIER: ${BUNDLE_IDENTIFIER} | |
configs: | |
debug: | |
CODE_SIGN_STYLE: Automatic | |
release: | |
CODE_SIGN_STYLE: Manual | |
CODE_SIGN_IDENTITY: iPhone Distribution | |
DEVELOPMENT_TEAM: ABCDEFGHIJ | |
PROVISIONING_PROFILE_SPECIFIER: ${PROVISIONING_PROFILE} | |
sources: | |
- App | |
dependencies: | |
- target: Domain | |
- target: API | |
scheme: | |
testTargets: | |
- AppTests | |
- DomainTests | |
- APITests | |
gatherCoverageData: true | |
postBuildScripts: | |
- name: Swiftlint Script | |
shell: /bin/sh | |
script: | | |
${PODS_ROOT}/SwiftLint/swiftlint autocorrect --format | |
${PODS_ROOT}/SwiftLint/swiftlint | |
- name: Switch GoogleService-Info.plist | |
shell: /bin/sh | |
script: | | |
if [ "${ENVIRONMENT}" == "DEVELOPMENT" ]; then | |
cp "${PROJECT_DIR}/${PRODUCT_NAME}/GoogleService-Info-dev.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
elif [ "${ENVIRONMENT}" == "STAGING" ]; then | |
cp "${PROJECT_DIR}/${PRODUCT_NAME}/GoogleService-Info-stg.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
else | |
cp "${PROJECT_DIR}/${PRODUCT_NAME}/GoogleService-Info-prod.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
fi | |
"${PODS_ROOT}/FirebaseCrashlytics/run" | |
AppTests: | |
templates: | |
- unit-test-base | |
dependencies: | |
- target: App | |
- target: API | |
Domain: | |
templates: | |
- framework-base | |
scheme: | |
testTargets: | |
- DomainTests | |
DomainTests: | |
templates: | |
- unit-test-base | |
dependencies: | |
- target: Domain | |
API: | |
templates: | |
- framework-base | |
scheme: | |
testTarget: | |
- APITests | |
APITests: | |
templates: | |
- unit-test-base | |
dependencies: | |
- target: API |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment