Skip to content

Commit b59e298

Browse files
committed
Make Test Suite run on macOS
1 parent 9791c4d commit b59e298

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

.buildkite/pipeline.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ steps:
3434
queue: android
3535
plugins: *plugins
3636

37+
- label: ':swift: Lint Swift Package'
38+
command: make lint-swift
39+
plugins: *plugins
40+
3741
- label: ':swift: Test Swift Package'
3842
command: make test-swift-package
3943
plugins: *plugins

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ lint-js: npm-dependencies
4747
test-js: npm-dependencies
4848
npm run test -- run
4949

50+
lint-swift:
51+
swift package plugin swiftlint
52+
5053
local-android-library: build
5154
echo "--- :android: Building Library"
5255
./android/gradlew -p ./android :gutenberg:publishToMavenLocal -exclude-task prepareToPublishToS3
@@ -59,4 +62,4 @@ build-swift-package: build
5962
$(call XCODEBUILD_CMD, build)
6063

6164
test-swift-package: build
62-
$(call XCODEBUILD_CMD, test)
65+
swift test

ios/Sources/GutenbergKit/Sources/EditorBlockPicker.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import SwiftUI
22

3+
#if canImport(UIKit)
34
// TODO: Add search
45
// TODO: Group these properly
56
struct EditorBlockPicker: View {
@@ -217,3 +218,4 @@ struct EditorBlockPickerSection: Identifiable {
217218
let name: String
218219
let blockTypes: [EditorBlockType]
219220
}
221+
#endif

ios/Sources/GutenbergKit/Sources/EditorViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import UIKit
21
import WebKit
32
import SwiftUI
43
import Combine
54

5+
#if canImport(UIKit)
6+
import UIKit
7+
68
@MainActor
79
public final class EditorViewController: UIViewController, GutenbergEditorControllerDelegate {
810
public let webView: WKWebView
@@ -395,3 +397,4 @@ private final class GutenbergEditorController: NSObject, WKNavigationDelegate, W
395397
private extension WKWebView {
396398

397399
}
400+
#endif

ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22

3+
#if canImport(UIKit)
34
public protocol EditorViewControllerDelegate: AnyObject {
45
/// Called when the editor loads.
56
func editorDidLoad(_ viewContoller: EditorViewController)
@@ -32,6 +33,7 @@ public protocol EditorViewControllerDelegate: AnyObject {
3233

3334
func editor(_ viewController: EditorViewController, didRequestMediaFromSiteMediaLibrary config: OpenMediaLibraryAction)
3435
}
36+
#endif
3537

3638
public struct EditorState {
3739
/// Set to `true` if the editor has non-empty content.

ios/Sources/GutenbergKit/Sources/GBWebView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import WebKit
22

33
class GBWebView: WKWebView {
44

5+
#if canImport(UIKit)
56
/// Disables the default bottom bar that competes with the Gutenberg inserter
67
///
78
override var inputAccessoryView: UIView? {
89
nil
910
}
11+
#endif
1012
}

0 commit comments

Comments
 (0)