Skip to content

Commit

Permalink
Update event source to use AnyURLSession
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmichel committed Jan 18, 2024
1 parent b5c1e27 commit b0cda6a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "anyurlsession",
"kind" : "remoteSourceControl",
"location" : "https://github.com/thebrowsercompany/AnyURLSession",
"state" : {
"branch" : "71f2424",
"revision" : "71f2424744cc3d12815e35d7ec2475e3456b4a9f"
}
}
],
"version" : 2
}
9 changes: 7 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.6

import PackageDescription

Expand All @@ -13,10 +13,15 @@ let package = Package(
products: [
.library(name: "LDSwiftEventSource", targets: ["LDSwiftEventSource"]),
],
dependencies: [],
dependencies: [
.package(url: "https://github.com/thebrowsercompany/AnyURLSession", revision: "71f2424")
],
targets: [
.target(
name: "LDSwiftEventSource",
dependencies: [
.product(name: "AnyURLSession", package: "AnyURLSession")
],
path: "Source"),
.testTarget(
name: "LDSwiftEventSourceTests",
Expand Down
7 changes: 6 additions & 1 deletion Source/LDSwiftEventSource.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Foundation

#if os(Linux) || os(Windows)
import FoundationNetworking
import AnyURLSession

import class FoundationNetworking.HTTPURLResponse
import struct FoundationNetworking.URLRequest
import class FoundationNetworking.URLResponse
import class FoundationNetworking.URLSessionConfiguration
#endif

/**
Expand Down

0 comments on commit b0cda6a

Please sign in to comment.