Skip to content

Commit 730b7c0

Browse files
authored
Update README.md
1 parent d7a89d0 commit 730b7c0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,30 @@ _Screenshot of the Build Phase can be found [here](Documentation/Images/BuildPha
135135
_Tip:_ Add the `*.generated.swift` pattern to your `.gitignore` file to prevent unnecessary conflicts.
136136
</details>
137137

138+
139+
<details>
140+
<summary><h3>Mint</h3></summary>
141+
142+
0. Add the [R.swift](https://github.com/mac-cain13/R.swift) library to your project
143+
1. Add `mac-cain13/R.swift` to your [Mintfile](https://github.com/yonaskolb/Mint#mintfile) and run `mint bootstrap` to install this package without linking it globally (recommended)
144+
2. In Xcode: Click on your project in the file list, choose your target under `TARGETS`, click the `Build Phases` tab and add a `New Run Script Phase` by clicking the little plus icon in the top left
145+
3. Drag the new `Run Script` phase **above** the `Compile Sources` phase, expand it and paste the following script:
146+
```bash
147+
if mint list | grep -q 'R.swift'; then
148+
mint run R.swiftt@v7.0.1 rswift generate "$SRCROOT/R.generated.swift"
149+
else
150+
echo "error: R.swift not installed; run 'mint bootstrap' to install"
151+
return -1
152+
fi
153+
```
154+
4. Add `$SRCROOT/R.generated.swift` to the "Output Files" of the Build Phase
155+
5. Uncheck "Based on dependency analysis" so that R.swift is run on each build
156+
6. Build your project, in Finder you will now see a `R.generated.swift` in the `$SRCROOT`-folder, drag the `R.generated.swift` files into your project and **uncheck** `Copy items if needed`
157+
158+
_Tip:_ Add the `*.generated.swift` pattern to your `.gitignore` file to prevent unnecessary conflicts.
159+
</details>
160+
161+
138162
<details>
139163
<summary><h3>Homebrew</h3></summary>
140164

0 commit comments

Comments
 (0)