Skip to content

Commit 678fe0e

Browse files
authored
Merge pull request #43 from akkyie/update-project
Update project
2 parents 7cfa848 + bbe43b6 commit 678fe0e

File tree

9 files changed

+820
-618
lines changed

9 files changed

+820
-618
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v2
19-
- run: make lint/xcode
2019
- uses: mxcl/xcodebuild@v1
2120
with:
2221
swift: ${{ matrix.swift }}
@@ -31,3 +30,19 @@ jobs:
3130
steps:
3231
- uses: actions/checkout@v2
3332
- run: make test/spm
33+
34+
lint_xcodeproj:
35+
runs-on: macos-11
36+
steps:
37+
- uses: actions/checkout@v2
38+
with:
39+
submodules: true
40+
- uses: actions/cache@v2
41+
with:
42+
path: .build
43+
key: ${{ runner.os }}-${{ hashFiles('Package.resolved') }}
44+
- uses: mxcl/xcodebuild@v1
45+
with:
46+
xcode: 12.5.1
47+
action: none
48+
- run: make xcodeproj && make lint/xcodeproj

.travis.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

Configs/SwiftPM.xcconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10
77
TVOS_DEPLOYMENT_TARGET = 9.0
88

99
// XCTest doesn't include bitcode
10-
ENABLE_BITCODE=NO
10+
ENABLE_BITCODE=NO
11+
12+
// Allows linking against XCTest
13+
ENABLE_TESTING_SEARCH_PATHS=YES

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,18 @@ test/docker: clean/spm linuxmain
3535
.PHONY: xcodeproj
3636
xcodeproj: $(PROJECT)
3737
$(PROJECT): .FORCE
38-
swift package generate-xcodeproj --enable-code-coverage --xcconfig-overrides $(XCCONFIG)
39-
@echo "warn: Don't forget to remove ./Examples from the project."
38+
swift package generate-xcodeproj \
39+
--enable-code-coverage \
40+
--skip-extra-files \
41+
--xcconfig-overrides $(XCCONFIG)
4042

4143
.PHONY: linuxmain
4244
linuxmain:
4345
swift test --generate-linuxmain
4446

45-
GREP_EXAMPLES_RESULT = $(shell grep "Examples" $(PROJECT)/project.pbxproj)
46-
.PHONY: lint/xcode
47-
lint/xcode:
48-
ifeq ($(GREP_EXAMPLES_RESULT),)
49-
@ echo "OK: Examples directory was not found in the project"
50-
else
51-
$(error Remove Examples directory from the project)
52-
endif
47+
.PHONY: lint/xcodeproj
48+
lint/xcodeproj:
49+
./Scripts/check_xcodeproj_diff.sh
5350

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

Package.resolved

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ let package = Package(
1010
targets: ["Tablier"]
1111
),
1212
],
13-
dependencies: [],
13+
dependencies: [
14+
.package(url: "https://github.com/bloomberg/xcdiff", .upToNextMinor(from: "0.7.0")),
15+
],
1416
targets: [
1517
.target(
1618
name: "Tablier",

Package@swift-4.2.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

Scripts/check_xcodeproj_diff.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
PROJECT_ROOT=$(dirname "$0")/..
6+
XCODEPROJ=$PROJECT_ROOT/Tablier.xcodeproj
7+
8+
TMPPROJ=$(mktemp -d)
9+
10+
XCDIFF="swift run -c release xcdiff"
11+
12+
echo "Changes after project generation:"
13+
if git diff --exit-code --name-only -- $XCODEPROJ ; then
14+
echo "No change found."
15+
exit 0;
16+
fi
17+
18+
rsync -a $XCODEPROJ/ $TMPPROJ/
19+
20+
git checkout -- $XCODEPROJ
21+
22+
function cleanup {
23+
echo "Cleaning up..."
24+
rsync -a $TMPPROJ/ $XCODEPROJ/
25+
rm -rf $TMPPROJ
26+
}
27+
28+
trap cleanup EXIT
29+
30+
if $XCDIFF -t "Tablier" -g "settings" -p1 $XCODEPROJ -p2 $TMPPROJ ; then
31+
exit 0;
32+
fi
33+
34+
exit 1;

0 commit comments

Comments
 (0)