From 121bc432f268dcd88cb04f582148ae6059dc4a8f Mon Sep 17 00:00:00 2001 From: Lars <134181853+bo2themax@users.noreply.github.com> Date: Thu, 11 Sep 2025 11:26:17 +0200 Subject: [PATCH 1/4] Remove DEVELOPMENT_TEAM from xcodeproj Removing this can prevent Xcode from modifying "$(inherited)" to derived team ID when users select the signing tab, to avoid unintended changes. --- WWDC.xcodeproj/project.pbxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/WWDC.xcodeproj/project.pbxproj b/WWDC.xcodeproj/project.pbxproj index 447f8a60..42e30a3e 100644 --- a/WWDC.xcodeproj/project.pbxproj +++ b/WWDC.xcodeproj/project.pbxproj @@ -822,7 +822,6 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 72X6ZPCY5L; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -884,7 +883,6 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 72X6ZPCY5L; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -997,7 +995,6 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 72X6ZPCY5L; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -1090,7 +1087,6 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 72X6ZPCY5L; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; From b434bf8bb288a817f4a099f36c6c048d7d2eb65e Mon Sep 17 00:00:00 2001 From: Lars <134181853+bo2themax@users.noreply.github.com> Date: Thu, 11 Sep 2025 11:26:47 +0200 Subject: [PATCH 2/4] Update Package.resolved for ConfCore --- Packages/ConfCore/Package.resolved | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Packages/ConfCore/Package.resolved b/Packages/ConfCore/Package.resolved index f6853abd..fd5ae01a 100644 --- a/Packages/ConfCore/Package.resolved +++ b/Packages/ConfCore/Package.resolved @@ -18,15 +18,6 @@ "revision" : "0aed3041c4d03c07280fb6f47fabd943a337a43a" } }, - { - "identity" : "macpreviewutils", - "kind" : "remoteSourceControl", - "location" : "git@github.com:insidegui/MacPreviewUtils.git", - "state" : { - "revision" : "3d52597e5b6b65698b96e037539d2058c4668815", - "version" : "1.0.0" - } - }, { "identity" : "realm-swift", "kind" : "remoteSourceControl", From 497a7b15b9e210f56a276f64e726d8199f6114e4 Mon Sep 17 00:00:00 2001 From: Lars <134181853+bo2themax@users.noreply.github.com> Date: Fri, 12 Sep 2025 10:31:19 +0200 Subject: [PATCH 3/4] Move scripts and update README --- README.md | 6 +++--- bootstrap.sh => scripts/bootstrap.sh | 4 ++-- cleardata.sh => scripts/cleardata.sh | 0 cleardebugdata.sh => scripts/cleardebugdata.sh | 5 +++-- resetSync.sh => scripts/resetSync.sh | 0 teamid.sh => scripts/teamid.sh | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) rename bootstrap.sh => scripts/bootstrap.sh (96%) rename cleardata.sh => scripts/cleardata.sh (100%) rename cleardebugdata.sh => scripts/cleardebugdata.sh (89%) rename resetSync.sh => scripts/resetSync.sh (100%) rename teamid.sh => scripts/teamid.sh (96%) diff --git a/README.md b/README.md index 5e3229cd..47c43fd2 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ A number of third-party libraries are used by the app: **Building requires Xcode 16 or later.** -**Clone this branch and before opening the project, run `./bootstrap.sh`** to setup the environment. The script will ask for your Apple Developer team ID in order to configure the project. There's no need to change any code signing settings in Xcode. The bootstrap script will also install `swiftlint` for you using `brew` if you don’t have it yet. +**Clone this branch and before opening the project, run `scripts/bootstrap.sh`** to setup the environment. The script will ask for your Apple Developer team ID in order to configure the project. There's no need to change any code signing settings in Xcode. The bootstrap script will also install `swiftlint` for you using `brew` if you don’t have it yet. Since the app uses CloudKit, when you build it yourself, all CloudKit-related functionality will be disabled. @@ -89,6 +89,6 @@ Since the app uses CloudKit, when you build it yourself, all CloudKit-related fu ### Clearing app data during development -If you need to clear the app’s preferences and stored data during development, you can run `./cleardata.sh` or `./cleardebugdata.sh` (if using -WWDCUseDebugStorage YES) in the project folder. **This will delete all of your preferences and data like favorites, bookmarks and progress in videos, so be careful**. +If you need to clear the app’s preferences and stored data during development, you can run `scripts/cleardata.sh` or `scripts/cleardebugdata.sh` (if using -WWDCUseDebugStorage YES) in the project folder. **This will delete all of your preferences and data like favorites, bookmarks and progress in videos, so be careful**. -Powered by MacStadium \ No newline at end of file +Powered by MacStadium diff --git a/bootstrap.sh b/scripts/bootstrap.sh similarity index 96% rename from bootstrap.sh rename to scripts/bootstrap.sh index a48175fc..9e050595 100755 --- a/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -5,7 +5,7 @@ fi echo "" -./teamid.sh +$(dirname "${BASH_SOURCE[0]}")/teamid.sh lessThanOrEqual() { [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] @@ -49,4 +49,4 @@ if ! $SWIFTLINT_INSTALLED || ! $SWIFTLINT_UPDATED; then fi fi -echo "All done" \ No newline at end of file +echo "All done" diff --git a/cleardata.sh b/scripts/cleardata.sh similarity index 100% rename from cleardata.sh rename to scripts/cleardata.sh diff --git a/cleardebugdata.sh b/scripts/cleardebugdata.sh similarity index 89% rename from cleardebugdata.sh rename to scripts/cleardebugdata.sh index 0ee07535..421b2ed2 100755 --- a/cleardebugdata.sh +++ b/scripts/cleardebugdata.sh @@ -3,7 +3,8 @@ echo "" # Check if TeamID.xcconfig exists and extract team ID -TEAM_ID_CONFIG="WWDC/TeamID.xcconfig" +TEAM_ID_CONFIG=$(dirname "${BASH_SOURCE[0]}")/../WWDC/Config/TeamID.xcconfig + if [ -f "$TEAM_ID_CONFIG" ]; then # Extract team ID from the config file TEAM_ID=$(grep "DEVELOPMENT_TEAM=" "$TEAM_ID_CONFIG" | cut -d'=' -f2) @@ -25,4 +26,4 @@ echo "Removing DEBUG data folder at $DEBUG_FOLDER_PATH" rm -R "$DEBUG_FOLDER_PATH" || { echo "Failed to remove :("; exit 1; } echo "All good!" -echo "" \ No newline at end of file +echo "" diff --git a/resetSync.sh b/scripts/resetSync.sh similarity index 100% rename from resetSync.sh rename to scripts/resetSync.sh diff --git a/teamid.sh b/scripts/teamid.sh similarity index 96% rename from teamid.sh rename to scripts/teamid.sh index 85b284e1..e9ead255 100755 --- a/teamid.sh +++ b/scripts/teamid.sh @@ -1,6 +1,6 @@ #!/bin/bash -TEAM_ID_FILE=WWDC/Config/TeamID.xcconfig +TEAM_ID_FILE=$(dirname "${BASH_SOURCE[0]}")/../WWDC/Config/TeamID.xcconfig function print_team_ids() { echo "" From 1e27414cc6598c0c07ac183e1fcf95d82153d631 Mon Sep 17 00:00:00 2001 From: Lars <134181853+bo2themax@users.noreply.github.com> Date: Fri, 12 Sep 2025 11:00:48 +0200 Subject: [PATCH 4/4] Add pre commit check for developer team --- scripts/bootstrap.sh | 6 +++- .../git_hooks/xcodeproj_developer_team_check | 29 +++++++++++++++++++ scripts/setup_git_hooks.sh | 13 +++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 scripts/git_hooks/xcodeproj_developer_team_check create mode 100755 scripts/setup_git_hooks.sh diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 9e050595..06051e3c 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -5,7 +5,11 @@ fi echo "" -$(dirname "${BASH_SOURCE[0]}")/teamid.sh +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + +$SCRIPT_DIR/teamid.sh + +$SCRIPT_DIR/setup_git_hooks.sh lessThanOrEqual() { [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] diff --git a/scripts/git_hooks/xcodeproj_developer_team_check b/scripts/git_hooks/xcodeproj_developer_team_check new file mode 100644 index 00000000..e71484b6 --- /dev/null +++ b/scripts/git_hooks/xcodeproj_developer_team_check @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# runs pbxproj check against the git diff + +made_changes = false + +`git status --porcelain`.split('\n').each do |line| + components = line.split(' ') + next if components.count < 2 + code = components[0] + next if code != 'M' + file = components[1] + extension = file.split('.').last + next if extension != 'pbxproj' + + pattern = /^[[:blank:]]*DEVELOPMENT_TEAM[[:blank:]]*=[[:blank:]]*[A-Za-z0-9]*;[[:blank:]]*$/ + + original = File.read(file) + filtered = original.lines.reject { |line| line.match(pattern) }.join + + if filtered != original + File.write(file, filtered) + made_changes = true + end +end + +if made_changes + puts "Had to remove DEVELOPMENT_TEAM from the pbxproj file - verify them and re-commit." + abort() +end diff --git a/scripts/setup_git_hooks.sh b/scripts/setup_git_hooks.sh new file mode 100755 index 00000000..82ebba33 --- /dev/null +++ b/scripts/setup_git_hooks.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# sets up pre commit hooks + +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + +[ -e $SCRIPT_DIR/../.git/hooks/pre-commit ] && rm $SCRIPT_DIR/../.git/hooks/pre-commit +mkdir -p $SCRIPT_DIR/../.git/hooks + +touch $SCRIPT_DIR/../.git/hooks/pre-commit + +chmod +x $SCRIPT_DIR/../.git/hooks/pre-commit + +cat $SCRIPT_DIR/git_hooks/xcodeproj_developer_team_check >> $SCRIPT_DIR/../.git/hooks/pre-commit