Skip to content

Commit

Permalink
fix(sample): Fix bare sample Pods to work with dynamic frameworks (#3767
Browse files Browse the repository at this point in the history
)
  • Loading branch information
krystofwoldrich committed Apr 22, 2024
1 parent d20a569 commit 91c93bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/sample-application.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
access_token: ${{ github.token }}

build:
name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}}
runs-on: ${{ matrix.runs-on }}
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
Expand All @@ -39,6 +39,7 @@ jobs:
fail-fast: false
matrix:
rn-architecture: ['legacy', 'new']
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
platform: ['android', 'ios']
build-type: ['dev', 'production']
include:
Expand All @@ -48,6 +49,11 @@ jobs:
device: 'iPhone 14'
- platform: android
runs-on: ubuntu-latest
exclude:
- platform: 'android'
ios-use-frameworks: 'dynamic-frameworks'
- rn-architecture: 'new'
ios-use-frameworks: 'dynamic-frameworks'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -95,6 +101,7 @@ jobs:
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic && export NO_FLIPPER=1
echo "ENABLE_PROD=$ENABLE_PROD"
echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH bundle exec pod install
Expand Down Expand Up @@ -135,5 +142,5 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-logs
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
path: samples/react-native/ios/*.log
11 changes: 11 additions & 0 deletions samples/react-native/ios/Podfile
Expand Up @@ -21,6 +21,17 @@ linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
pre_install do |installer|
installer.pod_targets.each do |pod|
# RNScreens and RNReanimated don't work when dynamically linked
# Fix from https://github.com/software-mansion/react-native-screens/issues/1963#issuecomment-1848246731
if pod.name.eql?('RNReanimated') || pod.name.eql?('RNScreens')
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
end

target 'sentryreactnativesample' do
Expand Down

0 comments on commit 91c93bd

Please sign in to comment.