Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.5.2 #465

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.5.2 / 04-12-2021

### Changes

* [BUGFIX] Static pod support for cocoapods. See [#451][]
* [BUGFIX] Swiftlint won't run for carthage builds. See [#450][]

# 1.5.1 / 03-11-2021

### Changes
Expand Down Expand Up @@ -158,6 +165,8 @@
[#381]: https://github.com/DataDog/dd-sdk-ios/issues/381
[#390]: https://github.com/DataDog/dd-sdk-ios/issues/390
[#439]: https://github.com/DataDog/dd-sdk-ios/pull/439
[#450]: https://github.com/DataDog/dd-sdk-ios/pull/450
[#451]: https://github.com/DataDog/dd-sdk-ios/pull/451
[@00FA9A]: https://github.com/00FA9A
[@Britton-Earnin]: https://github.com/Britton-Earnin
[@Hengyu]: https://github.com/Hengyu
Expand Down
51 changes: 40 additions & 11 deletions Datadog/Datadog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
616CCE16250A467E009FED46 /* RUMAutoInstrumentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616CCE15250A467E009FED46 /* RUMAutoInstrumentation.swift */; };
61786F7724FCDE05009E6BAB /* RUMDebuggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61786F7624FCDE04009E6BAB /* RUMDebuggingTests.swift */; };
6179FFD3254ADB1700556A0B /* ObjcAppLaunchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 6179FFD2254ADB1100556A0B /* ObjcAppLaunchHandler.m */; };
6179FFDE254ADBEF00556A0B /* ObjcAppLaunchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6179FFD1254ADB1100556A0B /* ObjcAppLaunchHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
6179FFDE254ADBEF00556A0B /* ObjcAppLaunchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6179FFD1254ADB1100556A0B /* ObjcAppLaunchHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
617B953D24BF4D8F00E6F443 /* RUMMonitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617B953C24BF4D8F00E6F443 /* RUMMonitorTests.swift */; };
617B954024BF4DB300E6F443 /* RUMApplicationScopeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617B953F24BF4DB300E6F443 /* RUMApplicationScopeTests.swift */; };
617B954224BF4E7600E6F443 /* RUMMonitorConfigurationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617B954124BF4E7600E6F443 /* RUMMonitorConfigurationTests.swift */; };
Expand Down Expand Up @@ -385,7 +385,7 @@
9E58E8E124615C75008E5063 /* JSONEncoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E58E8E024615C75008E5063 /* JSONEncoder.swift */; };
9E58E8E324615EDA008E5063 /* JSONEncoderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E58E8E224615EDA008E5063 /* JSONEncoderTests.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, ); }; };
9E68FB56244707FD0013A8AA /* ObjcExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E68FB54244707FD0013A8AA /* ObjcExceptionHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
9EEA4871258B76A100EBDA9D /* Global+objc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEA4870258B76A100EBDA9D /* Global+objc.swift */; };
9EF963E82537556300235F98 /* DDURLSessionDelegateAsSuperclassTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF963E72537556300235F98 /* DDURLSessionDelegateAsSuperclassTests.swift */; };
9EFD112C24B32D29003A1A2B /* FirstPartyURLsFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EFD112B24B32D29003A1A2B /* FirstPartyURLsFilter.swift */; };
Expand Down Expand Up @@ -2743,6 +2743,44 @@

/* Begin PBXShellScriptBuildPhase section */
61133C772423A4C300786299 /* ⚙️ Run linter */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "⚙️ Run linter";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CARTHAGE\" == \"YES\" ]; then\n echo \"Skipping linting for carthage build...\"\nelif which swiftlint >/dev/null; then\n cd ${SOURCE_ROOT}/..\n ./tools/lint/run-linter.sh\nfi\n";
showEnvVarsInLog = 0;
};
6170DC2325C18762003AED5C /* ⚙️ Run linter */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "⚙️ Run linter";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CARTHAGE\" == \"YES\" ]; then\n echo \"Skipping linting for carthage build...\"\nelif which swiftlint >/dev/null; then\n cd ${SOURCE_ROOT}/..\n ./tools/lint/run-linter.sh\nfi\n";
showEnvVarsInLog = 0;
};
6170DC2425C18784003AED5C /* ⚙️ Run linter */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -3241,7 +3279,6 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand All @@ -3259,7 +3296,6 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -3306,7 +3342,6 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand All @@ -3324,7 +3359,6 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -3377,7 +3411,6 @@
"@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;
Expand Down Expand Up @@ -3407,7 +3440,6 @@
"@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;
Expand Down Expand Up @@ -3707,7 +3739,6 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand All @@ -3725,7 +3756,6 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -3779,7 +3809,6 @@
"@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;
Expand Down
3 changes: 2 additions & 1 deletion Datadog/TargetSupport/Datadog/Datadog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ FOUNDATION_EXPORT const unsigned char DatadogVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Datadog/PublicHeader.h>


