diff --git a/Datadog/Datadog.xcodeproj/project.pbxproj b/Datadog/Datadog.xcodeproj/project.pbxproj index 49cd6f025a..27c4fb68c1 100644 --- a/Datadog/Datadog.xcodeproj/project.pbxproj +++ b/Datadog/Datadog.xcodeproj/project.pbxproj @@ -86,8 +86,6 @@ 61133C6E2423990D00786299 /* DatadogExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61133C472423990D00786299 /* DatadogExtensions.swift */; }; 61133C702423993200786299 /* Datadog.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61133B82242393DE00786299 /* Datadog.framework */; }; 61133C712423993200786299 /* Datadog.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61133B82242393DE00786299 /* Datadog.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 616A62D024349BA700D1BE12 /* ObjcExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 616A626924335D4900D1BE12 /* ObjcExceptionHandler.m */; }; - 616A62D62434A3C500D1BE12 /* ObjcExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 616A626A24335D4900D1BE12 /* ObjcExceptionHandler.h */; }; 61C363802436164B00C4D4E6 /* ObjcExceptionHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C3637F2436164B00C4D4E6 /* ObjcExceptionHandlerTests.swift */; }; 61C3638324361BE200C4D4E6 /* DatadogPrivateMocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C3638224361BE200C4D4E6 /* DatadogPrivateMocks.swift */; }; 61C3638524361E9200C4D4E6 /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C3638424361E9200C4D4E6 /* Globals.swift */; }; @@ -96,6 +94,8 @@ 9E2FB23E24475EAE001C9B7B /* LoggingIOBenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E2FB23D24475EAE001C9B7B /* LoggingIOBenchmarkTests.swift */; }; 9E2FB2722447660E001C9B7B /* Datadog.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61133B82242393DE00786299 /* Datadog.framework */; }; 9E36D92224373EA700BFBDB7 /* SwiftExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E36D92124373EA700BFBDB7 /* SwiftExtensionsTests.swift */; }; + 9E68FB55244707FD0013A8AA /* ObjcExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E68FB53244707FD0013A8AA /* ObjcExceptionHandler.m */; }; + 9E68FB56244707FD0013A8AA /* ObjcExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E68FB54244707FD0013A8AA /* ObjcExceptionHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9EA6A539244897A900621535 /* LoggingIOBenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA6A538244897A900621535 /* LoggingIOBenchmarkTests.swift */; }; 9EA6A53E24489DC800621535 /* TestsDirectory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61133C462423990D00786299 /* TestsDirectory.swift */; }; 9EF49F0F24476D0C004F2CA0 /* HTTPServerMock in Frameworks */ = {isa = PBXBuildFile; productRef = 9EF49F0E24476D0C004F2CA0 /* HTTPServerMock */; }; @@ -234,11 +234,6 @@ 61133C452423990D00786299 /* SwiftExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftExtensions.swift; sourceTree = ""; }; 61133C462423990D00786299 /* TestsDirectory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestsDirectory.swift; sourceTree = ""; }; 61133C472423990D00786299 /* DatadogExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatadogExtensions.swift; sourceTree = ""; }; - 61545C9C243DD2610017B6D5 /* module.private.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.private.modulemap; sourceTree = ""; }; - 61545C9D243DD2610017B6D5 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; - 61545C9F243DD35C0017B6D5 /* SPMHeaders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPMHeaders.h; sourceTree = ""; }; - 616A626924335D4900D1BE12 /* ObjcExceptionHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjcExceptionHandler.m; sourceTree = ""; }; - 616A626A24335D4900D1BE12 /* ObjcExceptionHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjcExceptionHandler.h; sourceTree = ""; }; 61C3637F2436164B00C4D4E6 /* ObjcExceptionHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjcExceptionHandlerTests.swift; sourceTree = ""; }; 61C3638224361BE200C4D4E6 /* DatadogPrivateMocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatadogPrivateMocks.swift; sourceTree = ""; }; 61C3638424361E9200C4D4E6 /* Globals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = ""; }; @@ -253,6 +248,9 @@ 9E36D92124373EA700BFBDB7 /* SwiftExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftExtensionsTests.swift; sourceTree = ""; }; 9E4195742449D739000AB0DB /* app-target.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "app-target.xcconfig"; sourceTree = ""; }; 9E4195752449D739000AB0DB /* unit-tests-target.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "unit-tests-target.xcconfig"; sourceTree = ""; }; + 9E68FB53244707FD0013A8AA /* ObjcExceptionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjcExceptionHandler.m; sourceTree = ""; }; + 9E68FB54244707FD0013A8AA /* ObjcExceptionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcExceptionHandler.h; sourceTree = ""; }; + 9E9EB37624468CE90002C80B /* Datadog.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = Datadog.modulemap; sourceTree = ""; }; 9EA6A538244897A900621535 /* LoggingIOBenchmarkTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoggingIOBenchmarkTests.swift; sourceTree = ""; }; 9EF49F1624476FBD004F2CA0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9EF49F17244770AD004F2CA0 /* DatadogIntegrationTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DatadogIntegrationTests.xcconfig; sourceTree = ""; }; @@ -299,7 +297,7 @@ children = ( 61133B9C2423979B00786299 /* Datadog */, 61133C082423983800786299 /* DatadogObjc */, - 616A626824335D4900D1BE12 /* DatadogPrivate */, + 9E68FB52244707FD0013A8AA /* _Datadog_Private */, 61133C122423990D00786299 /* DatadogTests */, 9E2FB279244766CF001C9B7B /* DatadogIntegrationTests */, 61133C07242397F200786299 /* TargetSupport */, @@ -339,6 +337,7 @@ 61133B9C2423979B00786299 /* Datadog */ = { isa = PBXGroup; children = ( + 9E9EB37624468CE90002C80B /* Datadog.modulemap */, 61133BBB2423979B00786299 /* Datadog.swift */, 61133BB62423979B00786299 /* Logger.swift */, 61133BB52423979B00786299 /* DatadogConfiguration.swift */, @@ -677,26 +676,6 @@ name = Frameworks; sourceTree = ""; }; - 61545C9A243DD2610017B6D5 /* include */ = { - isa = PBXGroup; - children = ( - 61545C9F243DD35C0017B6D5 /* SPMHeaders.h */, - 61545C9C243DD2610017B6D5 /* module.private.modulemap */, - 61545C9D243DD2610017B6D5 /* module.modulemap */, - ); - path = include; - sourceTree = ""; - }; - 616A626824335D4900D1BE12 /* DatadogPrivate */ = { - isa = PBXGroup; - children = ( - 61545C9A243DD2610017B6D5 /* include */, - 616A626A24335D4900D1BE12 /* ObjcExceptionHandler.h */, - 616A626924335D4900D1BE12 /* ObjcExceptionHandler.m */, - ); - path = DatadogPrivate; - sourceTree = ""; - }; 61C3637E2436163400C4D4E6 /* DatadogPrivate */ = { isa = PBXGroup; children = ( @@ -725,6 +704,24 @@ path = "../../dependency-manager-tests/xcconfigs"; sourceTree = ""; }; + 9E47010324471027000073A4 /* include */ = { + isa = PBXGroup; + children = ( + 9E68FB54244707FD0013A8AA /* ObjcExceptionHandler.h */, + ); + path = include; + sourceTree = ""; + }; + 9E68FB52244707FD0013A8AA /* _Datadog_Private */ = { + isa = PBXGroup; + children = ( + 9E47010324471027000073A4 /* include */, + 9E68FB53244707FD0013A8AA /* ObjcExceptionHandler.m */, + ); + name = _Datadog_Private; + path = ../Sources/_Datadog_Private; + sourceTree = ""; + }; 9EA6A53A2448982800621535 /* Benchmark */ = { isa = PBXGroup; children = ( @@ -761,7 +758,7 @@ buildActionMask = 2147483647; files = ( 61133B93242393DE00786299 /* Datadog.h in Headers */, - 616A62D62434A3C500D1BE12 /* ObjcExceptionHandler.h in Headers */, + 9E68FB56244707FD0013A8AA /* ObjcExceptionHandler.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1003,8 +1000,8 @@ 61133BCC2423979B00786299 /* MobileDevice.swift in Sources */, 9E08587A242519FF001A3583 /* NetworkPathMonitor.swift in Sources */, 61133BCA2423979B00786299 /* EncodableValue.swift in Sources */, + 9E68FB55244707FD0013A8AA /* ObjcExceptionHandler.m in Sources */, 61C3638524361E9200C4D4E6 /* Globals.swift in Sources */, - 616A62D024349BA700D1BE12 /* ObjcExceptionHandler.m in Sources */, 61133BE62423979B00786299 /* LogSanitizer.swift in Sources */, 61133BDF2423979B00786299 /* SwiftExtensions.swift in Sources */, 61133BEA2423979B00786299 /* LogConsoleOutput.swift in Sources */, @@ -1271,11 +1268,11 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "$(SRCROOT)/../Sources/Datadog/Datadog.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.datadogqh.Datadog; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTS_MACCATALYST = NO; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/DatadogPrivate"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1296,11 +1293,11 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "$(SRCROOT)/../Sources/Datadog/Datadog.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.datadogqh.Datadog; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTS_MACCATALYST = NO; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/DatadogPrivate"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1516,11 +1513,11 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MODULEMAP_FILE = "$(SRCROOT)/../Sources/Datadog/Datadog.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = com.datadogqh.Datadog; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTS_MACCATALYST = NO; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/DatadogPrivate"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Datadog/DatadogPrivate/include/SPMHeaders.h b/Datadog/DatadogPrivate/include/SPMHeaders.h deleted file mode 100644 index bc3e3ebc33..0000000000 --- a/Datadog/DatadogPrivate/include/SPMHeaders.h +++ /dev/null @@ -1,9 +0,0 @@ -/* -* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. -* This product includes software developed at Datadog (https://www.datadoghq.com/). -* Copyright 2019-2020 Datadog, Inc. -*/ - - -// List of headers for SPM to include for `_Datadog_Private` module. -#import "../ObjcExceptionHandler.h" diff --git a/Datadog/DatadogPrivate/include/module.modulemap b/Datadog/DatadogPrivate/include/module.modulemap deleted file mode 100644 index 8b13789179..0000000000 --- a/Datadog/DatadogPrivate/include/module.modulemap +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Datadog/DatadogPrivate/include/module.private.modulemap b/Datadog/DatadogPrivate/include/module.private.modulemap deleted file mode 100644 index 97c2662fef..0000000000 --- a/Datadog/DatadogPrivate/include/module.private.modulemap +++ /dev/null @@ -1,14 +0,0 @@ -/* - Module Map Language reference: https://clang.llvm.org/docs/Modules.html#module-map-language - */ -module _Datadog_Private { - /* - Each header exported from here must be also exposed to each dependency manager separately: - - For Carthage, add it to "Datadog > Build Phases > Headers > Project". - - For SPM, import it in `SPMHeaders.h`. - - Cocoapods `.podspec` is already configured to read this `module.modulemap`. - */ - - header "../ObjcExceptionHandler.h" - export * -} diff --git a/DatadogSDK.podspec b/DatadogSDK.podspec index e101458c9b..29e7454d63 100644 --- a/DatadogSDK.podspec +++ b/DatadogSDK.podspec @@ -18,9 +18,10 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/DataDog/dd-sdk-ios.git", :tag => s.version.to_s } - s.source_files = "Sources/Datadog/**/*.swift", "Datadog/DatadogPrivate/*.m" - s.preserve_paths = "Datadog/DatadogPrivate/*.h", "Datadog/DatadogPrivate/include/*.modulemap" - s.pod_target_xcconfig = { - "SWIFT_INCLUDE_PATHS" => "$(PODS_ROOT)/DatadogSDK/Datadog/DatadogPrivate/** $(PODS_TARGET_SRCROOT)/DatadogSDK/Datadog/DatadogPrivate/**" - } + s.source_files = ["Sources/Datadog/**/*.swift", + "Sources/_Datadog_Private/**/*.{h,m}", + "Datadog/TargetSupport/Datadog/Datadog.h"] + s.public_header_files = "Datadog/TargetSupport/Datadog/Datadog.h" + s.private_header_files = "Sources/_Datadog_Private/include/*.h" + s.module_map = "Sources/Datadog/Datadog.modulemap" end diff --git a/Package.swift b/Package.swift index 38502fb642..71fb9fd892 100644 --- a/Package.swift +++ b/Package.swift @@ -25,8 +25,7 @@ let package = Package( name: "DatadogObjc", dependencies: ["Datadog"]), .target( - name: "_Datadog_Private", - path: "Datadog/DatadogPrivate" + name: "_Datadog_Private" ), .testTarget( name: "DatadogTests", diff --git a/Sources/Datadog/Datadog.modulemap b/Sources/Datadog/Datadog.modulemap new file mode 100644 index 0000000000..39eff10557 --- /dev/null +++ b/Sources/Datadog/Datadog.modulemap @@ -0,0 +1,11 @@ +framework module Datadog { + umbrella header "Datadog.h" + + export * + module * { export * } +} + +framework module _Datadog_Private { + export * + header "ObjcExceptionHandler.h" +} diff --git a/Datadog/DatadogPrivate/ObjcExceptionHandler.m b/Sources/_Datadog_Private/ObjcExceptionHandler.m similarity index 100% rename from Datadog/DatadogPrivate/ObjcExceptionHandler.m rename to Sources/_Datadog_Private/ObjcExceptionHandler.m diff --git a/Datadog/DatadogPrivate/ObjcExceptionHandler.h b/Sources/_Datadog_Private/include/ObjcExceptionHandler.h similarity index 100% rename from Datadog/DatadogPrivate/ObjcExceptionHandler.h rename to Sources/_Datadog_Private/include/ObjcExceptionHandler.h