Skip to content

Add Experimental Windows Support #281

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

Closed
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 .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.swift]
indent_style = space
indent_size = 4
25 changes: 22 additions & 3 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: styfle/[email protected]
with:
workflow_id: ${{ github.event.workflow.id }}

build_and_test_spm_mac:
needs: cancel_previous
runs-on: macos-latest
Expand Down Expand Up @@ -46,6 +46,26 @@ jobs:
- name: Run tests
run: swift test --enable-test-discovery

# Windows support is still very much a work in progress
# We use a different action here to be able to use a more
# up-to-date toolchain.
build_and_test_spm_windows:
needs: cancel_previous
runs-on: windows-latest
steps:
- uses: compnerd/gha-setup-swift@main
with:
release-tag-name: "20231116.2"
github-repo: "thebrowsercompany/swift-build"
release-asset-name: installer-amd64.exe
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Build
run: swift build
# Testing disabled until https://github.com/segmentio/analytics-swift/issues/279 is fixed
# - name: Run tests
# run: swift test --enable-test-discovery

build_and_test_ios:
needs: cancel_previous
runs-on: macos-latest
Expand Down Expand Up @@ -85,7 +105,7 @@ jobs:
with:
ssh-private-key: ${{ secrets.SOVRAN_SSH_KEY }}
- run: xcodebuild -scheme Segment test -sdk watchsimulator -destination 'platform=watchOS Simulator,name=Apple Watch Series 8 (45mm)'

build_and_test_examples:
needs: cancel_previous
runs-on: macos-latest
Expand Down Expand Up @@ -117,4 +137,3 @@ jobs:
run: |
cd Examples/apps/SegmentUIKitExample
xcodebuild -workspace "SegmentUIKitExample.xcworkspace" -scheme "SegmentUIKitExample" -destination 'platform=macOS,variant=Mac Catalyst'

5 changes: 2 additions & 3 deletions Examples/other_plugins/NotificationTracking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@

// MARK: Common

#if !os(Linux) && !os(macOS)
#if !os(Linux) && !os(macOS) && !os(Windows)

import Foundation
import Segment

class NotificationTracking: Plugin {
var type: PluginType = .utility
weak var analytics: Analytics?

func trackNotification(_ properties: [String: Codable], fromLaunch launch: Bool) {
if launch {
analytics?.track(name: "Push Notification Tapped", properties: properties)
Expand Down Expand Up @@ -95,4 +95,3 @@ extension NotificationTracking: iOSLifecycle {
}

#endif

8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/jsonsafeencoder-swift.git",
"state" : {
"revision" : "75ad40f07d4e0b938e3afb80811244d6b7acd4ba",
"version" : "1.0.0"
"revision" : "8b70dc8c01b7b041912e30e29d2b488a43f782ac",
"version" : "1.0.1"
}
},
{
"identity" : "sovran-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/Sovran-Swift.git",
"location" : "https://github.com/segmentio/sovran-swift.git",
"state" : {
"revision" : "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version" : "1.1.1"
}
}
],
"version" : 2
}
}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/segmentio/sovran-swift.git", from: "1.1.1"),
.package(url: "https://github.com/segmentio/jsonsafeencoder-swift.git", from: "1.0.0")
.package(url: "https://github.com/segmentio/jsonsafeencoder-swift.git", from: "1.0.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/segmentio/sovran-swift.git", from: "1.1.1"),
.package(url: "https://github.com/segmentio/jsonsafeencoder-swift.git", from: "1.0.0")
.package(url: "https://github.com/segmentio/jsonsafeencoder-swift.git", from: "1.0.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
Loading