Skip to content

Commit

Permalink
Simply build scripts: use local DerivedData instead of global
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Jan 22, 2024
1 parent ad82cf7 commit 61dd3b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/default.profraw
.DS_Store
/.local.xcconfig
/.xcode-build

# XCode User settings
xcuserdata/
13 changes: 3 additions & 10 deletions build-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ cd "$(dirname "$0")"
source ./script/setup.sh

./generate.sh
xcodebuild -scheme AeroSpace build -configuration Debug # no clean because it may lead to accessibility permission loss
xcodebuild -scheme AeroSpace-Tests build -configuration Debug # no clean because it may lead to accessibility permission loss
xcodebuild -scheme AeroSpace build -configuration Debug -derivedDataPath .xcode-build
xcodebuild -scheme AeroSpace-Tests build -configuration Debug -derivedDataPath .xcode-build
cd LocalPackage
swift build
cd - > /dev/null

rm -rf .debug && mkdir .debug
cd ~/Library/Developer/Xcode/DerivedData
if [ "$(ls | grep AeroSpace | wc -l)" -ne 1 ]; then
echo "Found several AeroSpace dirs in $(pwd)"
ls | grep AeroSpace
exit 1
fi
cd - > /dev/null
cp -r ~/Library/Developer/Xcode/DerivedData/AeroSpace*/Build/Products/Debug/AeroSpace-Debug.app .debug
cp -r .xcode-build/Build/Products/Debug/AeroSpace-Debug.app .debug
cp -r LocalPackage/.build/debug/aerospace .debug
12 changes: 2 additions & 10 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ EOF
check-clean-git-working-dir

generate-git-hash
xcodebuild -scheme AeroSpace build -configuration Release
xcodebuild -scheme AeroSpace clean build -configuration Release -derivedDataPath .xcode-build
cd LocalPackage
rm -rf .build
swift build -c release --arch arm64 --arch x86_64
cd - > /dev/null
git checkout LocalPackage/Sources/Common/gitHashGenerated.swift

rm -rf .release && mkdir .release
cd ~/Library/Developer/Xcode/DerivedData
if [ "$(ls | grep AeroSpace | wc -l)" -ne 1 ]; then
echo "Found several AeroSpace dirs in $(pwd)"
ls | grep AeroSpace
exit 1
fi
cd - > /dev/null
cp -r ~/Library/Developer/Xcode/DerivedData/AeroSpace*/Build/Products/Release/AeroSpace.app .release
cp -r .xcode-build/Build/Products/Release/AeroSpace.app .release
cp -r LocalPackage/.build/apple/Products/Release/aerospace .release

################
Expand Down
1 change: 1 addition & 0 deletions script/clean-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ source ./script/setup.sh
rm -rf AeroSpace.xcodeproj
./generate.sh
xcodebuild clean
rm -rf .xcode-build
rm -rf ~/Library/Developer/Xcode/DerivedData/AeroSpace-*

0 comments on commit 61dd3b9

Please sign in to comment.