-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
53 lines (39 loc) · 1.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.PHONY: magic version
export VERSION=$(shell git describe --always --tags --dirty)
clean:
swift package clean
force-clean:
rm -rf .build
build-docker-base:
docker build --tag rester-base -f Dockerfile.base .
build-docker-app: build-docker-base
@echo VERSION: $(VERSION)
docker tag rester-base finestructure/rester:base-$(VERSION)
docker build --tag rester:$(VERSION) -f Dockerfile.app --build-arg VERSION=$(VERSION) .
test-linux-spm: build-docker-base
# NB: the following requires > 4GB RAM for your docker machine
docker run --rm rester-base swift test --parallel
test-macos-xcode:
set -o pipefail && \
xcodebuild test \
-scheme Rester-Package \
-destination platform="macOS" \
-parallel-testing-enabled YES \
-enableCodeCoverage YES \
-derivedDataPath .build/derivedData
test-macos-spm: BUILD_DIR=$(shell swift build --show-bin-path)
test-macos-spm:
swift test --parallel --enable-code-coverage
xcrun llvm-cov report -ignore-filename-regex=".build/*" -instr-profile $(BUILD_DIR)/codecov/default.profdata $(BUILD_DIR)/rester
test-all: test-linux-spm test-macos-spm test-macos-xcode
magic:
sourcery --templates ./.sourcery --sources Tests --args testimports='@testable import '"ResterTests" --output Tests/LinuxMain.swift
release-macos: version
swift build -c release
release-linux: build-docker-base
docker run --rm -v $(PWD):/host -w /host rester-base swift build
install-macos: test-macos-spm release-macos
install .build/release/rester /usr/local/bin/
version:
@echo VERSION: $(VERSION)
@echo "public let ResterVersion = \"$(VERSION)\"" > Sources/ResterCore/Version.swift