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", 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/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; diff --git a/bootstrap.sh b/scripts/bootstrap.sh similarity index 92% rename from bootstrap.sh rename to scripts/bootstrap.sh index a48175fc..06051e3c 100755 --- a/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -5,7 +5,11 @@ fi echo "" -./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`" ] @@ -49,4 +53,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/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/resetSync.sh b/scripts/resetSync.sh similarity index 100% rename from resetSync.sh rename to scripts/resetSync.sh 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 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 ""