#import "ObjcAppLaunchHandler.h"
#import "ObjcExceptionHandler.h"
7 changes: 3 additions & 4 deletions DatadogSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDK"
s.module_name = "Datadog"
s.version = "1.5.1"
s.version = "1.5.2"
s.summary = "Official Datadog Swift SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand All @@ -22,8 +22,7 @@ Pod::Spec.new do |s|
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"
s.public_header_files = ["Datadog/TargetSupport/Datadog/Datadog.h",
"Sources/_Datadog_Private/include/*.h"]
s.dependency 'Kronos', '~> 4.1'
end
2 changes: 1 addition & 1 deletion DatadogSDKAlamofireExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKAlamofireExtension"
s.module_name = "DatadogAlamofireExtension"
s.version = "1.5.1"
s.version = "1.5.2"
s.summary = "An Official Extensions of Datadog Swift SDK for Alamofire."

s.homepage = "https://www.datadoghq.com"
Expand Down
4 changes: 2 additions & 2 deletions DatadogSDKObjc.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKObjc"
s.module_name = "DatadogObjc"
s.version = "1.5.1"
s.version = "1.5.2"
s.summary = "Official Datadog Objective-C SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand All @@ -20,5 +20,5 @@ 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/DatadogObjc/**/*.swift"
s.dependency 'DatadogSDK', '1.5.1'
s.dependency 'DatadogSDK', '1.5.2'
end
34 changes: 2 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
all: tools dependencies xcodeproj-httpservermock templates
.PHONY : tools

tools:
@echo "⚙️ Installing tools..."
@brew list swiftlint &>/dev/null || brew install swiftlint
@echo "OK 👌"

# The release version of `dd-sdk-swift-testing` to use for tests instrumentation.
DD_SDK_SWIFT_TESTING_VERSION = 0.6.0

define DD_SDK_TESTING_XCCONFIG_CI
FRAMEWORK_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/DatadogSDKTesting.xcframework/ios-arm64_x86_64-simulator/\n
LD_RUNPATH_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/DatadogSDKTesting.xcframework/ios-arm64_x86_64-simulator/\n
OTHER_LDFLAGS=$$(inherited) -framework DatadogSDKTesting\n
DD_TEST_RUNNER=1\n
DD_SDK_SWIFT_TESTING_SERVICE=dd-sdk-ios\n
DD_SDK_SWIFT_TESTING_CLIENT_TOKEN=${DD_SDK_SWIFT_TESTING_CLIENT_TOKEN}\n
DD_SDK_SWIFT_TESTING_ENV=ci\n
endef
export DD_SDK_TESTING_XCCONFIG_CI
all: dependencies xcodeproj-httpservermock templates

dependencies:
@echo "⚙️ Installing dependencies..."
# NOTE: RUMM-1145 Bitrise Stacks don't have carthage v0.37
# despite https://github.com/bitrise-io/bitrise.io/blob/master/system_reports/osx-xcode-12.4.x.log
@brew upgrade carthage
@carthage bootstrap --platform iOS --use-xcframeworks
ifeq (${ci}, true)
@echo $$DD_SDK_TESTING_XCCONFIG_CI > xcconfigs/DatadogSDKTesting.local.xcconfig;
@brew list gh &>/dev/null || brew install gh
@rm -rf instrumented-tests/DatadogSDKTesting.xcframework
@rm -rf instrumented-tests/DatadogSDKTesting.zip
@rm -rf instrumented-tests/LICENSE
@gh release download ${DD_SDK_SWIFT_TESTING_VERSION} -D instrumented-tests -R https://github.com/DataDog/dd-sdk-swift-testing -p "DatadogSDKTesting.zip"
@unzip instrumented-tests/DatadogSDKTesting.zip -d instrumented-tests
@[ -e "instrumented-tests/DatadogSDKTesting.xcframework" ] && echo "DatadogSDKTesting.xcframework - OK" || { echo "DatadogSDKTesting.xcframework - missing"; exit 1; }
endif
@echo "" > xcconfigs/DatadogSDKTesting.local.xcconfig;

