Skip to content

Commit

Permalink
Merge pull request #43 from akkyie/update-project
Browse files Browse the repository at this point in the history
Update project
  • Loading branch information
akkyie authored Aug 21, 2021
2 parents 7cfa848 + bbe43b6 commit 678fe0e
Show file tree
Hide file tree
Showing 9 changed files with 820 additions and 618 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: make lint/xcode
- uses: mxcl/xcodebuild@v1
with:
swift: ${{ matrix.swift }}
Expand All @@ -31,3 +30,19 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: make test/spm

lint_xcodeproj:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('Package.resolved') }}
- uses: mxcl/xcodebuild@v1
with:
xcode: 12.5.1
action: none
- run: make xcodeproj && make lint/xcodeproj
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion Configs/SwiftPM.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10
TVOS_DEPLOYMENT_TARGET = 9.0

// XCTest doesn't include bitcode
ENABLE_BITCODE=NO
ENABLE_BITCODE=NO

// Allows linking against XCTest
ENABLE_TESTING_SEARCH_PATHS=YES
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,18 @@ test/docker: clean/spm linuxmain
.PHONY: xcodeproj
xcodeproj: $(PROJECT)
$(PROJECT): .FORCE
swift package generate-xcodeproj --enable-code-coverage --xcconfig-overrides $(XCCONFIG)
@echo "warn: Don't forget to remove ./Examples from the project."
swift package generate-xcodeproj \
--enable-code-coverage \
--skip-extra-files \
--xcconfig-overrides $(XCCONFIG)

.PHONY: linuxmain
linuxmain:
swift test --generate-linuxmain

GREP_EXAMPLES_RESULT = $(shell grep "Examples" $(PROJECT)/project.pbxproj)
.PHONY: lint/xcode
lint/xcode:
ifeq ($(GREP_EXAMPLES_RESULT),)
@ echo "OK: Examples directory was not found in the project"
else
$(error Remove Examples directory from the project)
endif
.PHONY: lint/xcodeproj
lint/xcodeproj:
./Scripts/check_xcodeproj_diff.sh

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

Expand Down
61 changes: 61 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"object": {
"pins": [
{
"package": "AEXML",
"repositoryURL": "https://github.com/tadija/AEXML",
"state": {
"branch": null,
"revision": "8623e73b193386909566a9ca20203e33a09af142",
"version": "4.5.0"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit",
"state": {
"branch": null,
"revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511",
"version": "1.0.0"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53",
"version": "0.9.2"
}
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "3b6b97d612b56e25d80d0807f5bc38ea08b7bdf3",
"version": "0.2.3"
}
},
{
"package": "xcdiff",
"repositoryURL": "https://github.com/bloomberg/xcdiff",
"state": {
"branch": null,
"revision": "282a77303b8e0c2cb20f9303e25086d9a2fb5ae3",
"version": "0.7.0"
}
},
{
"package": "XcodeProj",
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
"state": {
"branch": null,
"revision": "0b18c3e7a10c241323397a80cb445051f4494971",
"version": "8.0.0"
}
}
]
},
"version": 1
}
4 changes: 3 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ let package = Package(
targets: ["Tablier"]
),
],
dependencies: [],
dependencies: [
.package(url: "https://github.com/bloomberg/xcdiff", .upToNextMinor(from: "0.7.0")),
],
targets: [
.target(
name: "Tablier",
Expand Down
25 changes: 0 additions & 25 deletions [email protected]

This file was deleted.

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 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;
Loading

0 comments on commit 678fe0e

Please sign in to comment.