Skip to content

Add DocC documentation for swiftly #131

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

Merged
merged 8 commits into from
Jul 22, 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
4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [SwiftlyDocs]
4 changes: 4 additions & 0 deletions Documentation/EmptyFile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This is an empty placeholder swift file for the documentation target.

// You can preview the documentation here by running the following command:
// swift package --disable-sandbox preview-documentation --target SwiftlyDocs
21 changes: 21 additions & 0 deletions Documentation/SwiftlyDocs.docc/SwiftlyDocs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ``SwiftlyDocs``

Install and manage your Swift programming language toolchains.

@Metadata {
@DisplayName("Swiftly")
}

## Topics

- <doc:getting-started>

### HOWTOS

- <doc:install-toolchains>
- <doc:uninstall-toolchains>
- <doc:update-toolchain>

### Reference

- <doc:swiftly-cli-reference>
43 changes: 43 additions & 0 deletions Documentation/SwiftlyDocs.docc/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Getting Started with Swiftly

To download swiftly and install Swift, run the following in your terminal, then follow the on-screen instructions:

```
curl -L https://swiftlang.github.io/swiftly/swiftly-install.sh | bash
```

Once swiftly is installed you can use it to install the latest available swift toolchain like this:

```
$ swiftly install latest

Fetching the latest stable Swift release...
Installing Swift 5.8.1
Downloaded 488.5 MiB of 488.5 MiB
Extracting toolchain...
Swift 5.8.1 installed successfully!

$ swift --version

Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: x86_64-unknown-linux-gnu
```

Or, you can install (and use) a swift release:

```
$ swiftly install --use 5.7

$ swift --version

Swift version 5.7.2 (swift-5.7.2-RELEASE)
Target: x86_64-unknown-linux-gnu
```

There's also an option to install the latest snapshot release and get access to the latest features:

```
$ swiftly install main-snapshot
```

> Note: This last example just installed the toolchain. You can run "swiftly use" to switch to it and other installed toolchahins when you're ready.
66 changes: 66 additions & 0 deletions Documentation/SwiftlyDocs.docc/install-toolchains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Install Swift Toolchains

swiftly install

Installing a swift toolchain using swiftly involves downloading it securely and extracting it into a well-known location in your account. Here we will guide you through the different ways you can install a swift toolchain. You will need to install swiftly first. The [Getting Started](getting-started.md) guide is a good place to start with swiftly.

The easiest way to install a swift toolchain is to select the latest stable release:

```
$ swiftly install latest
```

If this is the only toolchain that is installed then swiftly will automatically "use" it so that when you run swift (or any other toolchain command) it will be this version.

```
$ swift --version

Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: x86_64-unknown-linux-gnu
```

You can be very specific about the released version that you want. We can install the 5.6.1 version like this:

```
$ swiftly install 5.6.1
```

Once you've installed more than one toolchain you may notice that swift is on the first version that you installed, not the last one. Swiftly lets you quickly switch between toolchains by "using" them. There's a swiftly subcommand for that.

```
$ swiftly use 5.6.1
```

You can also combine install and use into one command to automate this process with the `--use` switch on the install subcommand:

```
$ swiftly install --use 5.7.1
```

Sometimes you want the latest available patch of a minor release, such as 5.7. Let's omit the patch number so that we get the latest patch.

```
$ swiftly install 5.7
Installing Swift 5.7.2
```

Swiftly supports installing development snapshot toolchains. For example, you can install the latest available snapshot for the next major release using the "main-snapshot" selector and prepare your code for when it arrives.

```
$ swiftly install main-snapshot
```

If you are tracking down a problem on a specific snapshot you can download it using the date.

```
$ swiftly install main-snapshot-2022-01-28
```

The same snapshot capabilities are available for version snapshots too either the latest available one, or a specific date.

```
$ swiftly install 5.7-snapshot
$ swiftly install 5.7-snapshot-2022-08-30
```


Loading