Skip to content

Commit

Permalink
Make EventKit Imports Explicit (#149)
Browse files Browse the repository at this point in the history
* Add PERMISSIONSWIFTUI_EVENT SwiftSetting definition to JMRemindersPermissionManager and JMCalendarPermissionManager target definitions.

* Wrap EventPermissionManager, JMRemindersPermissionManager, and JMCalendarPermissionManager with PERMISSIONSWIFTUI_EVENT check

---------

Co-authored-by: Jevon Mao <[email protected]>
  • Loading branch information
forgot and jevonmao authored Feb 23, 2024
1 parent f33413e commit bd4ef03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
12 changes: 9 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ let permissionsTargets: [Target] = [
.target(
name: "PermissionsSwiftUICalendar",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"]
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_EVENT")
]
),
.target(
name: "PermissionsSwiftUICamera",
Expand Down Expand Up @@ -93,7 +96,10 @@ let permissionsTargets: [Target] = [
.target(
name: "PermissionsSwiftUIReminder",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"]
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_EVENT")
]
),
.target(
name: "PermissionsSwiftUISpeech",
Expand Down Expand Up @@ -142,4 +148,4 @@ let package = Package(
),

] + permissionsTargets
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//

import Foundation

#if !os(tvOS) && PERMISSIONSWIFTUI_EVENT
import EventKit

open class EventPermissionManager: PermissionManager {
Expand Down Expand Up @@ -52,3 +54,4 @@ open class EventPermissionManager: PermissionManager {
}

}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// Created by Jevon Mao on 1/31/21.
//

import UIKit
#if !os(tvOS)
import Foundation
#if !os(tvOS) && PERMISSIONSWIFTUI_EVENT
import EventKit
import CorePermissionsSwiftUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
#if !os(tvOS)
#if !os(tvOS) && PERMISSIONSWIFTUI_EVENT
import EventKit
import CorePermissionsSwiftUI

Expand Down

0 comments on commit bd4ef03

Please sign in to comment.