Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,29 @@ jobs:
working-directory: ./example
run: |
yarn build:ios

build-ios-spm:
# Experimental: smoke-test the opt-in Swift Package Manager integration
# (FREERASP_USE_SPM=1). Non-blocking while SPM support is experimental; the
# vendored build-ios job above remains the gating check.
runs-on: macos-latest
needs: build-library
continue-on-error: true
env:
FREERASP_USE_SPM: "1"
USE_FRAMEWORKS: dynamic
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup
uses: ./.github/actions/setup

- name: Install pods (SPM)
working-directory: ./example/ios
run: pod install

- name: Build example for iOS (SPM)
working-directory: ./example
run: |
yarn build:ios
4 changes: 4 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ require Pod::Executable.execute_command('node', ['-p',
platform :ios, min_ios_version_supported
prepare_react_native_project!

# To test the experimental Swift Package Manager integration of freerasp-react-native,
# install with the SPM opt-in flag and dynamic frameworks:
# FREERASP_USE_SPM=1 USE_FRAMEWORKS=dynamic pod install
# Without these flags the default vendored xcframework is used.
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
Expand Down
42 changes: 34 additions & 8 deletions freerasp-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,40 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/talsec/freerasp-react-native.git", :tag => "#{s.version}" }

s.source_files = 'ios/models/*.{h,m,mm,swift}',
'ios/utils/*.{h,m,mm,swift}',
'ios/dispatchers/*.{h,m,mm,swift}',
'ios/*.{h,m,mm,swift}',
'ios/TalsecRuntime.xcframework'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework TalsecRuntime' }
s.ios.vendored_frameworks = "ios/TalsecRuntime.xcframework"

# Opt-in Swift Package Manager integration for the TalsecRuntime dependency.
# Enabled only when FREERASP_USE_SPM=1 AND the running React Native provides the
# spm_dependency helper (RN >= 0.75). Otherwise the vendored xcframework is used
# (default — no breaking change for existing consumers). The SPM path additionally
# requires USE_FRAMEWORKS=dynamic in the consumer Podfile and iOS 13+.
use_spm = ENV['FREERASP_USE_SPM'] == '1' && respond_to?(:spm_dependency, true)

source_globs = [
'ios/models/*.{h,m,mm,swift}',
'ios/utils/*.{h,m,mm,swift}',
'ios/dispatchers/*.{h,m,mm,swift}',
'ios/*.{h,m,mm,swift}',
]

if use_spm
# TalsecRuntime is resolved via Swift Package Manager (talsec/Free-RASP-iOS).
# spm_dependency injects an SPM reference into the Pods-generated Xcode project.
# NOTE: the vendored xcframework is intentionally NOT linked here to avoid
# duplicate symbols.
s.ios.deployment_target = '13.0'
spm_dependency(s,
url: 'https://github.com/talsec/Free-RASP-iOS',
requirement: { kind: 'upToNextMajorVersion', minimumVersion: '6.14.5' },
products: ['TalsecRuntime']
)
else
# TalsecRuntime is provided by the vendored xcframework (default).
source_globs << 'ios/TalsecRuntime.xcframework'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework TalsecRuntime' }
s.ios.vendored_frameworks = 'ios/TalsecRuntime.xcframework'
end

s.source_files = source_globs

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
if respond_to?(:install_modules_dependencies, true)
Expand Down
Loading