You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: Learn more about [`make`](https://man.freebsd.org/cgi/man.cgi?make(1))
38
38
39
-
###Build with Nova
39
+
## Build with Nova
40
40
41
-
> Prerequisites: Install Nova, the Playdate extension, and the Icarus extension.
41
+
Prerequisites: Install Nova, the Playdate extension, and the Icarus extension.
42
+
43
+
### Configure the Icarus extension
44
+
45
+
Configure the Icarus Swift language support extension to use a Swift nightly toolchain. See <doc:DownloadingTheTools> for instructions on how to install a nightly toolchain.
46
+
47
+
Use the Menu bar to navigate to the extension library Extension > Extension Library or press Cmd+Shift+2. Select the Icarus extension, then select the Settings panel. Finally, select the "Toolchain: Custom" option and provide a full path to your nightly toolchain in the "Custom Toolchain Path" field.
48
+
49
+
@Image(source: "nova-icarus-configuration", alt: "A screenshot of the Icarus extension settings in Nova with \"Custom\" selected.")
50
+
51
+
> Note: This path should end in `.xctoolchain`.
52
+
53
+
### Make the Playdate module available
54
+
55
+
Icarus uses the `Playdate.swiftmodule` built by SwiftPM to drive autocomplete and other editor integration. In order for this to work properly, you must first manually perform a release build in the example directory.
56
+
57
+
```console
58
+
$ cd$REPO_ROOT/Example/Life
59
+
$ TOOLCHAINS="org.swift.59202312211a" swift build -c release
60
+
```
61
+
62
+
Lastly, we need to create a debug symlink the release build directory.
> Why is this needed? By default SourceKit-LSP looks for a debug build, but can be configured to use a release build. Unfortunately, Icarus does not yet allow us to pass custom SourceKit-LSP options, so we trick SourceKit-LSP into working by pretending our release build is a debug build.
70
+
71
+
### Perform a Build
42
72
43
73
The examples included in this repository have been preconfigured with Panic's Playdate extension for Nova found under each example's `.nova` directory.
44
74
@@ -48,9 +78,32 @@ Open an example directory with Nova and select the Run icon in the toolbar or pr
48
78
49
79
> Note: Learn more about [Nova](https://nova.app)
50
80
51
-
### Build with VSCode
81
+
## Build with VSCode
82
+
83
+
Prerequisites: Install VSCode and the Swift extension.
84
+
85
+
### Configure the Swift extension
86
+
87
+
Configure the VSCode Swift extension to use a Swift nightly toolchain. See <doc:DownloadingTheTools> for instructions on how to install a nightly toolchain.
88
+
89
+
Under the Swift Settings, select the "Swift: Path" option and provide a full path to the `usr/bin` folder inside your nightly toolchain.
90
+
91
+
@Image(source: "vscode-swift-path-configuration", alt: "A screenshot of VSCode Swift extension with the \"Swift: Path\" option set to \"/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-07-a.xctoolchain/usr/bin\".")
92
+
93
+
Under the Swift Settings, select the "Swift > Sourcekit-LSP: Server Arguments" option and pass the arguments `['--configuration', 'release']`.
94
+
95
+
@Image(source: "vscode-sourcekit-lsp-configuration", alt: "A screenshot of VSCode Swift extension with the \"Swift > Sourcekit-LSP: Server Arguments\" option set to \"['--configuration', 'release']\".")
96
+
97
+
### Make the Playdate module available
52
98
53
-
> Prerequisites: Install VSCode and the Swift extension.
99
+
The Swift extension uses the `Playdate.swiftmodule` built by SwiftPM to drive autocomplete and other editor integration. In order for this to work properly, you must first manually perform a release build in the example directory.
100
+
101
+
```console
102
+
$ cd$REPO_ROOT/Example/Life
103
+
$ TOOLCHAINS="org.swift.59202312211a" swift build -c release
104
+
```
105
+
106
+
### Perform a Build
54
107
55
108
The examples included in this repository have been preconfigured with VSCode `tasks.json` files found under each example's `.vscode` directory.
56
109
@@ -60,7 +113,7 @@ Open an example directory with VSCode and select the Terminal > Run Build Task m
60
113
61
114
> Note: Learn more about [VSCode](https://code.visualstudio.com)
62
115
63
-
###Build with Swift Package Manager
116
+
## Build with Swift Package Manager
64
117
65
118
To build an example with swift package manager, enter the example’s directory, set the TOOLCHAINS environment variable to the name of your Swift nightly toolchain, and run `swift build` in release mode.
66
119
@@ -73,10 +126,9 @@ After a successful build, the `.build/release` directory will contain object fil
73
126
74
127
> Note: Learn more about [Swift Package Manager](https://www.swift.org/package-manager/)
75
128
76
-
###Build with Xcode
129
+
## Build with Xcode
77
130
78
-
> IMPORTANT:
79
-
> Xcode 15.3+ is required to run the examples in Xcode.
131
+
> Important: Xcode 15.3+ is required to run the examples in Xcode.
80
132
81
133
Open an example's `Package.swift` with Xcode via the command line or the Xcode graphical interface.
82
134
@@ -85,11 +137,14 @@ $ cd Examples/Life
85
137
$ open Package.swift
86
138
```
87
139
140
+
### Configure the Toolchain
141
+
88
142
Select your Swift nightly toolchain from the Xcode > Toolchains menu item.
89
143
90
144
@Image(source: "xcode-toolchain-selection", alt: "A screenshot of the Xcode toolchain selection menu with a recent Swift nightly toolchain selected and highlighted.")
91
145
146
+
### Perform a Build
147
+
92
148
Select the Run icon in the toolbar or press Cmd+R on your keyboard to start a build. This will first build the example for the host machine using `xcbuild`. After a successful initial build, Xcode will automatically build again with `make` then open the Simulator with the newly built game.
93
149
94
-
> Note:
95
-
> Learn more about [Xcode](https://developer.apple.com/xcode/)
150
+
> Note: Learn more about [Xcode](https://developer.apple.com/xcode/)
0 commit comments