Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Sources/SPIManifest/Documentation.docc/CommonUseCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ builder:

There is also a `target:` key in order to configure a specific target instead of a scheme, where applicable.

### Implementing custom package logic with SPI_PROCESSING

When the Swift Package Index processes your package, you’ll find the `SPI_PROCESSING` environment variable set during two key processes:

- **Analysis**: Swift Package Index extracts package metadata by running `swift package dump-package`. Packages _must_ pass analysis to be included in the index.
- **Compatibility builds**: Swift Package Index runs either `swift build` or `xcodebuild` to determine Swift version and platform compatibility.

See the [swift-java](https://swiftpackageindex.com/swiftlang/swift-java) package for an example of a package using this feature, where the authors [bypass a JDK requirement](https://github.com/swiftlang/swift-java/blob/a3791cf7c94146a34f96fd9ad53efef9d58c2a1b/Package.swift#L35) during analysis. Without this exception, the Swift Package Index analysis machines couldn’t successfully run `swift package dump-package`.

## Images for Linux

Expand Down
Loading