-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ DerivedData/ | |
.DerivedData-iOS/ | ||
.DerivedData-macOS/ | ||
|
||
coverage_*.txt | ||
percentage_*.txt | ||
|
||
**/*.old | ||
|
||
Gemfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
PLATFORM_IOS = iOS Simulator,name=iPad mini (A17 Pro) | ||
PLATFORM_MACOS = macOS | ||
XCCOV = xcrun xccov view --report --only-targets | ||
|
||
default: build | ||
|
||
build-iOS: | ||
rm -rf "$(PWD)/.DerivedData-iOS" | ||
xcodebuild build \ | ||
-scheme 'iOS App' \ | ||
-derivedDataPath "$(PWD)/.DerivedData-iOS" \ | ||
-destination platform="$(PLATFORM_IOS)" | ||
default: report | ||
|
||
test-iOS: | ||
rm -rf "$(PWD)/.DerivedData-iOS" | ||
xcodebuild test \ | ||
-scheme 'iOS App' \ | ||
-derivedDataPath "$(PWD)/.DerivedData-iOS" \ | ||
-destination platform="$(PLATFORM_IOS)" | ||
-destination platform="$(PLATFORM_IOS)" \ | ||
-enableCodeCoverage YES | ||
|
||
build-macOS: | ||
rm -rf "$(PWD)/.DerivedData-macOS" | ||
xcodebuild build \ | ||
-scheme 'macOS App' \ | ||
-derivedDataPath "$(PWD)/.DerivedData-macOS" \ | ||
-destination platform="$(PLATFORM_MACOS)" \ | ||
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
coverage-iOS: test-iOS | ||
$(XCCOV) "$(PWD)/.DerivedData-iOS/Logs/Test/Test-iOS App-"*.xcresult > coverage_iOS.txt | ||
echo "iOS Coverage:" | ||
cat coverage_iOS.txt | ||
|
||
percentage-iOS: coverage-iOS | ||
awk '/ AUv3-Support / { print $$4 }' coverage_iOS.txt > percentage_iOS.txt | ||
echo "iOS Coverage Pct:" | ||
cat percentage_iOS.txt | ||
|
||
test-macOS: | ||
rm -rf "$(PWD)/.DerivedData-macOS" | ||
xcodebuild test \ | ||
-scheme 'macOS App' \ | ||
-derivedDataPath "$(PWD)/.DerivedData-macOS" \ | ||
-destination platform="$(PLATFORM_MACOS)" \ | ||
-enableCodeCoverage YES \ | ||
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | ||
|
||
build: test-iOS test-macOS | ||
coverage-macOS: test-macOS | ||
$(XCCOV) "$(PWD)/.DerivedData-macOS/Logs/Test/Test-macOS App-"*.xcresult > coverage_macOS.txt | ||
echo "macOS Coverage:" | ||
cat coverage_macOS.txt | ||
|
||
percentage-macOS: coverage-macOS | ||
awk '/ AUv3-Support / { print $$4 }' coverage_macOS.txt > percentage_macOS.txt | ||
echo "macOS Coverage Pct:" | ||
cat percentage_macOS.txt | ||
|
||
report: percentage-iOS percentage-macOS | ||
@if [[ -n "$$GITHUB_ENV" ]]; then \ | ||
echo "PERCENTAGE=$$(< percentage_macOS.txt)" >> $$GITHUB_ENV; \ | ||
fi | ||
|
||
.PHONY: build build-iOS test-macOS | ||
.PHONY: report test-iOS test-macOS coverage-iOS coverage-macOS coverage-iOS percentage-macOS percentage-iOS | ||
|
||
clean: | ||
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS | ||
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS coverage*.txt percentage*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters