Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Apr 3, 2024
1 parent c4c2472 commit 3c9bace
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ IOS_DESTINATION = 'platform=iOS Simulator,name=iPhone 15,OS=17.2'
WATCHOS_DESINTATION = 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.2'
TVOS_DESTINATION = 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=17.2'
VISIONOS_DESTINATION = 'platform=visionOS Simulator,name=Apple Vision Pro,OS=1.1'
BUILD_JOB_COUNT = 4

SWIFT_CONTAINER_IMAGE = swift:5.9.2-jammy

Expand Down Expand Up @@ -36,15 +35,15 @@ build:

.PHONY: build-linux
build-linux:
docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete"
docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete"

.PHONY: build-release
build-release:
swift build -c release --jobs 4 -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete

.PHONY: build-linux-release
build-linux-release:
docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -c release --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete"
docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -c release -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete"

.PHONY: build-docs
build-docs:
Expand All @@ -66,36 +65,36 @@ generate-docs:

.PHONY: test
test:
swift build --build-tests --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete
swift test --skip-build --parallel --filter $(TEST_TARGET) -Xswiftc -strict-concurrency=complete
swift build --build-tests -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete
swift test --skip-build --filter $(TEST_TARGET) -Xswiftc -strict-concurrency=complete

.PHONY: test-ios
test-ios:
set -o pipefail && NSUnbufferedIO=YES xcodebuild clean build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild clean build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) | xcbeautify

.PHONY: test-watchos
test-watchos:
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) -parallelizeTargets 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) -parallel-testing-enabled YES 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) | xcbeautify

.PHONY: test-tvos
test-tvos:
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) | xcbeautify

.PHONY: test-visionos
test-visionos:
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) | xcbeautify
set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) | xcbeautify

.PHONY: test-linux
test-linux:
docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build --build-tests -Xswiftc -warnings-as-errors && swift test --skip-build --filter $(TEST_TARGET)"

.PHONY: integration-test
integration-test: .check-env-vars
swift build --build-tests --jobs $(BUILD_JOB_COUNT) -Xswiftc -strict-concurrency=complete
swift build --build-tests -Xswiftc -strict-concurrency=complete
swift test --skip-build --filter $(INTEGRATION_TEST_TARGET) -Xswiftc -strict-concurrency=complete

.PHONY: ci
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import Foundation
import FoundationNetworking
#endif

final class MockURLProtocol: URLProtocol {
final class MockURLProtocol: URLProtocol, @unchecked Sendable{

Check failure on line 25 in Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Opening braces should be preceded by a single space and on the same line as the declaration (opening_brace)

Check warning on line 25 in Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift

View workflow job for this annotation

GitHub Actions / SwiftFormat

Add or remove space around curly braces. (spaceAroundBraces)

nonisolated(unsafe) static var data: Data?
nonisolated(unsafe) static var failError: Error?
nonisolated(unsafe) static var responseStatusCode: Int?
private(set) nonisolated(unsafe) static var lastRequest: URLRequest?
static var data: Data?
static var failError: Error?
static var responseStatusCode: Int?
private(set) static var lastRequest: URLRequest?

override class func canInit(with _: URLRequest) -> Bool {
true
Expand Down

0 comments on commit 3c9bace

Please sign in to comment.