Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
akkyie committed Aug 20, 2021
1 parent 872d593 commit 72eddba
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: mxcl/xcodebuild@v1
with:
xcode: 12.5.1
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Vendor/xcdiff"]
path = Vendor/xcdiff
url = https://github.com/bloomberg/xcdiff
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ linuxmain:

.PHONY: lint/xcodeproj
lint/xcodeproj:
@git diff --exit-code -- $(PROJECT)/project.pbxproj || \
(@echo "::error::$(PROJECT)/project.pbxproj has uncommited change. Check the result after running `make xcodeproj`"; exit 1)
./Scripts/check_xcodeproj_diff.sh

LATEST_VERSION = $(shell git describe --tags `git rev-list --tags --max-count=1`)

Expand Down
34 changes: 34 additions & 0 deletions Scripts/check_xcodeproj_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

set -euxo pipefail

PROJECT_ROOT=$(dirname "$0")/..
XCODEPROJ=$PROJECT_ROOT/Tablier.xcodeproj

TMPPROJ=$(mktemp -d)

XCDIFF="swift run -c release --package-path Vendor/xcdiff xcdiff"

echo "Changes after project generation:"
if git diff --exit-code --name-only -- $XCODEPROJ ; then
echo "No change found."
exit 0;
fi

rsync -a $XCODEPROJ/ $TMPPROJ/

git checkout -- $XCODEPROJ

function cleanup {
echo "Cleaning up..."
rsync -a $TMPPROJ/ $XCODEPROJ/
rm -rf $TMPPROJ
}

trap cleanup EXIT

if $XCDIFF -t "Tablier" -g "settings" -p1 $XCODEPROJ -p2 $TMPPROJ ; then
exit 0;
fi

exit 1;
1 change: 1 addition & 0 deletions Vendor/xcdiff
Submodule xcdiff added at 282a77

0 comments on commit 72eddba

Please sign in to comment.