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

Adding EmbraceSemantics module #27

Merged
merged 6 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,34 @@
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EmbraceSemantics"
BuildableName = "EmbraceSemantics"
BlueprintName = "EmbraceSemantics"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EmbraceSemantics-Dynamic"
BuildableName = "EmbraceSemantics-Dynamic"
BlueprintName = "EmbraceSemantics-Dynamic"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand Down Expand Up @@ -591,6 +619,16 @@
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EmbraceSemanticsTests"
BuildableName = "EmbraceSemanticsTests"
BlueprintName = "EmbraceSemanticsTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
8 changes: 8 additions & 0 deletions EmbraceIO.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Pod::Spec.new do |spec|
io.dependency "EmbraceIO/EmbraceCore"
io.dependency "EmbraceIO/EmbraceCommonInternal"
io.dependency "EmbraceIO/EmbraceCrash"
io.dependency "EmbraceIO/EmbraceSemantics"
end

spec.subspec 'EmbraceCore' do |core|
Expand All @@ -33,12 +34,17 @@ Pod::Spec.new do |spec|
core.dependency "EmbraceIO/EmbraceStorageInternal"
core.dependency "EmbraceIO/EmbraceUploadInternal"
core.dependency "EmbraceIO/EmbraceObjCUtilsInternal"
core.dependency "EmbraceIO/EmbraceSemantics"
end

spec.subspec 'EmbraceCommonInternal' do |common|
common.vendored_frameworks = "xcframeworks/EmbraceCommonInternal.xcframework"
end

spec.subspec 'EmbraceSemantics' do |semantics|
semantics.vendored_frameworks = "xcframeworks/EmbraceSemantics.xcframework"
end

spec.subspec 'EmbraceCaptureService' do |capture|
capture.vendored_frameworks = "xcframeworks/EmbraceCaptureService.xcframework"
capture.dependency "EmbraceIO/EmbraceOTelInternal"
Expand All @@ -53,12 +59,14 @@ Pod::Spec.new do |spec|
spec.subspec 'EmbraceOTelInternal' do |otel|
otel.vendored_frameworks = "xcframeworks/EmbraceOTelInternal.xcframework"
otel.dependency "EmbraceIO/EmbraceCommonInternal"
otel.dependency "EmbraceIO/EmbraceSemantics"
otel.dependency "EmbraceIO/OpenTelemetrySdk"
end

