From 1e8b894298b37735c5378f58c523385e837beff7 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 7 Aug 2023 10:23:17 +0300 Subject: [PATCH] Prevent xcodegen from creating temporary references in the project file --- .githooks/post-checkout | 2 +- ElementX.xcodeproj/project.pbxproj | 21 +++++++++------------ ElementX/SupportingFiles/secrets.xcconfig | 20 ++++++++++++++++++++ ElementX/SupportingFiles/target.yml | 4 ++-- fastlane/Fastfile | 2 +- project.yml | 1 - 6 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 ElementX/SupportingFiles/secrets.xcconfig diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 536363009..5765f32c0 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -6,4 +6,4 @@ git lfs post-checkout "$@" export PATH="$PATH:/opt/homebrew/bin" # ignores updates of 'secrets.xcconfig' to avoid pushing sensitive data by mistake -git update-index --assume-unchanged secrets.xcconfig \ No newline at end of file +git update-index --assume-unchanged ElementX/SupportingFiles/secrets.xcconfig \ No newline at end of file diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index eda445e34..4273a5605 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -988,7 +988,6 @@ 40B21E611DADDEF00307E7AC /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; 4132F882A984ED971338EE9D /* ReportContentScreenUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportContentScreenUITests.swift; sourceTree = ""; }; 4151163F666ED94FD959475A /* NotificationName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationName.swift; sourceTree = ""; }; - 41553551C55AD59885840F0E /* secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = secrets.xcconfig; sourceTree = ""; }; 4176C3E20C772DE8D182863C /* LegalInformationScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegalInformationScreen.swift; sourceTree = ""; }; 421E716C521F96D24ECE69B3 /* NoticeRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeRoomTimelineItem.swift; sourceTree = ""; }; 421FA93BCC2840E66E4F306F /* NotificationSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1439,11 +1438,14 @@ E55B5EA766E89FF1F87C3ACB /* RoomNotificationSettingsProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsProxyProtocol.swift; sourceTree = ""; }; E5C3AACCAA82392D08924496 /* EmojiMartCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiMartCategory.swift; sourceTree = ""; }; E5E94DCFEE803E5ABAE8ACCE /* KeychainControllerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainControllerProtocol.swift; sourceTree = ""; }; + E5F2B6443D1ED8602F328539 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Localizable.stringsdict; sourceTree = ""; }; E6281B199D8A8F0892490C2E /* OnboardingCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCoordinator.swift; sourceTree = ""; }; + E65DA46BD5CA83747AE144F3 /* secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = secrets.xcconfig; sourceTree = ""; }; E6E6BDF9D26DB05C88901416 /* RedactedRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedactedRoomTimelineItem.swift; sourceTree = ""; }; E6F5D66F158A6662F953733E /* NotificationSettingsProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettingsProxy.swift; sourceTree = ""; }; E6FCC416A3BFE73DF7B3E6BF /* RoomTimelineControllerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineControllerFactory.swift; sourceTree = ""; }; E80F9E9B93B6ECE9A937B1C6 /* FormRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormRow.swift; sourceTree = ""; }; + E8294DB9E95C0C0630418466 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; E8774CF614849664B5B3C2A1 /* UserSessionFlowCoordinatorStateMachine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSessionFlowCoordinatorStateMachine.swift; sourceTree = ""; }; E8AE4B3273BA189FDCD4055C /* UserIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicator.swift; sourceTree = ""; }; E8CA187FE656EE5A3F6C7DE5 /* UIFont+AttributedStringBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIFont+AttributedStringBuilder.m"; sourceTree = ""; }; @@ -1696,6 +1698,7 @@ 3D4DD336905C72F95EAF34B7 /* ElementX-Bridging-Header.h */, 9C5E81214D27A6B898FC397D /* ElementX.entitlements */, 81B17DB1BC3B0C62AF84D230 /* Info.plist */, + E65DA46BD5CA83747AE144F3 /* secrets.xcconfig */, F012CB5EE3F2B67359F6CC52 /* target.yml */, ); path = SupportingFiles; @@ -2069,7 +2072,6 @@ isa = PBXGroup; children = ( 5D26A086A8278D39B5756D6F /* project.yml */, - 41553551C55AD59885840F0E /* secrets.xcconfig */, 99B9B46F2D621380428E68F7 /* ElementX */, A4852B57D55D71EEBFCD931D /* UnitTests */, C0FAC17D4DD7D3A502822550 /* UITests */, @@ -3673,14 +3675,6 @@ path = Timeline; sourceTree = ""; }; - "TEMP_9E86D325-D1C7-441E-B1F2-A3D93615813E" /* element-x-ios */ = { - isa = PBXGroup; - children = ( - 41553551C55AD59885840F0E /* secrets.xcconfig */, - ); - path = "element-x-ios"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -3895,6 +3889,7 @@ fr, it, ro, + ru, sk, ); mainGroup = 405B00F139AEE3994601B36A; @@ -4839,6 +4834,7 @@ 653610CB5F9776EAAAB98155 /* fr */, 6FC5015B9634698BDB8701AF /* it */, E9D059BFE329BE09B6D96A9F /* ro */, + E5F2B6443D1ED8602F328539 /* ru */, 667DD3A9D932D7D9EB380CAA /* sk */, ); name = Localizable.stringsdict; @@ -4854,6 +4850,7 @@ CC680E0E79D818706CB28CF8 /* fr */, 7B04BD3874D736127A8156B8 /* it */, 33E49C5C6F802B4D94CA78D1 /* ro */, + E8294DB9E95C0C0630418466 /* ru */, AD378D580A41E42560C60E9C /* sk */, ); name = Localizable.strings; @@ -4930,7 +4927,7 @@ }; 62E1B7866DF0ED442C39A83B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 41553551C55AD59885840F0E /* secrets.xcconfig */; + baseConfigurationReference = E65DA46BD5CA83747AE144F3 /* secrets.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements; @@ -4954,7 +4951,7 @@ }; 6897D5BC19A2EA6ABD57DE7E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 41553551C55AD59885840F0E /* secrets.xcconfig */; + baseConfigurationReference = E65DA46BD5CA83747AE144F3 /* secrets.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements; diff --git a/ElementX/SupportingFiles/secrets.xcconfig b/ElementX/SupportingFiles/secrets.xcconfig new file mode 100644 index 000000000..5eb6c8137 --- /dev/null +++ b/ElementX/SupportingFiles/secrets.xcconfig @@ -0,0 +1,20 @@ +// +// Copyright 2023 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Configuration settings file format documentation can be found at: +// https://help.apple.com/xcode/#/dev745c5c974 + +MAPLIBRE_API_KEY = your_key diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index 09059695e..f1a45a503 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -46,8 +46,8 @@ targets: platform: iOS configFiles: - Debug: ../../secrets.xcconfig - Release: ../../secrets.xcconfig + Debug: ../SupportingFiles/secrets.xcconfig + Release: ../SupportingFiles/secrets.xcconfig info: path: ../SupportingFiles/Info.plist diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c7063cd7c..419eb8339 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -428,7 +428,7 @@ private_lane :config_maplibre do UI.user_error!("Invalid Map Libre API key.") unless !api_key.to_s.empty? set_xcconfig_value( - path: './secrets.xcconfig', + path: './ElementX/SupportingFiles/secrets.xcconfig', name: 'MAPLIBRE_API_KEY', value: api_key ) diff --git a/project.yml b/project.yml index 2a66926b5..2d6a3a82b 100644 --- a/project.yml +++ b/project.yml @@ -4,7 +4,6 @@ attributes: fileGroups: - project.yml - - secrets.xcconfig options: groupSortPosition: bottom