Skip to content

Commit d90ec7b

Browse files
committed
Update recipe for Xcode 16.3 (16E140)
1 parent d57afdf commit d90ec7b

File tree

6 files changed

+149
-162
lines changed

6 files changed

+149
-162
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Use this template as a starting point for any Swift 6 module that you want other people to include in their projects.
44

5-
**STATUS: This template is ready and works in production code, compatible with Xcode Version 16.0 (16A242d)**
5+
**STATUS: This template is ready and works in production code, compatible with Xcode version 16.3 (16E140)**
66

77
![Swift 5 Module directory layout](https://github.com/fulldecent/swift5-module-template/assets/382183/1a7965f0-af84-4d00-9bb6-97db76e6e715)
88

@@ -51,7 +51,7 @@ graph LR
5151
end
5252
T --> C
5353
subgraph End users of this project
54-
C[Run ./configure.rb] --> M[Use your own module]
54+
C[Run ./configure.swift] --> M[Use your own module]
5555
end
5656
```
5757

Recipe.md

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,38 @@ Please follow along and you should create a template that is identical to the on
66

77
This recipe may also be useful for other scenarios, for example maybe you want to make a project that has the Example app using storyboards instead of SwiftUI.
88

9-
109
## Ingredients
1110

12-
During the steps of this recipe we enter specific values where needed. These are chosen carefully so that the `./configure.rb` script can later find and replace these values in the template to create your project.
11+
During the steps of this recipe we enter specific values where needed. These are chosen carefully so that the `./configure.swift` script can later find and replace these values in the template to create your project.
1312

1413
Some variables have spaces in them. That is intentional because Xcode only uses robust quoting in its project configuration files (which we want) if the variables have spaces in them.
1514

16-
- `xxPROJECTxNAMExx`
17-
- This must be a valid C99 extended identifier (otherwise the Xcode check dependencies step fails). It cannot contain spaces.
18-
- This must also be a Uniform Target Identifier (``/^[a-zA-Z0-9-.]+$/``).
19-
- If this contains the characters `-` or `.` then they will be transliterated to `_` for file names.
15+
- `xxPROJECTxNAMExx`
16+
- This must be a valid C99 extended identifier (otherwise the Xcode check dependencies step fails). It cannot contain spaces.
17+
- This must also be a Uniform Target Identifier (``/^[a-zA-Z0-9-.]+$/``).
18+
- If this contains the characters `-` or `.` then they will be transliterated to `_` for file names.
2019

21-
- `__ORGANIZATION NAME__`
22-
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
23-
24-
- `com.AN.ORGANIZATION.IDENTIFIER`
20+
- `__ORGANIZATION NAME__`
21+
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
2522

26-
- `__AUTHOR NAME__`
27-
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
23+
- `com.AN.ORGANIZATION.IDENTIFIER`
2824

29-
- `__TODAYS_DATE__`
25+
- `__AUTHOR NAME__`
26+
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
3027

31-
- `__TODAYS_YEAR__`
28+
- `__TODAYS_DATE__`
3229

33-
- `__GITHUB_USERNAME__`
30+
- `__TODAYS_YEAR__`
3431

32+
- `__GITHUB_USERNAME__`
3533

3634
## Steps
3735

3836
Complete all these instructions on the same calendar day.
3937

40-
Use Xcode Version 16.0 (16A242d). *This is the latest publicly released or Gold Master version.*
38+
Use Xcode version 16.3 (16E140). *This is the latest publicly released or Gold Master version.*
4139

42-
A previous version of this recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtNn8lhE (15 minutes).
40+
A previous version of this recipe is also demonstrated in a YouTube flyover at <https://youtu.be/ksYXtNn8lhE> (15 minutes).
4341

4442
### I. Create a package for your module
4543

@@ -51,7 +49,6 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
5149
5. Ensure "Create Git repository on my Mac" is unchecked
5250
6. Click “Create"
5351

54-
5552
### II. Add some functionality to the module
5653

5754
1. Use Terminal.app to insert some files into the project
@@ -73,9 +70,10 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
7370
3. Set Organization Identifier to `com.AN.ORGANIZATION.IDENTIFIER`
7471
4. Set User Interface to "SwiftUI"
7572
5. Set Language to "Swift"
76-
6. Set Storage to "None"
77-
7. Ensure "Include Tests" is not selected
78-
8. Click “Next"
73+
6. Set Testing System to "Swift Testing with XCTest UI Tests"
74+
7. Set Storage to "None"
75+
8. Ensure "Host in CloudKit" is not selected
76+
9. Click “Next"
7977
3. *Create the project*
8078
1. Ensure “Create Git Repository on my Mac" is not selected
8179
2. Ensure "Add to" is “Don’t add to any project or workspace"
@@ -85,17 +83,17 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
8583
### IV. Use the directory layout structure like Alamofire
8684

8785
1. *Move Example source code to a folder named "Sources"*
88-
1. Open the file Example.xcodeproj in Xcode
86+
:information_source: The Alamofire project uses [the folder name "Source"](https://github.com/Alamofire/Alamofire/tree/master/Example/Source) but we choose "Sources" here to be consistent with [the default of Swift Package Manager](https://github.com/swiftlang/swift-package-manager/blob/451196234d81f82a147293105fd4467cdd69b6ac/Sources/Workspace/InitPackage.swift#L570C48-L570C50).
87+
88+
1. Open the file Example.xcodeproj in Xcode (it's on your desktop, in the xxPROJECTxNAMExx > Example folder)
89+
90+
:information_source: You will see "Cannot preview in this file", but we resolve this in the step "Make your Example application depend on your module" below.
91+
8992
2. Show the Project navigator on the left (folder icon)
93+
9094
3. Use the Project navigator to select the "Example" folder (blue icon)
95+
9196
4. From the Project navigator, rename this folder as "Sources"
92-
* :information_source: The Alamofire project uses [the folder name "Source"](https://github.com/Alamofire/Alamofire/tree/master/Example/Source) but we choose "Sources" here to be consistent with [the default of Swift Package Manager](https://github.com/swiftlang/swift-package-manager/blob/dd22b6ef16315fcdcb07c1f86bd608598f102e20/Sources/Workspace/InitPackage.swift#L566)
93-
2. *Fix the Info.plist file configuration and preview content folder (Xcode makes renaming folders a pain)*
94-
1. Click "Example" on the left (the blue app icon)
95-
2. In the middle area, click the target "Example" (gray app icon)
96-
3. Click "Build Settings" on the top of the middle
97-
6. Enter "Development Assets" in the search box
98-
7. In the "Deployment" section, edit the value from “Example/Preview Content” to "Sources/Preview Content"
9997

10098
### V. Add some functionality to your Example application
10199

@@ -109,12 +107,12 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
109107
### VI. Make your Example application depend on your module
110108

111109
1. Open Example.xcodeproj in Xcode
112-
3. In Xcode, choose File > Add Package Dependencies...
110+
2. In Xcode, choose File > Add Package Dependencies...
113111
1. Click "Add Local..."
114-
2. Select the `xxPROJECTxNAMExx` folder on your desktop
112+
2. Select the folder `xxPROJECTxNAMExx` on the desktop (don't double click it)
115113
3. Click "Add Package"
116114
4. In the choose package products, set the "add to target" to "Example", and click "Add Package"
117-
115+
3. In Xcode, choose File > Packages > Reset Package Caches
118116

119117
### VII. Add additional project management files to the module
120118

@@ -155,17 +153,17 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
155153

156154
3. Choose Product > Run
157155

158-
* :white_check_mark: You should see a big white king (♔) after a few moments. That means it worked!
159-
156+
- :white_check_mark: You should see a big white king (♔) after a few moments. That means it worked!
157+
160158
4. *Compare with the distributed Swift 6 Module Template repository*
161159

162-
1. Use Terminal.app to clone the repository to your Developer folder
160+
1. Use Terminal.app to clone the repository to your Developer folder
163161

164162
```sh
165163
git clone https://github.com/fulldecent/swift6-module-template.git ~/Developer/swift6-module-template
166164
```
167165

168-
2. Compare the distributed version with your version
166+
2. Compare the distributed version with your version
169167

170168
```sh
171169
cd ~/Developer/swift6-module-template
@@ -174,6 +172,5 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
174172
git diff
175173
```
176174

177-
* :white_check_mark: You should see an empty screen indicating no differences (press <kbd>q</kbd> to close)
178-
* :mega: If you see differences, please raise an issue in the project repository
179-
175+
- :white_check_mark: You should see an empty screen indicating no differences (press <kbd>q</kbd> to close)
176+
- :mega: If you see differences, please raise an issue in the project repository

0 commit comments

Comments
 (0)