instacart / TrueTime.swift

NTP library for Swift and Objective-C. Get the true time impervious to device clock changes.
https://tech.instacart.com/truetime/
Apache License 2.0
589 stars 130 forks source link

SwiftPM manifest file #82

Open enricode opened 4 years ago

enricode commented 4 years ago

Hello,

is it possible to add a package description file for Swift Package Manager?

I've done something similar:

// swift-tools-version:5.1

import PackageDescription

let package = Package(
    name: "TrueTime",
    products: [
        .library(
            name: "TrueTime-iOS",
            targets: ["TrueTime-iOS"]
        ),
        .library(
            name: "TrueTime-Mac",
            targets: ["TrueTime-Mac"]
        ),
        .library(
            name: "TrueTime-tvOS",
            targets: ["TrueTime-tvOS"]
        )
    ],
    dependencies: [
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    targets: [
        .target(
            name: "TrueTime-iOS",
            dependencies: [],
            path: "Sources"
        ),
        .target(
            name: "TrueTime-Mac",
            dependencies: [],
            path: "Sources"
        ),
        .target(
            name: "TrueTime-tvOS",
            dependencies: [],
            path: "Sources"
        )
    ]
)

but it's only the first step since there are also the C files to put into an include directory where Xcode can find them.

Is there any plan to support this?

davedelong commented 4 years ago

+1 I'd like to use TrueTime.swift in a package I'm working on, and I need SPM support as well.

otymartin commented 3 years ago

bump +1

jay18001 commented 3 years ago

I have package manager support on my fork https://github.com/jay18001/TrueTime.swift/

MartPiet commented 3 years ago

Is there any reason why there is no Swift PM support yet?

nobinajohan commented 3 years ago

@jay18001 I couldn't get your fork to work. I get the error: "https://github.com/jay18001/TrueTime.swift/ has no Package.swift manifest for version 5.1.0"

dregatos commented 3 years ago

Hi @nobinajohan,

You have to use the commit hash -> 80f4900a6d369f71da204b752cd16a637d7b7ecc.

pragnesh-is commented 1 year ago

@jay18001 Please can you tag your commit and create stable version since to use it as dependency in published package it needs to be have stable version. Check this comment: https://forums.swift.org/t/dependencies-could-not-be-resolved-because-package-yeelampa-is-required-using-a-stable-version-but-yeelampa-depends-on-an-unstable-version-package-requester-and-root-depends-on-yeelampa-0-1-0/53840/2

pragnesh-is commented 1 year ago

@jay18001 Please can you tag your commit and create stable version since to use it as dependency in published package it needs to be have stable version. Check this comment: https://forums.swift.org/t/dependencies-could-not-be-resolved-because-package-yeelampa-is-required-using-a-stable-version-but-yeelampa-depends-on-an-unstable-version-package-requester-and-root-depends-on-yeelampa-0-1-0/53840/2

Created tag in my fork for this use: https://github.com/pragnesh-is/TrueTime.swift/tree/5.2.0