|
| 1 | +// swift-tools-version:5.6 |
| 2 | +// The swift-tools-version declares the minimum version of Swift required to build this package. |
| 3 | + |
| 4 | +import PackageDescription |
| 5 | + |
| 6 | +let package = Package( |
| 7 | + name: "opentelemetry-swift", |
| 8 | + platforms: [ |
| 9 | + .macOS(.v10_13), |
| 10 | + .iOS(.v11), |
| 11 | + .tvOS(.v11), |
| 12 | + .watchOS(.v3) |
| 13 | + ], |
| 14 | + products: [ |
| 15 | + .library(name: "OpenTelemetryApi", type: .static, targets: ["OpenTelemetryApi"]), |
| 16 | + .library(name: "OpenTelemetrySdk", type: .static, targets: ["OpenTelemetrySdk"]), |
| 17 | + .library(name: "ResourceExtension", type: .static, targets: ["ResourceExtension"]), |
| 18 | + .library(name: "URLSessionInstrumentation", type: .static, targets: ["URLSessionInstrumentation"]), |
| 19 | + .library(name: "SignPostIntegration", type: .static, targets: ["SignPostIntegration"]), |
| 20 | + .library(name: "OpenTracingShim-experimental", type: .static, targets: ["OpenTracingShim"]), |
| 21 | + .library(name: "SwiftMetricsShim", type: .static, targets: ["SwiftMetricsShim"]), |
| 22 | + .library(name: "JaegerExporter", type: .static, targets: ["JaegerExporter"]), |
| 23 | + .library(name: "ZipkinExporter", type: .static, targets: ["ZipkinExporter"]), |
| 24 | + .library(name: "StdoutExporter", type: .static, targets: ["StdoutExporter"]), |
| 25 | + .library(name: "PrometheusExporter", type: .static, targets: ["PrometheusExporter"]), |
| 26 | + .library(name: "OpenTelemetryProtocolExporter", type: .static, targets: ["OpenTelemetryProtocolExporter"]), |
| 27 | + .library(name: "PersistenceExporter", type: .static, targets: ["PersistenceExporter"]), |
| 28 | + .library(name: "InMemoryExporter", type: .static, targets: ["InMemoryExporter"]), |
| 29 | + .library(name: "DatadogExporter", type: .static, targets: ["DatadogExporter"]), |
| 30 | + .library(name: "NetworkStatus", type: .static, targets: ["NetworkStatus"]), |
| 31 | + .executable(name: "simpleExporter", targets: ["SimpleExporter"]), |
| 32 | + .executable(name: "OTLPExporter", targets: ["OTLPExporter"]), |
| 33 | + .executable(name: "loggingTracer", targets: ["LoggingTracer"]), |
| 34 | + ], |
| 35 | + dependencies: [ |
| 36 | + .package(url: "https://github.com/undefinedlabs/opentracing-objc", from: "0.5.2"), |
| 37 | + .package(url: "https://github.com/undefinedlabs/Thrift-Swift", from: "1.1.1"), |
| 38 | + .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"), |
| 39 | + .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0"), |
| 40 | + .package(url: "https://github.com/apple/swift-metrics.git", from: "2.1.1"), |
| 41 | + .package(url: "https://github.com/ashleymills/Reachability.swift", from: "5.1.0") |
| 42 | + ], |
| 43 | + targets: [ |
| 44 | + .target(name: "OpenTelemetryApi", |
| 45 | + dependencies: []), |
| 46 | + .target(name: "OpenTelemetrySdk", |
| 47 | + dependencies: ["OpenTelemetryApi"]), |
| 48 | + .target(name: "ResourceExtension", |
| 49 | + dependencies: ["OpenTelemetrySdk"], |
| 50 | + path: "Sources/Instrumentation/SDKResourceExtension", |
| 51 | + exclude: ["README.md"]), |
| 52 | + .target(name: "URLSessionInstrumentation", |
| 53 | + dependencies: ["OpenTelemetrySdk", "NetworkStatus"], |
| 54 | + path: "Sources/Instrumentation/URLSession", |
| 55 | + exclude: ["README.md"]), |
| 56 | + .target(name: "NetworkStatus", |
| 57 | + dependencies: [ |
| 58 | + "OpenTelemetryApi", |
| 59 | + .product(name: "Reachability", package: "Reachability.swift", condition: .when(platforms: [.iOS, .macOS, .macCatalyst, .linux])) |
| 60 | + ], |
| 61 | + path: "Sources/Instrumentation/NetworkStatus", |
| 62 | + linkerSettings: [.linkedFramework("CoreTelephony", .when(platforms: [.iOS], configuration: nil))]), |
| 63 | + .target(name: "SignPostIntegration", |
| 64 | + dependencies: ["OpenTelemetrySdk"], |
| 65 | + path: "Sources/Instrumentation/SignPostIntegration", |
| 66 | + exclude: ["README.md"]), |
| 67 | + .target(name: "OpenTracingShim", |
| 68 | + dependencies: [ |
| 69 | + "OpenTelemetrySdk", |
| 70 | + .product(name: "Opentracing", package: "opentracing-objc") |
| 71 | + ], |
| 72 | + path: "Sources/Importers/OpenTracingShim", |
| 73 | + exclude: ["README.md"]), |
| 74 | + .target(name: "SwiftMetricsShim", |
| 75 | + dependencies: ["OpenTelemetrySdk", |
| 76 | + .product(name: "CoreMetrics", package: "swift-metrics")], |
| 77 | + path: "Sources/Importers/SwiftMetricsShim", |
| 78 | + exclude: ["README.md"]), |
| 79 | + .target(name: "JaegerExporter", |
| 80 | + dependencies: [ |
| 81 | + "OpenTelemetrySdk", |
| 82 | + .product(name: "Thrift", package: "Thrift-Swift", condition: .when(platforms: [.iOS, .macOS, .macCatalyst, .linux])) |
| 83 | + ], |
| 84 | + path: "Sources/Exporters/Jaeger"), |
| 85 | + .target(name: "ZipkinExporter", |
| 86 | + dependencies: ["OpenTelemetrySdk"], |
| 87 | + path: "Sources/Exporters/Zipkin"), |
| 88 | + .target(name: "PrometheusExporter", |
| 89 | + dependencies: ["OpenTelemetrySdk", |
| 90 | + .product(name: "NIO", package: "swift-nio"), |
| 91 | + .product(name: "NIOHTTP1", package: "swift-nio")], |
| 92 | + path: "Sources/Exporters/Prometheus"), |
| 93 | + .target(name: "OpenTelemetryProtocolExporter", |
| 94 | + dependencies: ["OpenTelemetrySdk", |
| 95 | + .product(name: "GRPC", package: "grpc-swift")], |
| 96 | + path: "Sources/Exporters/OpenTelemetryProtocol"), |
| 97 | + .target(name: "StdoutExporter", |
| 98 | + dependencies: ["OpenTelemetrySdk"], |
| 99 | + path: "Sources/Exporters/Stdout"), |
| 100 | + .target(name: "InMemoryExporter", |
| 101 | + dependencies: ["OpenTelemetrySdk"], |
| 102 | + path: "Sources/Exporters/InMemory"), |
| 103 | + .target(name: "DatadogExporter", |
| 104 | + dependencies: ["OpenTelemetrySdk"], |
| 105 | + path: "Sources/Exporters/DatadogExporter", |
| 106 | + exclude: ["NOTICE", "README.md"]), |
| 107 | + .target(name: "PersistenceExporter", |
| 108 | + dependencies: ["OpenTelemetrySdk"], |
| 109 | + path: "Sources/Exporters/Persistence"), |
| 110 | + .testTarget(name: "NetworkStatusTests", |
| 111 | + dependencies: [ |
| 112 | + "NetworkStatus", |
| 113 | + .product(name: "Reachability", package: "Reachability.swift", condition: .when(platforms: [.iOS, .macOS, .macCatalyst, .linux])) |
| 114 | + ], |
| 115 | + path: "Tests/InstrumentationTests/NetworkStatusTests"), |
| 116 | + .testTarget(name: "OpenTelemetryApiTests", |
| 117 | + dependencies: ["OpenTelemetryApi"], |
| 118 | + path: "Tests/OpenTelemetryApiTests"), |
| 119 | + .testTarget(name: "OpenTelemetrySdkTests", |
| 120 | + dependencies: ["OpenTelemetryApi", |
| 121 | + "OpenTelemetrySdk"], |
| 122 | + path: "Tests/OpenTelemetrySdkTests"), |
| 123 | + .testTarget(name: "ResourceExtensionTests", |
| 124 | + dependencies: ["ResourceExtension", "OpenTelemetrySdk"], |
| 125 | + path: "Tests/InstrumentationTests/SDKResourceExtensionTests"), |
| 126 | + .testTarget(name: "URLSessionInstrumentationTests", |
| 127 | + dependencies: ["URLSessionInstrumentation", |
| 128 | + .product(name: "NIO", package: "swift-nio"), |
| 129 | + .product(name: "NIOHTTP1", package: "swift-nio")], |
| 130 | + path: "Tests/InstrumentationTests/URLSessionTests"), |
| 131 | + .testTarget(name: "OpenTracingShimTests", |
| 132 | + dependencies: ["OpenTracingShim", |
| 133 | + "OpenTelemetrySdk"], |
| 134 | + path: "Tests/ImportersTests/OpenTracingShim"), |
| 135 | + .testTarget(name: "SwiftMetricsShimTests", |
| 136 | + dependencies: ["SwiftMetricsShim", |
| 137 | + "OpenTelemetrySdk"], |
| 138 | + path: "Tests/ImportersTests/SwiftMetricsShim"), |
| 139 | + .testTarget(name: "JaegerExporterTests", |
| 140 | + dependencies: ["JaegerExporter"], |
| 141 | + path: "Tests/ExportersTests/Jaeger"), |
| 142 | + .testTarget(name: "ZipkinExporterTests", |
| 143 | + dependencies: ["ZipkinExporter"], |
| 144 | + path: "Tests/ExportersTests/Zipkin"), |
| 145 | + .testTarget(name: "PrometheusExporterTests", |
| 146 | + dependencies: ["PrometheusExporter"], |
| 147 | + path: "Tests/ExportersTests/Prometheus"), |
| 148 | + .testTarget(name: "OpenTelemetryProtocolExporterTests", |
| 149 | + dependencies: ["OpenTelemetryProtocolExporter"], |
| 150 | + path: "Tests/ExportersTests/OpenTelemetryProtocol"), |
| 151 | + .testTarget(name: "InMemoryExporterTests", |
| 152 | + dependencies: ["InMemoryExporter"], |
| 153 | + path: "Tests/ExportersTests/InMemory"), |
| 154 | + .testTarget(name: "DatadogExporterTests", |
| 155 | + dependencies: ["DatadogExporter", |
| 156 | + .product(name: "NIO", package: "swift-nio"), |
| 157 | + .product(name: "NIOHTTP1", package: "swift-nio")], |
| 158 | + path: "Tests/ExportersTests/DatadogExporter"), |
| 159 | + .testTarget(name: "PersistenceExporterTests", |
| 160 | + dependencies: ["PersistenceExporter"], |
| 161 | + path: "Tests/ExportersTests/PersistenceExporter"), |
| 162 | + .executableTarget( |
| 163 | + name: "LoggingTracer", |
| 164 | + dependencies: ["OpenTelemetryApi"], |
| 165 | + path: "Examples/Logging Tracer" |
| 166 | + ), |
| 167 | + .executableTarget( |
| 168 | + name: "SimpleExporter", |
| 169 | + dependencies: ["OpenTelemetrySdk", "JaegerExporter", "StdoutExporter", "ZipkinExporter", "ResourceExtension", "SignPostIntegration"], |
| 170 | + path: "Examples/Simple Exporter", |
| 171 | + exclude: ["README.md"] |
| 172 | + ), |
| 173 | + .executableTarget( |
| 174 | + name: "OTLPExporter", |
| 175 | + dependencies: ["OpenTelemetrySdk", "OpenTelemetryProtocolExporter", "StdoutExporter", "ZipkinExporter", "ResourceExtension", "SignPostIntegration"], |
| 176 | + path: "Examples/OTLP Exporter", |
| 177 | + exclude: ["README.md"] |
| 178 | + ), |
| 179 | + .executableTarget( |
| 180 | + name: "PrometheusSample", |
| 181 | + dependencies: ["OpenTelemetrySdk", "PrometheusExporter"], |
| 182 | + path: "Examples/Prometheus Sample", |
| 183 | + exclude: ["README.md"] |
| 184 | + ), |
| 185 | + .executableTarget( |
| 186 | + name: "DatadogSample", |
| 187 | + dependencies: ["DatadogExporter"], |
| 188 | + path: "Examples/Datadog Sample", |
| 189 | + exclude: ["README.md"] |
| 190 | + ), |
| 191 | + .executableTarget( |
| 192 | + name: "NetworkSample", |
| 193 | + dependencies: ["URLSessionInstrumentation", "StdoutExporter"], |
| 194 | + path: "Examples/Network Sample", |
| 195 | + exclude: ["README.md"] |
| 196 | + ), |
| 197 | + ] |
| 198 | +) |
0 commit comments