Skip to content

Commit 76c78be

Browse files
bsneedBrandon Sneed
andauthored
SegmentAmplitude Additions (#1)
* SegmentAmplitude Additions * fixed workflow * permission change * fixed spacing. * more yml changes Co-authored-by: Brandon Sneed <[email protected]>
1 parent 466966d commit 76c78be

File tree

12 files changed

+288
-221
lines changed

12 files changed

+288
-221
lines changed

.github/workflows/swift.yml

Lines changed: 27 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,35 @@ name: Swift
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main ]
88

99
jobs:
1010
cancel_previous:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: styfle/[email protected]
14-
with:
15-
workflow_id: ${{ github.event.workflow.id }}
16-
17-
# build_and_test_spm_mac:
18-
# needs: cancel_previous
19-
# runs-on: macos-11
20-
# steps:
21-
# - uses: maxim-lobanov/setup-xcode@v1
22-
# with:
23-
# xcode-version: '13.0'
24-
# - uses: actions/checkout@v2
25-
# - uses: webfactory/[email protected]
26-
# with:
27-
# ssh-private-key: ${{ secrets.SOVRAN_SSH_KEY }}
28-
# - name: Build
29-
# run: swift build
30-
# - name: Run tests
31-
# run: swift test
32-
33-
build_and_test_ios:
34-
needs: cancel_previous
35-
runs-on: macos-11
36-
steps:
37-
- uses: maxim-lobanov/setup-xcode@v1
38-
with:
39-
xcode-version: '13.0'
40-
- uses: actions/checkout@v2
41-
- uses: actions/cache@v2
42-
with:
43-
path: /Users/runner/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
44-
key: ${{ runner.os }}-spm-ios-${{ hashFiles('**/Package.resolved') }}
45-
restore-keys: |
46-
${{ runner.os }}-spm-ios
47-
- uses: webfactory/[email protected]
48-
with:
49-
ssh-private-key: ${{ secrets.SOVRAN_SSH_KEY }}
50-
- run: xcodebuild -scheme Segment-Package test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11'
51-
11+
permissions: write-all
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: styfle/[email protected]
15+
with:
16+
workflow_id: ${{ github.event.workflow.id }}
17+
5218
build_and_test_examples:
53-
needs: cancel_previous
54-
runs-on: macos-11
55-
steps:
56-
- uses: maxim-lobanov/setup-xcode@v1
57-
with:
58-
xcode-version: '13.0'
59-
- uses: actions/checkout@v2
60-
- uses: actions/cache@v2
61-
with:
62-
path: /Users/runner/Library/Developer/Xcode/DerivedData
63-
key: ${{ runner.os }}-spm-examples-${{ hashFiles('**/Package.resolved') }}
64-
restore-keys: |
65-
${{ runner.os }}-spm-examples
66-
- uses: webfactory/[email protected]
67-
with:
68-
ssh-private-key: ${{ secrets.SOVRAN_SSH_KEY }}
69-
- name: build for ios simulator
70-
run: |
71-
cd Example/BasicExample
72-
xcodebuild -workspace "BasicExample.xcworkspace" -scheme "BasicExample" -sdk iphonesimulator
73-
19+
needs: cancel_previous
20+
runs-on: macos-11
21+
steps:
22+
- uses: maxim-lobanov/setup-xcode@v1
23+
with:
24+
xcode-version: '13.0'
25+
- uses: actions/checkout@v2
26+
- uses: actions/cache@v2
27+
with:
28+
path: /Users/runner/Library/Developer/Xcode/DerivedData
29+
key: ${{ runner.os }}-spm-examples-${{ hashFiles('**/Package.resolved') }}
30+
restore-keys: |
31+
${{ runner.os }}-spm-examples
32+
- name: build for ios simulator
33+
run: |
34+
cd Example/BasicExample
35+
xcodebuild -workspace "BasicExample.xcworkspace" -scheme "BasicExample" -sdk iphonesimulator
36+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@ fastlane/test_output
8989

