From 4b6caca1f23e26ba2c0fb5c968793ff440c7ff41 Mon Sep 17 00:00:00 2001 From: Yehor Popovych Date: Mon, 12 Aug 2024 21:51:37 +0100 Subject: [PATCH] made CDatadogTesting private. Better project settings (#115) fixed import of C part. fixed project settings --- DatadogSDKTesting.xcodeproj/project.pbxproj | 28 +++++++------------ Makefile | 4 +-- .../Coverage/DDCoverageHelper.swift | 4 +-- .../FrameworkLoadHandler.swift | 2 +- .../ImageSymbols/BinaryImages.swift | 2 +- .../ImageSymbols/DDSymbolicator.swift | 2 +- 6 files changed, 17 insertions(+), 25 deletions(-) diff --git a/DatadogSDKTesting.xcodeproj/project.pbxproj b/DatadogSDKTesting.xcodeproj/project.pbxproj index 67454a8d..4670f851 100644 --- a/DatadogSDKTesting.xcodeproj/project.pbxproj +++ b/DatadogSDKTesting.xcodeproj/project.pbxproj @@ -1767,7 +1767,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.CDatadogSDKTesting; @@ -1807,7 +1807,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.CDatadogSDKTesting; @@ -1825,6 +1825,7 @@ A7FC25752BA1E83500067E26 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1866,6 +1867,7 @@ A7FC25762BA1E83500067E26 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1907,7 +1909,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_STYLE = Automatic; GCC_DYNAMIC_NO_PIC = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1927,7 +1928,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_STYLE = Automatic; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GENERATE_INFOPLIST_FILE = YES; @@ -1945,7 +1945,6 @@ A7FC25902BA1E87400067E26 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_WARN_COMMA = NO; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; @@ -1983,7 +1982,6 @@ A7FC25912BA1E87400067E26 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_WARN_COMMA = NO; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; @@ -2021,7 +2019,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GCC_DYNAMIC_NO_PIC = NO; @@ -2046,7 +2043,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -2070,7 +2066,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_ENTITLEMENTS = IntegrationTests/App/IntegrationTests.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; @@ -2116,7 +2111,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_ENTITLEMENTS = IntegrationTests/App/IntegrationTests.entitlements; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; @@ -2160,7 +2154,6 @@ A7FC26C92BA20D1200067E26 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_ENTITLEMENTS = IntegrationTests/App/IntegrationTests.entitlements; CODE_SIGN_STYLE = Automatic; @@ -2169,7 +2162,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_LSApplicationCategoryType = ""; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.IntegrationTestsUITests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -2186,7 +2179,6 @@ A7FC26CA2BA20D1200067E26 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_ENTITLEMENTS = IntegrationTests/App/IntegrationTests.entitlements; CODE_SIGN_STYLE = Automatic; @@ -2194,7 +2186,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_LSApplicationCategoryType = ""; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.IntegrationTestsUITests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -2212,7 +2204,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -2268,7 +2260,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -2287,7 +2279,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -2340,7 +2332,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.0; LLVM_LTO = YES_THIN; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 2.5.0-alpha1; + MARKETING_VERSION = "2.5.0-alpha1"; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/Makefile b/Makefile index 9bfeb012..831a3bc6 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ endef define xcarchive $(if $5,\ set -o pipefail; xcodebuild archive -scheme $1 -sdk $2 -destination $3 -archivePath \ - build/$1/$4.xcarchive SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | tee $1-$4-$5.log | xcbeautify,\ - xcodebuild archive -scheme $1 -sdk $2 -destination $3 -archivePath build/$1/$4.xcarchive SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES) + build/$1/$4.xcarchive SKIP_INSTALL=NO | tee $1-$4-$5.log | xcbeautify,\ + xcodebuild archive -scheme $1 -sdk $2 -destination $3 -archivePath build/$1/$4.xcarchive SKIP_INSTALL=NO) endef build/%/iphoneos.xcarchive: diff --git a/Sources/DatadogSDKTesting/Coverage/DDCoverageHelper.swift b/Sources/DatadogSDKTesting/Coverage/DDCoverageHelper.swift index 6db16ff0..99622095 100644 --- a/Sources/DatadogSDKTesting/Coverage/DDCoverageHelper.swift +++ b/Sources/DatadogSDKTesting/Coverage/DDCoverageHelper.swift @@ -4,9 +4,9 @@ * Copyright 2020-Present Datadog, Inc. */ -@_implementationOnly import EventsExporter import Foundation -import CDatadogSDKTesting +@_implementationOnly import EventsExporter +@_implementationOnly import CDatadogSDKTesting typealias cFunc = @convention(c) () -> Void diff --git a/Sources/DatadogSDKTesting/FrameworkLoadHandler.swift b/Sources/DatadogSDKTesting/FrameworkLoadHandler.swift index 8c5c4d65..556b21b2 100644 --- a/Sources/DatadogSDKTesting/FrameworkLoadHandler.swift +++ b/Sources/DatadogSDKTesting/FrameworkLoadHandler.swift @@ -5,7 +5,7 @@ */ import Foundation -import CDatadogSDKTesting +@_implementationOnly import CDatadogSDKTesting enum FrameworkLoadHandler { static var testObserver: DDTestObserver? diff --git a/Sources/DatadogSDKTesting/ImageSymbols/BinaryImages.swift b/Sources/DatadogSDKTesting/ImageSymbols/BinaryImages.swift index 4ec65fb2..8592bedb 100644 --- a/Sources/DatadogSDKTesting/ImageSymbols/BinaryImages.swift +++ b/Sources/DatadogSDKTesting/ImageSymbols/BinaryImages.swift @@ -5,7 +5,7 @@ */ import Foundation -import CDatadogSDKTesting +@_implementationOnly import CDatadogSDKTesting /// It stores information about loaded mach images struct MachOImage { diff --git a/Sources/DatadogSDKTesting/ImageSymbols/DDSymbolicator.swift b/Sources/DatadogSDKTesting/ImageSymbols/DDSymbolicator.swift index bec5851c..da693d98 100644 --- a/Sources/DatadogSDKTesting/ImageSymbols/DDSymbolicator.swift +++ b/Sources/DatadogSDKTesting/ImageSymbols/DDSymbolicator.swift @@ -6,7 +6,7 @@ import Foundation import MachO -import CDatadogSDKTesting +@_implementationOnly import CDatadogSDKTesting @_implementationOnly import EventsExporter enum DDSymbolicator {