Skip to content

Commit

Permalink
Explicit extension safety flag (#866)
Browse files Browse the repository at this point in the history
This explicitly declares that ReactiveSwift only uses extension safe APIs (and/or APIs in an extension-safe way).
The code was already extension safe; this just forward declares it and enforces it at compile time.

If I can enforce this here, then I can enforce it in [Workflow](https://github.com/square/Workflow-swift) which is heavily dependent on this library.
Without this explicit conformance, it is not straightforward to write CI validation that these libraries remain extension safe.

There is zero harm in explicit conformance. Non-extension applications can call into extension-safe libraries without any restrictions.

#### Checklist
- [x] Updated CHANGELOG.md.
  • Loading branch information
lickel committed Jan 5, 2023
1 parent f3fc99a commit 618b802
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*Please add new entries at the top.*

1. Bumped deployment target to iOS 11, tvOS 11, watchOS 4, macOS 10.13, per Xcode 14 warnings
1. Explicitly declare `APPLICATION_EXTENSION_API_ONLY` for CocoaPods

# 7.1.0
1. Add CI Release jobs on tag push (#862, kudos to @p4checo)
Expand Down
5 changes: 4 additions & 1 deletion ReactiveSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Pod::Spec.new do |s|
# Directory glob for all Swift files
s.source_files = ["Sources/*.{swift}", "Sources/**/*.{swift}"]

s.pod_target_xcconfig = {"OTHER_SWIFT_FLAGS[config=Release]" => "$(inherited) -suppress-warnings" }
s.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'YES',
"OTHER_SWIFT_FLAGS[config=Release]" => "$(inherited) -suppress-warnings"
}

s.cocoapods_version = ">= 1.7.0"
s.swift_versions = ["5.2", "5.3" "5.4", "5.5", "5.6", "5.7"]
Expand Down

0 comments on commit 618b802

Please sign in to comment.