Guide on how to use Swift Package Manager


(Adrian Brink) #1

Hi,

so I would like to write a small CLI in Swift and use the Swift Package
Manager.

However, I have a hard time finding resources that explain, which versions of
Swift support it exactly, what the init command is and where to go from there.

All I have found are these two resources:

https://github.com/apple/swift-package-manager

https://github.com/apple/swift-package-manager/tree/master/Documentation

Is there something like this:

https://docs.npmjs.com/

https://doc.rust-lang.org/book/getting-started.html

I think this is crucial if we want to get new people to try out the open
source version of Swift because these tutorials are what people have come to
expect when approaching a new language.

If there is, I would appreciate it if we could share it and if there isn't it
would be nice if we, as a community, could create something like this, or at
least one README page that walks through the initial flow.

If someone is interested let me know and then we can try and make it work.

/local-d2b7550c-221a/0?redirect=https%3A%2F%2Fnylas.com%2Fn1%3Fref%3Dn1&r=c3dp
ZnQtdXNlcnNAc3dpZnQub3Jn), the extensible, open source mail client.

![](https://link.nylas.com/open/cpvvu89b6khaohz5hhf2xh3dw/local-d2b7550c-
221a?r=c3dpZnQtdXNlcnNAc3dpZnQub3Jn)

···

Sent from [Nylas N1](https://link.nylas.com/link/cpvvu89b6khaohz5hhf2xh3dw


(Ankit Agarwal) #2

There has been some progress towards better documentation, but there is
still a lot to be done. Here are some current references (which might need
updates..)
https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md#build-an-executable
https://swift.org/package-manager/#example-usage
https://swift.org/package-manager/

Basically SwiftPM has three commands: swift build, swift package and swift
test
You can see available options on each using --help option.

$ swift package --help

To create an executable:

$ mkdir myPackage && cd myPackage
$ swift package init --type executable
$ swift build
$ .build/debug/myPackage

some JIRAs tracking this:
https://bugs.swift.org/browse/SR-2304
https://bugs.swift.org/browse/SR-2179

···

On Sat, Aug 13, 2016 at 2:39 PM, Adrian Brink via swift-users < swift-users@swift.org> wrote:

Hi,

so I would like to write a small CLI in Swift and use the Swift Package
Manager.

However, I have a hard time finding resources that explain, which versions
of Swift support it exactly, what the init command is and where to go from
there.

All I have found are these two resources:
https://github.com/apple/swift-package-manager
https://github.com/apple/swift-package-manager/tree/master/Documentation

Is there something like this:
https://docs.npmjs.com/
https://doc.rust-lang.org/book/getting-started.html

I think this is crucial if we want to get new people to try out the open
source version of Swift because these tutorials are what people have come
to expect when approaching a new language.

If there is, I would appreciate it if we could share it and if there isn't
it would be nice if we, as a community, could create something like this,
or at least one README page that walks through the initial flow.

If someone is interested let me know and then we can try and make it work.

Sent from Nylas N1
<https://link.nylas.com/link/cpvvu89b6khaohz5hhf2xh3dw/local-d2b7550c-221a/0?redirect=https%3A%2F%2Fnylas.com%2Fn1%3Fref%3Dn1&r=c3dpZnQtdXNlcnNAc3dpZnQub3Jn>,
the extensible, open source mail client.

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

--
Ankit