Skip to content

Commit

Permalink
feat: embed dependencies (#130)
Browse files Browse the repository at this point in the history
* feat: embed dependencies

* chore: add DeviceKit to swiftlint ignore

* chore: lint

* test: fixes

* fix: zipkin sources

* fix: check for beaconurl earlier

* test: rename tests to preserve order

* fix: lint

* fix: tests

* print bash commands

* rename devicekit file

* coalesce dependency notes due to compilation errors

* test: increase sleep time for smoke ui tests

* doc: deps

* fix: make DeviceKit private

* change scheme/target name to SplunkOtel (#131)

* chore: rename SplunkRum scheme to SplunkOtel

* fix: add missing scheme

* fix: fullbuild script scheme name

* test: fix SplunkOtel imports
  • Loading branch information
seemk authored Feb 13, 2023
1 parent 7f09321 commit 46b9650
Show file tree
Hide file tree
Showing 132 changed files with 12,155 additions and 549 deletions.
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ file_header:
excluded:
- "Package.swift"
- "SplunkRumWorkspace/SplunkRum/SplunkRum/OpenTelemetry"
- "SplunkRumWorkspace/SplunkRum/SplunkRum/DeviceKit"
- .build
8 changes: 8 additions & 0 deletions Development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Bulding, testing, and contributing to this project

## Dependencies

Due to Swift's package management not being compatible with CocoaPods and OpenTelemetry Swift not supporting it either, it was decided all dependencies would be included in-source.

The list of dependencies can be found in `dependencies.txt` with a link to the repository and a specific commit.

OpenTelemetry Swift is a minimal version where unnecessary parts are stripped out, meaning only Zipkin and Stdout exporters along with the tracing SDK are brought in.

## Building

Open SplunkRumWorkspace in Xcode; everything should be wired up correctly to
Expand Down
11 changes: 0 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,9 @@ let package = Package(
products: [
.library(name: "SplunkOtel", targets: ["SplunkOtel"])
],
dependencies: [
.package(name: "opentelemetry-swift", url:"https://github.com/open-telemetry/opentelemetry-swift", from: "1.1.4"),
.package(url: "https://github.com/devicekit/DeviceKit.git", from: "4.0.0"),
],
targets: [
.target(
name: "SplunkOtel",
dependencies: [
.product(name: "OpenTelemetryApi", package:"opentelemetry-swift"),
.product(name: "OpenTelemetrySdk", package:"opentelemetry-swift"),
.product(name: "StdoutExporter", package:"opentelemetry-swift"),
.product(name: "ZipkinExporter", package:"opentelemetry-swift"),
.product(name: "DeviceKit", package: "DeviceKit")
],
path: "SplunkRumWorkspace/SplunkRum",
exclude: [
"SplunkRumTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
8645680426EFDE9F0059CF04 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8645680326EFDE9F0059CF04 /* Assets.xcassets */; };
8645680726EFDE9F0059CF04 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8645680526EFDE9F0059CF04 /* LaunchScreen.storyboard */; };
8645681D26EFDEA00059CF04 /* SmokeTestUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8645681C26EFDEA00059CF04 /* SmokeTestUITests.swift */; };
8645682F26EFDEB50059CF04 /* SplunkRum.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8645682E26EFDEB50059CF04 /* SplunkRum.framework */; };
8645683026EFDEB50059CF04 /* SplunkRum.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8645682E26EFDEB50059CF04 /* SplunkRum.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8645683426EFDED60059CF04 /* Swifter in Frameworks */ = {isa = PBXBuildFile; productRef = 8645683326EFDED60059CF04 /* Swifter */; };
E27ABB4929956C930060C16D /* SplunkOtel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E27ABB4829956C930060C16D /* SplunkOtel.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -36,7 +35,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
8645683026EFDEB50059CF04 /* SplunkRum.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -56,14 +54,15 @@
8645681C26EFDEA00059CF04 /* SmokeTestUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmokeTestUITests.swift; sourceTree = "<group>"; };
8645681E26EFDEA00059CF04 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8645682E26EFDEB50059CF04 /* SplunkRum.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SplunkRum.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E27ABB4829956C930060C16D /* SplunkOtel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SplunkOtel.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
864567F426EFDE9F0059CF04 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8645682F26EFDEB50059CF04 /* SplunkRum.framework in Frameworks */,
E27ABB4929956C930060C16D /* SplunkOtel.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -123,6 +122,7 @@
8645682D26EFDEB50059CF04 /* Frameworks */ = {
isa = PBXGroup;
children = (
E27ABB4829956C930060C16D /* SplunkOtel.framework */,
8645682E26EFDEB50059CF04 /* SplunkRum.framework */,
);
name = Frameworks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86260EC325CDC1DE009F3CB1"
BuildableName = "SplunkRum.framework"
BlueprintName = "SplunkRum"
BuildableName = "SplunkOtel.framework"
BlueprintName = "SplunkOtel"
ReferencedContainer = "container:../SplunkRum/SplunkRum.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
Expand Down
4 changes: 1 addition & 3 deletions SplunkRumWorkspace/SmokeTest/SmokeTest/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ limitations under the License.
*/

import UIKit
// Why not "import SplunkOtel"? Because this links as a local framework, not as a swift package.
// FIXME align the framework name and directory names with the swift package name at some point
import SplunkRum
import SplunkOtel

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.

import UIKit
import WebKit
import SplunkRum
import SplunkOtel

class ViewController: UIViewController, WKUIDelegate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SmokeTestUITests: XCTestCase {
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

let SLEEP_TIME: UInt32 = 20 // batch is currently every 5 so this should be plenty
let SLEEP_TIME: UInt32 = 30 // batch is currently every 5 so this should be plenty

func testStartup() throws {
// UI tests must launch the application that they test.
Expand Down Expand Up @@ -92,7 +92,7 @@ class SmokeTestUITests: XCTestCase {

// App start, initial presentation transition, etc.

XCTAssert(receivedSpans.count > 2)
XCTAssertGreaterThan(receivedSpans.count, 2)
let srInit = receivedSpans.first(where: { (span) -> Bool in
return span.name == "SplunkRum.initialize"
})
Expand Down
Loading

0 comments on commit 46b9650

Please sign in to comment.