Skip to content

Commit 29ca432

Browse files
committed
[Docs] Explain how to enable plugins in Xcode and Xcode Cloud
1 parent 58a276a commit 29ca432

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Sources/swift-openapi-generator/Documentation.docc/Articles/Frequently-asked-questions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,23 @@ For Xcode projects, make sure the target that uses the Swift OpenAPI Generator b
7171
Alternatively, change the access modifier of the generated code to either `internal` (if no code outside of that module needs to use it) or `public` (if the generated code is exported to other modules and packages.) You can do so by setting `accessModifier: internal` in the generator configuration file, or by providing `--access-modifier internal` to the `swift-openapi-generator` CLI.
7272

7373
For details, check out <doc:Configuring-the-generator>.
74+
75+
### How do I enable the build plugin in Xcode and Xcode Cloud?
76+
77+
By default, build plugins must be explicitly enabled by the adopter.
78+
79+
In Xcode, the first time you add a build plugin as a dependency of your project or package, the build fails and requires you to enable the plugin.
80+
81+
In Xcode Cloud, you might encounter the error _"OpenAPIGenerator" is disabled_, caused by the fact that build plugins must also be enabled explicitly when run in automation.
82+
83+
One way to enable build plugins in Xcode Cloud is by adding the script `ci_scripts/ci_post_clone.sh` next to your Xcode project or workspace, containing:
84+
85+
```bash
86+
#!/usr/bin/env bash
87+
88+
set -e
89+
90+
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
91+
```
92+
93+
Learn more about Xcode Cloud custom scripts in the [documentation](https://developer.apple.com/documentation/xcode/writing-custom-build-scripts).

0 commit comments

Comments
 (0)