Skip to content
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

rc 2.0.6 #4

Merged
merged 1 commit into from
Jan 21, 2024
Merged
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
14 changes: 8 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftNet",
targets: ["SwiftNet", "SwiftNetMacros"])
targets: ["SwiftNet", "SNUtilities", "SwiftNetMacros"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -29,18 +29,20 @@ let package = Package(
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
"SwiftNet"
"SNUtilities"
]
),
.target(
name: "SwiftNet",
exclude: ["../../SwiftNet.podspec"]),
dependencies: ["SNUtilities", "SwiftNetMacros"],
exclude: ["../../SwiftNet-macroless.podspec"]),
.target(name: "SNUtilities"),
.target(
name: "SwiftNetMacros",
dependencies: ["SNMacros", "SNUtilities"]),
.testTarget(
name: "SwiftNetTests",
dependencies: ["SwiftNet", "SwiftNetMacros", "SNMacros"]),
.target(
name: "SwiftNetMacros",
dependencies: ["SNMacros", "SwiftNet"]),
.testTarget(
name: "SwiftNetMacrosTests",
dependencies: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum AccessTokenStrategy {
case global, custom(String)

var storingLabel: String {
public var storingLabel: String {
switch self {
case .global:
return "accessToken_SwiftNet"
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftNet/Config/SNConfig + extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation


extension SNConfig {
//MARK: set access token methods

Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftNet/Data/AccessTokenStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation


extension SNConfig {
fileprivate static var accessTokens: [String: SNAccessToken] = [:]
}
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftNet/EndpointBuilder/EndpointBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import Combine


public protocol EndpointBuilderAbstract {
associatedtype T: Codable & Equatable

Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftNet/EndpointBuilder/EndpointModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import Combine


public protocol EndpointModel {
var identifier: String { get }
static var defaultAccessTokenStrategy: AccessTokenStrategy { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import Combine


extension AnyPublisher {
/// Converts publisher to return object responding to AccessTokenConvertible in case of success
public func asAccessTokenConvertible() throws -> AnyPublisher<AccessTokenConvertible, Error> {
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftNet/Request/SNProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import Foundation
@_exported import Combine
@_exported import SNUtilities
@_exported import SwiftNetMacros

fileprivate func runOnMain(_ completion: @escaping () -> Void) {
DispatchQueue.main.async {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetMacros/SwiftNetMacros.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The Swift Programming Language
// https://docs.swift.org/swift-book

import SwiftNet
import SNUtilities

@attached(member, names: named(url), named(identifier), named(staticIdentifier))
public macro Endpoint(url: String) = #externalMacro(module: "SNMacros", type: "EndpointMacro")
Expand Down