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

Rename Sources/GCDLock.swift to Sources/Swift/GCDLock.swift #117

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
996086e
Create Package.swift
devgster Dec 13, 2024
c1100a3
Update Package.swift
devgster Dec 13, 2024
920cefb
Update Package.swift
devgster Dec 13, 2024
d88481f
Update Package.swift
devgster Dec 13, 2024
a4fbb85
Update Package.swift
devgster Dec 13, 2024
98667c5
Update Package.swift
devgster Dec 13, 2024
6d5f620
Update Package.swift
devgster Dec 13, 2024
34cc038
Update Package.swift
devgster Dec 16, 2024
d1724aa
Create README.md
devgster Dec 16, 2024
9a62175
Rename Sources/Endian.swift to Sources/Swift/Endian.swift
devgster Dec 16, 2024
0067024
Rename Sources/GCDLock.swift to Sources/Swift/GCDLock.swift
devgster Dec 16, 2024
ea57084
구조 변경
devgster Dec 16, 2024
4619eca
Update Package.swift
devgster Dec 16, 2024
ebae532
Update Package.swift
devgster Dec 18, 2024
c1cf405
Update Package.swift
devgster Dec 18, 2024
eb178f3
Update Package.swift
devgster Dec 18, 2024
ccadcf1
Update module.modulemap
devgster Dec 18, 2024
d88224d
Update module.modulemap
devgster Dec 18, 2024
104ec46
Update Package.swift
devgster Dec 18, 2024
b72bd4d
Update Package.swift
devgster Dec 18, 2024
f80de17
Rename Sources/CTrueTime/ntp_types.h to Sources/CTrueTime/include/ntp…
devgster Dec 18, 2024
089c0ed
Update Package.swift
devgster Dec 18, 2024
76064c9
Update Package.swift
devgster Dec 18, 2024
094b915
Create module.modulemap
devgster Dec 18, 2024
bbadfab
Update Package.swift
devgster Dec 18, 2024
a8a2c51
Package.swift 파일 편집
jalynneyoon Dec 18, 2024
9284e54
Package.swift 파일 수정
jalynneyoon Dec 18, 2024
7e4958b
TrueTime.h 에 있던 코드 이동
jalynneyoon Dec 18, 2024
3172b73
미사용 코드 제거
jalynneyoon Dec 18, 2024
70f2f49
미사용 코드 제거
jalynneyoon Dec 18, 2024
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
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version:5.6
import PackageDescription

let package = Package(
name: "TrueTime",
platforms: [
.iOS(.v15), // iOS 10.0 이상 지원
],
products: [
.library(
name: "TrueTime",
targets: ["TrueTime"]),
.library(
name: "CTrueTime",
targets: ["CTrueTime"]
)

],
dependencies: [],

targets: [
.target(
name: "TrueTime",
dependencies: ["CTrueTime"],
path: "Sources/Swift"
),
.systemLibrary(
name: "CTrueTime",
path: "Sources/CTrueTime"
)
]
)
1 change: 1 addition & 0 deletions Sources/Endian.swift → Sources/Swift/Endian.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

protocol NetworkOrderConvertible {
var byteSwapped: Self { get }
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions Sources/NTPClient.swift → Sources/Swift/NTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Instacart. All rights reserved.
//

import Foundation
import CTrueTime

struct NTPConfig {
let timeout: TimeInterval
let maxRetries: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

typealias NTPConnectionCallback = (NTPConnection, FrozenNetworkTimeResult) -> Void

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

public extension timeval {
static func uptime() -> timeval {
Expand Down Expand Up @@ -94,7 +95,7 @@ extension ByteRepresentable {
extension ntp_packet_t: ByteRepresentable {}
extension sockaddr_in: ByteRepresentable {}
extension sockaddr_in6: ByteRepresentable {}
extension sockaddr_in6: CustomStringConvertible {
extension sockaddr_in6: @retroactive CustomStringConvertible {
public var description: String {
var buffer = [Int8](repeating: 0, count: Int(INET6_ADDRSTRLEN))
var addr = sin6_addr
Expand All @@ -106,7 +107,7 @@ extension sockaddr_in6: CustomStringConvertible {
}
}

extension sockaddr_in: CustomStringConvertible {
extension sockaddr_in: @retroactive CustomStringConvertible {
public var description: String {
let host = String(cString: inet_ntoa(sin_addr))
let port = Int(sin_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CTrueTime

struct NTPResponse {
let packet: ntp_packet_t
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Instacart. All rights reserved.
//

import Foundation
import CTrueTime

typealias FrozenTimeResult = Result<FrozenTime, NSError>
typealias FrozenTimeCallback = (FrozenTimeResult) -> Void

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

protocol TimedOperation: class {
protocol TimedOperation: AnyObject {
var started: Bool { get }
var timeout: TimeInterval { get }
var timer: DispatchSourceTimer? { get set }
Expand Down
11 changes: 9 additions & 2 deletions Sources/TrueTime.swift → Sources/Swift/TrueTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

import Foundation

let TrueTimeErrorDomain = "com.instacart.TrueTimeErrorDomain"

extension Notification.Name {
static let TrueTimeUpdated = Notification.Name.init("TrueTimeUpdatedNotification")
}


@objc public enum TrueTimeError: Int {
case cannotFindHost
case dnsLookupFailed
Expand Down Expand Up @@ -117,9 +124,9 @@ extension TrueTimeClient {
@objc public func fetchIfNeeded(success: @escaping (ReferenceTime) -> Void,
failure: ((NSError) -> Void)?,
onQueue queue: DispatchQueue) {
fetchIfNeeded(queue: queue) { result in
fetchIfNeeded(queue: queue, completion: { result in
self.mapBridgedResult(result, success: success, failure: failure)
}
})
}

private func mapBridgedResult(_ result: ReferenceTimeResult,
Expand Down
26 changes: 0 additions & 26 deletions Sources/TrueTime.h

This file was deleted.

12 changes: 0 additions & 12 deletions Sources/TrueTime.m

This file was deleted.