Skip to content

Commit

Permalink
Add Distribution copy to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
markst committed Jun 5, 2024
1 parent 5827ea1 commit 6cc58a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,24 @@ playbook_configuration:
- `imports` - Additional imports for the generated Playbook/Tests. Optional parameter.
- `testable_imports` - Additional `@testable` imports for the generated Playbook/Tests. Optional parameter.

## Distribution

When preparing for distribution, you may want to exclude your `PreviewProvider` and mock data from release builds. This can be achieved by wrapping them in `#if DEBUG` compiler directives. Alternatively, you can pass a compiler flag to exclude `PreviewModels` from release builds.

To exclude `PreviewModels` using Swift Package Manager, pass the `NO_PLAYBOOK` swift setting in the package that links `PrefirePlaybookPlugin`:

```swift
swiftSettings: [
.define("NO_PLAYBOOK", .when(configuration: .release)),
]
```

If you are using Xcode, you can pass the compiler flag in the Xcode build settings:

```
SWIFT_ACTIVE_COMPILATION_CONDITIONS = NO_PLAYBOOK;
```

## Requirements

- Swift 5.6 or higher
Expand Down

0 comments on commit 6cc58a9

Please sign in to comment.