Skip to content

Commit

Permalink
Removes macros
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianmorath committed Nov 20, 2024
1 parent 031e33d commit 6d5955e
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 267 deletions.
8 changes: 0 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ let package = Package(
targets: [
.target(
name: "UBFoundation",
dependencies: ["UBMacros"],
swiftSettings: [
.swiftLanguageMode(.v6),
]
Expand Down Expand Up @@ -67,13 +66,6 @@ let package = Package(
.swiftLanguageMode(.v6),
]
),
.macro(name: "UBMacros", dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
],
swiftSettings: [
.swiftLanguageMode(.v6),
]),
.testTarget(name: "UBFoundationTests",
dependencies: ["UBFoundation", .product(name: "UBLocalNetworking", package: "ios-local-networking")],
resources: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/UBFoundation/Cron/CronJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class UBCronJob: Sendable {
/// The state of the Job
public private(set) nonisolated(unsafe) var state: State = .initial {
willSet {
#assert(state != newValue)
assert(state != newValue)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/UBFoundation/Cron/CronRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public struct UBFireAtIntervalRule: UBCronRule {
/// - isRepeating: If the job should keep repeat afterwards
/// - tolerence: The accepted tolerence with the firing date
public init(_ interval: TimeInterval, repeat isRepeating: Bool = false, tolerence: DispatchTimeInterval? = nil) {
#assert((isRepeating && interval > 0) || !isRepeating)
assert((isRepeating && interval > 0) || !isRepeating)
repeatRule = isRepeating ? .after(interval.dispatchTimeInterval) : .never
self.tolerence = tolerence
self.interval = interval
Expand Down
11 changes: 0 additions & 11 deletions Sources/UBFoundation/Helpers/URL+Macro.swift

This file was deleted.

46 changes: 0 additions & 46 deletions Sources/UBFoundation/Logging/PrintMacros+Implementation.swift

This file was deleted.

58 changes: 0 additions & 58 deletions Sources/UBFoundation/Logging/PrintMacros.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/UBFoundation/Networking/UBURLDataTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public final class UBURLDataTask: UBURLSessionTask, CustomStringConvertible, Cus
break
default:
let errorMessage = "Invalid state transition from \(_state) -> \(newValue)"
#assertionFailure(errorMessage)
assertionFailure(errorMessage)
UBNonFatalErrorReporter.shared.report(NSError(domain: "UBURLDataTask", code: 0, userInfo: [NSLocalizedDescriptionKey: errorMessage]))
}
}
Expand Down
14 changes: 7 additions & 7 deletions Sources/UBFoundation/Networking/UBURLSession+Delegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _ubDataTask: UBURLDataTask?
Expand Down Expand Up @@ -162,7 +162,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _collectedData: UBURLSessionDelegate.DataHolder?
Expand All @@ -179,7 +179,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _ubDataTask: UBURLDataTask?
Expand Down Expand Up @@ -214,7 +214,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _ubDataTask: UBURLDataTask?
Expand All @@ -237,7 +237,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}
guard cachingLogic == nil else {
// If we have a caching logic, we will skip the default caching implementation
Expand All @@ -251,7 +251,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _ubDataTask: UBURLDataTask?
Expand Down Expand Up @@ -283,7 +283,7 @@ final class UBURLSessionDelegate: NSObject, URLSessionTaskDelegate, URLSessionDa
/// :nodoc:
func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
urlSessionQueue.sync {
#assert(session == self._urlSession, "The sessions are not matching")
assert(session == self._urlSession, "The sessions are not matching")
}

var _ubDataTask: UBURLDataTask?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public final class UBPinnedCertificatesTrustEvaluator: UBServerTrustEvaluator {

/// :nodoc:
public func evaluate(_ trust: SecTrust, forHost host: String) throws {
#assert(certificates.isEmpty == false, "This should not have happened as we make sure to crash if there are no certificates found during initialization.")
assert(certificates.isEmpty == false, "This should not have happened as we make sure to crash if there are no certificates found during initialization.")

if acceptSelfSignedCertificates {
try trust.setAnchorCertificates(certificates)
Expand Down
2 changes: 1 addition & 1 deletion Sources/UBLocation/UBLocationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public class UBLocationManager: NSObject {

self.startLocationMonitoringForAllDelegates()

#assert(!delegateWrappers.isEmpty || allUsages == [])
assert(!delegateWrappers.isEmpty || allUsages == [])
}

/// Stops monitoring all location service events
Expand Down
19 changes: 0 additions & 19 deletions Sources/UBMacros/CustomError.swift

This file was deleted.

59 changes: 0 additions & 59 deletions Sources/UBMacros/PrintMacro.swift

This file was deleted.

21 changes: 0 additions & 21 deletions Sources/UBMacros/UBMacroPlugin.swift

This file was deleted.

28 changes: 0 additions & 28 deletions Sources/UBMacros/URLMacro.swift

This file was deleted.

Loading

0 comments on commit 6d5955e

Please sign in to comment.