Skip to content

Commit

Permalink
Updates makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Miiha committed Sep 7, 2023
1 parent 89970e7 commit e64f79a
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV,tvOS-16)
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch,watchOS-9)

default: test
default: swift-test

build-all-platforms:
for platform in \
Expand All @@ -22,18 +22,12 @@ build-all-platforms:
-destination platform="$$platform" || exit 1; \
done;

test-swift:
swift test
swift test -c release

build-for-static-stdlib:
@swift build -c debug --static-swift-stdlib
@swift build -c release --static-swift-stdlib

test-integration:
xcrun xcodebuild test \
-scheme "Integration" \
-destination platform="$(PLATFORM_IOS)" || exit 1; \
format:
swift format \
--ignore-unparsable-files \
--in-place \
--recursive \
./Package.swift ./Sources ./Tests

build-for-library-evolution:
swift build \
Expand All @@ -42,26 +36,11 @@ build-for-library-evolution:
-Xswiftc -emit-module-interface \
-Xswiftc -enable-library-evolution

build-for-static-stdlib-docker:
@docker run \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.8-focal \
bash -c "swift build -c debug --static-swift-stdlib"
@docker run \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.8-focal \
bash -c "swift build -c release --static-swift-stdlib"

format:
swift format \
--ignore-unparsable-files \
--in-place \
--recursive \
./Package.swift ./Sources ./Tests
test-swift:
swift test
swift test -c release

.PHONY: test test-swift build-for-library-evolution format
.PHONY: test-swift build-for-library-evolution format

define udid_for
$(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | .[] | select(.key | contains("$(2)")) | .value | last.udid')
Expand Down

0 comments on commit e64f79a

Please sign in to comment.