9090
iOSInjectionProject/
9191
/Example/BasicExample/BasicExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
92+
.DS_Store
93+
/.swiftpm

Example/BasicExample/BasicExample.xcodeproj/project.pbxproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
46EDC71127C6B8D200B870D7 /* BasicExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46EDC71027C6B8D200B870D7 /* BasicExampleUITests.swift */; };
1616
46EDC71327C6B8D200B870D7 /* BasicExampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46EDC71227C6B8D200B870D7 /* BasicExampleUITestsLaunchTests.swift */; };
1717
46EDC72127C6B92C00B870D7 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 46EDC72027C6B92C00B870D7 /* Segment */; };
18+
46EDC72627C6C69800B870D7 /* SegmentAmplitude in Frameworks */ = {isa = PBXBuildFile; productRef = 46EDC72527C6C69800B870D7 /* SegmentAmplitude */; };
1819
/* End PBXBuildFile section */
1920

2021
/* Begin PBXContainerItemProxy section */
@@ -52,6 +53,7 @@
5253
isa = PBXFrameworksBuildPhase;
5354
buildActionMask = 2147483647;
5455
files = (
56+
46EDC72627C6C69800B870D7 /* SegmentAmplitude in Frameworks */,
5557
46EDC72127C6B92C00B870D7 /* Segment in Frameworks */,
5658
);
5759
runOnlyForDeploymentPostprocessing = 0;
@@ -80,6 +82,7 @@
8082
46EDC70527C6B8D200B870D7 /* BasicExampleTests */,
8183
46EDC70F27C6B8D200B870D7 /* BasicExampleUITests */,
8284
46EDC6F327C6B8D100B870D7 /* Products */,
85+
46EDC72227C6C59B00B870D7 /* Frameworks */,
8386
);
8487
sourceTree = "<group>";
8588
};
@@ -129,6 +132,13 @@
129132
path = BasicExampleUITests;
130133
sourceTree = "<group>";
131134
};
135+
46EDC72227C6C59B00B870D7 /* Frameworks */ = {
136+
isa = PBXGroup;
137+
children = (
138+
);
139+
name = Frameworks;
140+
sourceTree = "<group>";
141+
};
132142
/* End PBXGroup section */
133143

134144
/* Begin PBXNativeTarget section */
@@ -147,6 +157,7 @@
147157
name = BasicExample;
148158
packageProductDependencies = (
149159
46EDC72027C6B92C00B870D7 /* Segment */,
160+
46EDC72527C6C69800B870D7 /* SegmentAmplitude */,
150161
);
151162
productName = BasicExample;
152163
productReference = 46EDC6F227C6B8D100B870D7 /* BasicExample.app */;
@@ -605,6 +616,10 @@
605616
package = 46EDC71F27C6B92C00B870D7 /* XCRemoteSwiftPackageReference "analytics-swift" */;
606617
productName = Segment;
607618
};
619+
46EDC72527C6C69800B870D7 /* SegmentAmplitude */ = {
620+
isa = XCSwiftPackageProductDependency;
621+
productName = SegmentAmplitude;
622+
};
608623
/* End XCSwiftPackageProductDependency section */
609624
};
610625
rootObject = 46EDC6EA27C6B8D100B870D7 /* Project object */;

Example/BasicExample/BasicExample.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/BasicExample/BasicExample/BasicExampleApp.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import SwiftUI
99
import Segment
10+
import SegmentAmplitude
1011

1112
@main
1213
struct BasicExampleApp: App {
@@ -22,7 +23,7 @@ extension Analytics {
2223
let analytics = Analytics(configuration: Configuration(writeKey: "<YOUR WRITE KEY>")
2324
.flushAt(3)
2425
.trackApplicationLifecycleEvents(true))
25-
//analytics.add(plugin: <Destination>())
26+
analytics.add(plugin: AmplitudeSession())
2627
return analytics
2728
}
2829
}

ExampleDestination.swift

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)