Prechádzať zdrojové kódy

Only import if needed

Florian Friedrich 8 mesiacov pred
rodič
commit
307f95f77d

+ 2 - 0
Sources/CocoaLumberjackSwift/DDLog+Combine.swift

@@ -16,7 +16,9 @@
 #if arch(arm64) || arch(x86_64)
 #if canImport(Combine)
 public import Combine
+#if SWIFT_PACKAGE
 public import CocoaLumberjack
+#endif
 
 @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
 extension DDLog {

+ 2 - 0
Sources/CocoaLumberjackSwift/DDLogFlag+DDLogLevel.swift

@@ -13,7 +13,9 @@
 //   to endorse or promote products derived from this software without specific
 //   prior written permission of Deusty, LLC.
 
+#if SWIFT_PACKAGE
 public import CocoaLumberjack
+#endif
 
 extension DDLogFlag {
     public static func from(_ logLevel: DDLogLevel) -> DDLogFlag {

+ 3 - 1
Sources/CocoaLumberjackSwift/DDLogMessageFormat.swift

@@ -13,7 +13,9 @@
 //   to endorse or promote products derived from this software without specific
 //   prior written permission of Deusty, LLC.
 
-import CocoaLumberjack
+#if SWIFT_PACKAGE
+public import CocoaLumberjack
+#endif
 
 @frozen
 public struct DDLogMessageFormat: ExpressibleByStringInterpolation {