spec.subspec 'EmbraceStorageInternal' do |storage|
storage.vendored_frameworks = "xcframeworks/EmbraceStorageInternal.xcframework"
storage.dependency "EmbraceIO/EmbraceCommonInternal"
storage.dependency "EmbraceIO/EmbraceSemantics"
storage.dependency "EmbraceIO/OpenTelemetryApi"
storage.dependency "EmbraceIO/GRDB"
end
Expand Down
20 changes: 18 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ let package = Package(
.library(name: "EmbraceCore", targets: ["EmbraceCore"]),
.library(name: "EmbraceCrash", targets: ["EmbraceCrash"]),
.library(name: "EmbraceCrashlyticsSupport", targets: ["EmbraceCrashlyticsSupport"]),
.library(name: "EmbraceSemantics", targets: ["EmbraceSemantics"]),

.library(name: "EmbraceIO-Dynamic", type: .dynamic, targets: ["EmbraceIO"]),
.library(name: "EmbraceCore-Dynamic", type: .dynamic, targets: ["EmbraceCore"]),
.library(name: "EmbraceCrash-Dynamic", type: .dynamic, targets: ["EmbraceCrash"]),
.library(name: "EmbraceCrashlyticsSupport-Dynamic", type: .dynamic, targets: ["EmbraceCrashlyticsSupport"])
.library(name: "EmbraceCrashlyticsSupport-Dynamic", type: .dynamic, targets: ["EmbraceCrashlyticsSupport"]),
.library(name: "EmbraceSemantics-Dynamic", type: .dynamic, targets: ["EmbraceSemantics"]),
],
dependencies: [
.package(
Expand Down Expand Up @@ -58,7 +61,8 @@ let package = Package(
"EmbraceCaptureService",
"EmbraceCore",
"EmbraceCommonInternal",
"EmbraceCrash"
"EmbraceCrash",
"EmbraceSemantics"
],
plugins: targetPlugins
),
Expand Down Expand Up @@ -86,6 +90,7 @@ let package = Package(
"EmbraceStorageInternal",
"EmbraceUploadInternal",
"EmbraceObjCUtilsInternal",
"EmbraceSemantics"
],
resources: [
.copy("PrivacyInfo.xcprivacy")
Expand Down Expand Up @@ -120,6 +125,15 @@ let package = Package(
plugins: targetPlugins
),

// semantics -----------------------------------------------------------------
.target(
name: "EmbraceSemantics",
dependencies: [
"EmbraceCommonInternal"
],
plugins: targetPlugins
),

// capture service -----------------------------------------------------------
.target(
name: "EmbraceCaptureService",
Expand Down Expand Up @@ -164,6 +178,7 @@ let package = Package(
name: "EmbraceOTelInternal",
dependencies: [
"EmbraceCommonInternal",
"EmbraceSemantics",
.product(name: "OpenTelemetrySdk", package: "opentelemetry-swift")
],
plugins: targetPlugins
Expand All @@ -182,6 +197,7 @@ let package = Package(
name: "EmbraceStorageInternal",
dependencies: [
"EmbraceCommonInternal",
"EmbraceSemantics",
.product(name: "GRDB", package: "GRDB.swift")
],
plugins: targetPlugins
Expand Down
17 changes: 16 additions & 1 deletion Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ let project = Project(
.target(name: "EmbraceCaptureService"),
.target(name: "EmbraceCore"),
.target(name: "EmbraceCommonInternal"),
.target(name: "EmbraceCrash")
.target(name: "EmbraceCrash"),
.target(name: "EmbraceSemantics")
],
settings: .settings(base: [
"SKIP_INSTALL": "NO",
Expand All @@ -36,6 +37,7 @@ let project = Project(
.target(name: "EmbraceStorageInternal"),
.target(name: "EmbraceUploadInternal"),
.target(name: "EmbraceObjCUtilsInternal"),
.target(name: "EmbraceSemantics")
],
settings: .settings(base: [
"HEADER_SEARCH_PATHS": ["$(SRCROOT)/Sources/EmbraceObjCUtilsInternal/include"],
Expand All @@ -56,6 +58,17 @@ let project = Project(
"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES"
])
),
.target(
name: "EmbraceSemantics",
destinations: .iOS,
product: .framework,
bundleId: "com.embraceio.EmbraceSemantics",
sources: ["Sources/EmbraceSemantics/**"],
settings: .settings(base: [
"SKIP_INSTALL": "NO",
"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES"
])
),
.target(
name: "EmbraceCaptureService",
destinations: .iOS,
Expand Down Expand Up @@ -93,6 +106,7 @@ let project = Project(
sources: ["Sources/EmbraceOTelInternal/**"],
dependencies: [
.target(name: "EmbraceCommonInternal"),
.target(name: "EmbraceSemantics"),
.external(name: "OpenTelemetrySdk")
],
settings: .settings(base: [
Expand All @@ -108,6 +122,7 @@ let project = Project(
sources: ["Sources/EmbraceStorageInternal/**"],
dependencies: [
.target(name: "EmbraceCommonInternal"),
.target(name: "EmbraceSemantics"),
.external(name: "OpenTelemetryApi"),
.external(name: "GRDB")
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ extension LogType {
// MARK: - System
extension LogType {
public static let `default` = LogType(system: "log")
public static let breadcrumb = LogType(system: "breadcrumb")
public static let crash = LogType(system: "ios.crash")
public static let `internal` = LogType(system: "internal")
}
6 changes: 3 additions & 3 deletions Sources/EmbraceCommonInternal/LogType/LogType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ public struct LogType: Equatable {
let primary: Primary
let secondary: String?

init(primary: Primary, secondary: String? = nil) {
public init(primary: Primary, secondary: String? = nil) {
self.primary = primary
self.secondary = secondary
}

init(system secondary: String) {
public init(system secondary: String) {
self.primary = .system
self.secondary = secondary
}
Expand Down Expand Up @@ -65,7 +65,7 @@ extension LogType: CustomStringConvertible {
public var description: String { rawValue }
}

extension LogType {
public extension LogType {
enum Primary: String {
case system = "sys"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,4 @@ extension SpanType {
public static let sqlUpdate = SpanType(performance: "sql.update")
public static let sqlDelete = SpanType(performance: "sql.delete")
public static let sqlVacuum = SpanType(performance: "sql.vacuum")

// Network types
public static let networkHTTP = SpanType(performance: "network_request")

}

// MARK: - UX
extension SpanType {
public static let view = SpanType(ux: "view")
public static let inputTap = SpanType(ux: "tap")
}

// MARK: - System
extension SpanType {
public static let lowPower = SpanType(system: "low_power")
}

// MARK: - Embrace Specific
extension SpanType {
public static let session = SpanType(ux: "session")
}
6 changes: 3 additions & 3 deletions Sources/EmbraceCommonInternal/SpanType/SpanType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public struct SpanType: Equatable, Hashable {

let secondary: String?

init(primary: Primary, secondary: String? = nil) {
public init(primary: Primary, secondary: String? = nil) {
self.primary = primary
self.secondary = secondary
}
}

extension SpanType {
public extension SpanType {

init(performance secondary: String) {
self.primary = .performance
Expand Down Expand Up @@ -83,7 +83,7 @@ extension SpanType: Codable {
}
}

extension SpanType {
public extension SpanType {

/// Top level category for the SpanType
enum Primary: String {
Expand Down
Loading
Loading