Skip to content

Commit de86cd7

Browse files
[content improvements] update cli and library getting started guides (#357)
motivation: finalize the getting started guides changes: * use default bash prompt * update url + name of example library used in cli guide * fix small typos --------- Co-authored-by: Alexander Sandberg <[email protected]>
1 parent ebc14d9 commit de86cd7

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

getting-started/cli-swiftpm/index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Let’s write a small application with our new Swift development environment.
1313
To start, we’ll use SwiftPM to make a new project for us. In your terminal of choice run:
1414

1515
~~~bash
16-
mkdir MyCLI
17-
cd MyCLI
18-
swift package init --name MyCLI --type executable
16+
$ mkdir MyCLI
17+
$ cd MyCLI
18+
$ swift package init --name MyCLI --type executable
1919
~~~
2020

2121
This will generate a new directory called MyCLI with the following files:
@@ -42,7 +42,7 @@ In fact, SwiftPM generated a "Hello, world!" project for us, including some unit
4242
We can run the tests by running `swift test` in our terminal.
4343

4444
~~~bash
45-
swift test
45+
$ swift test
4646
Building for debugging...
4747
[6/6] Linking MyCLIPackageTests
4848
Build complete! (16.53s)
@@ -62,7 +62,7 @@ Test Suite 'All tests' passed at 2023-01-12 13:38:22.398.
6262
We can also run the program by running `swift run` in our terminal.
6363

6464
~~~bash
65-
swift run MyCLI
65+
$ swift run MyCLI
6666
[3/3] Linking MyCLI
6767
Hello, World!
6868
~~~
@@ -71,7 +71,7 @@ Hello, World!
7171

7272
Swift based applications are usually composed from libraries that provide useful functionality.
7373

74-
In this project, we’ll use a package called [swift-figlet](https://github.com/tomerd/swift-figlet) which will help us make ASCII art.
74+
In this project, we’ll use a package called [example-package-figlet](https://github.com/apple/example-package-figlet) which will help us make ASCII art.
7575

7676
You can find more interesting libraries on [Swift Package Index](https://swiftpackageindex.com) -- the unofficial package index for Swift.
7777

@@ -88,13 +88,13 @@ name: "MyCLI",
8888
.executable(name: "MyCLI", targets: ["MyCLI"])
8989
],
9090
dependencies: [
91-
.package(url: "https://github.com/tomerd/swift-figlet", branch: "main"),
91+
.package(url: "https://github.com/apple/example-package-figlet", branch: "main"),
9292
],
9393
targets: [
9494
.executableTarget(
9595
name: "MyCLI",
9696
dependencies: [
97-
.product(name: "Figlet", package: "swift-figlet"),
97+
.product(name: "Figlet", package: "example-package-figlet"),
9898
]
9999
),
100100
.testTarget(
@@ -105,7 +105,7 @@ name: "MyCLI",
105105
)
106106
~~~
107107

108-
Running `swift build` will instruct SwiftPM to install the new dependencies and then proceed to build the code.
108+
Running `swift build` will instruct SwiftPM to download the new dependencies and then proceed to build the code.
109109

110110
Running this command also created a new file for us, `Package.resolved`.
111111
This file is a snapshot of the exact versions of the dependencies we are using locally.
@@ -116,7 +116,7 @@ To use this dependency, we can open `MyCLI.swift`, remove everything that’s in
116116
import Figlet
117117
~~~
118118

119-
This line means that we can now use the `Figlet` module that the `swift-figlet` package exports.
119+
This line means that we can now use the `Figlet` module that the `example-package-figlet` package exports.
120120

121121
## A small application
122122

@@ -171,7 +171,7 @@ import PackageDescription
171171
let package = Package(
172172
name: "swift-swift",
173173
dependencies: [
174-
.package(url: "https://github.com/tomerd/swift-figlet", branch: "main"),
174+
.package(url: "https://github.com/apple/example-package-figlet", branch: "main"),
175175
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
176176
],
177177
products: [
@@ -181,7 +181,7 @@ let package = Package(
181181
.executableTarget(
182182
name: "MyCLI",
183183
dependencies: [
184-
.product(name: "Figlet", package: "swift-figlet"),
184+
.product(name: "Figlet", package: "example-package-figlet"),
185185
.product(name: "ArgumentParser", package: "swift-argument-parser"),
186186
]
187187
),

getting-started/library-swiftpm/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ title: Build a library
99

1010
## Bootstrapping
1111

12-
Let’s write a small application with our new Swift development environment.
12+
Let’s write a small library with our new Swift development environment.
1313
To start, we’ll use SwiftPM to make a new project for us. In your terminal of choice run:
1414

1515
~~~bash
16-
mkdir MyLibrary
17-
cd MyLibrary
18-
swift package init --name MyLibrary --type library
16+
$ mkdir MyLibrary
17+
$ cd MyLibrary
18+
$ swift package init --name MyLibrary --type library
1919
~~~
2020

2121
This will generate a new directory called _MyLibrary_ with the following files:
@@ -41,7 +41,7 @@ In fact, SwiftPM generated a "Hello, world!" project for us, including some unit
4141
We can run the tests by running `swift test` in our terminal.
4242

4343
~~~bash
44-
swift test
44+
$ swift test
4545
Building for debugging...
4646
[4/4] Compiling MyLibraryTests MyLibraryTests.swift
4747
Build complete! (1.30s)

0 commit comments

Comments
 (0)