xcodeproj-httpservermock:
@echo "⚙️ Generating 'HTTPServerMock.xcodeproj'..."
Expand Down
7 changes: 6 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ let package = Package(
targets: [
.target(
name: "Datadog",
dependencies: ["_Datadog_Private", "Kronos"]),
dependencies: [
"_Datadog_Private",
.product(name: "Kronos", package: "Kronos"),
],
swiftSettings: [.define("SPM_BUILD")]
),
.target(
name: "DatadogObjc",
dependencies: ["Datadog"]),
Expand Down
6 changes: 5 additions & 1 deletion Sources/Datadog/Core/FeaturesConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal struct FeaturesConfiguration {
let serviceName: String
let environment: String
let performance: PerformancePreset
let source: String
}

struct Logging {
Expand Down Expand Up @@ -87,6 +88,8 @@ extension FeaturesConfiguration {
var tracesEndpoint = configuration.tracesEndpoint
var rumEndpoint = configuration.rumEndpoint

let source = (configuration.additionalConfiguration["_dd.source"] as? String) ?? Datadog.Constants.ddsource

if let datadogEndpoint = configuration.datadogEndpoint {
// If `.set(endpoint:)` API was used, it should override the values
// set by deprecated `.set(<feature>Endpoint:)` APIs.
Expand Down Expand Up @@ -120,7 +123,8 @@ extension FeaturesConfiguration {
batchSize: configuration.batchSize,
uploadFrequency: configuration.uploadFrequency,
bundleType: appContext.bundleType
)
),
source: source
)

if configuration.loggingEnabled {
Expand Down
3 changes: 3 additions & 0 deletions Sources/Datadog/Core/Persistence/Files/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

import Foundation

#if SPM_BUILD
import _Datadog_Private
#endif

/// Provides convenient interface for reading metadata and appending data to the file.
internal protocol WritableFile {
Expand Down
7 changes: 5 additions & 2 deletions Sources/Datadog/Core/System/LaunchTimeProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

import UIKit

#if SPM_BUILD
import _Datadog_Private
#endif

/// Provides the application launch time.
internal protocol LaunchTimeProviderType {
Expand All @@ -16,9 +19,9 @@ internal protocol LaunchTimeProviderType {

internal class LaunchTimeProvider: LaunchTimeProviderType {
var launchTime: TimeInterval? {
// Even if AppLaunchTime() is using a lock behind the scenes, TSAN will report a data race if there are no synchronizations at this level.
// Even if __dd_private_AppLaunchTime() is using a lock behind the scenes, TSAN will report a data race if there are no synchronizations at this level.
objc_sync_enter(self)
let time = AppLaunchTime()
let time = __dd_private_AppLaunchTime()
objc_sync_exit(self)
return time > 0 ? time : nil
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Datadog/Core/Upload/DataUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ internal class UploadURLProvider {
let value: () -> URLQueryItem

/// Creates `ddsource=ios` query item.
static func ddsource() -> QueryItemProvider {
let queryItem = URLQueryItem(name: "ddsource", value: Datadog.Constants.ddsource)
static func ddsource(source: String) -> QueryItemProvider {
let queryItem = URLQueryItem(name: "ddsource", value: source)
return QueryItemProvider { queryItem }
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/Datadog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class Datadog {
/// If set, a debugging outline will be displayed on top of the application, describing the name of the active RUM View.
/// May be used to debug issues with RUM instrumentation in your app.
/// Default is `false`.
public static var debugRUM: Bool = false {
public static var debugRUM = false {
didSet {
(Global.rum as? RUMMonitor)?.enableRUMDebugging(debugRUM)
}
Expand Down
12 changes: 11 additions & 1 deletion Sources/Datadog/DatadogConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ extension Datadog {
private(set) var rumErrorEventMapper: RUMErrorEventMapper?
private(set) var batchSize: BatchSize
private(set) var uploadFrequency: UploadFrequency
private(set) var additionalConfiguration: [String: Any]

/// Creates the builder for configuring the SDK to work with RUM, Logging and Tracing features.
/// - Parameter rumApplicationID: RUM Application ID obtained on Datadog website.
Expand Down Expand Up @@ -242,7 +243,8 @@ extension Datadog {
rumActionEventMapper: nil,
rumErrorEventMapper: nil,
batchSize: .medium,
uploadFrequency: .average
uploadFrequency: .average,
additionalConfiguration: [:]
)
}

Expand Down Expand Up @@ -515,6 +517,14 @@ extension Datadog {
return self
}

/// Sets additional configuration attributes.
/// This can be used to tweak internal features of the SDK.
/// - Parameter additionalConfiguration: `[:]` by default.
public func set(additionalConfiguration: [String: Any]) -> Builder {
configuration.additionalConfiguration = additionalConfiguration
return self
}

/// Builds `Datadog.Configuration` object.
public func build() -> Configuration {
return configuration
Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/Logging/LoggingFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal final class LoggingFeature {
uploadURLProvider: UploadURLProvider(
urlWithClientToken: configuration.uploadURLWithClientToken,
queryItemProviders: [
.ddsource()
.ddsource(source: configuration.common.source)
]
),
commonDependencies: commonDependencies
Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/RUM/RUMFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ internal final class RUMFeature {
uploadURLProvider: UploadURLProvider(
urlWithClientToken: configuration.uploadURLWithClientToken,
queryItemProviders: [
.ddsource(),
.ddsource(source: configuration.common.source),
.ddtags(
tags: [
"service:\(configuration.common.serviceName)",
Expand Down
Loading