Skip to content

Commit f84ba7a

Browse files
committed
Build platform/arch specific xcbeautify binaries
1 parent 46a27fb commit f84ba7a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
SHELL=bash
1616
DOCKER_IMAGE=registry.gitlab.com/finestructure/swiftpackageindex
17+
PLATFORM=$(shell uname -s)
18+
ARCH=$(shell uname -m)
19+
XCBEAUTIFY_BINARY=.xcbeautify-$(PLATFORM)-$(ARCH)
1720

1821
ifndef VERSION
1922
export VERSION=$(shell git rev-parse HEAD)
@@ -36,7 +39,7 @@ run:
3639
test: xcbeautify
3740
set -o pipefail \
3841
&& swift test --disable-automatic-resolution --sanitize=thread \
39-
2>&1 | ./xcbeautify --renderer github-actions
42+
2>&1 | $(XCBEAUTIFY_BINARY) --renderer github-actions
4043

4144
test-query-performance: xcbeautify
4245
set -o pipefail \
@@ -45,7 +48,7 @@ test-query-performance: xcbeautify
4548
--filter QueryPerformanceTests \
4649
2>&1 | tee test.log
4750
grep "ℹ️" test.log
48-
grep -v "\] Compiling" test.log | ./xcbeautify --renderer github-actions
51+
grep -v "\] Compiling" test.log | $(XCBEAUTIFY_BINARY) --renderer github-actions
4952

5053
test-fast:
5154
@echo Skipping image snapshot tests
@@ -55,8 +58,8 @@ test-fast:
5558
xcbeautify:
5659
rm -rf .build/checkouts/xcbeautify
5760
git clone https://github.com/cpisciotta/xcbeautify.git .build/checkouts/xcbeautify
58-
cd .build/checkouts/xcbeautify && git checkout 2.25.1 && make build
59-
binpath=`cd .build/checkouts/xcbeautify && swift build -c release --show-bin-path` && ln -sf $$binpath/xcbeautify
61+
cd .build/checkouts/xcbeautify && git checkout 2.25.1 && swift build -c release
62+
binpath=`cd .build/checkouts/xcbeautify && swift build -c release --show-bin-path` && cp $$binpath/xcbeautify $(XCBEAUTIFY_BINARY)
6063

6164
docker-build: version
6265
docker build -t $(DOCKER_IMAGE):$(VERSION) .

0 commit comments

Comments
 (0)