Skip to content

Commit 02d6982

Browse files
committed
chore(iOS): exclude gamma project files from end-user builds (#195)
## Description This PR excludes gamma project files from user builds. To enable gamma project for local development you must set `RNS_GAMMA_ENABLED=1` environment variable. I plan to add `.envrc` file that will set this automatically for us, but it will be done in separate PR. ## Changes <details> <summary>Commits</summary> </details> ## Test code and steps to reproduce `FabricExample` & `Example` should build with `RNS_GAMMA_ENABLED` set to 1 or 0. ## Checklist - [ ] Ensured that CI passes
1 parent fc9ea1e commit 02d6982

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

RNScreens.podspec

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@ require "json"
22

33
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
44

5+
gamma_project_enabled = ENV['RNS_GAMMA_ENABLED'] == '1'
56
new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
7+
8+
source_files_exts = new_arch_enabled ? '{h,m,mm,cpp,swift}' : '{h,m,mm,swift}'
9+
source_files = ["ios/**/*.#{source_files_exts}"]
10+
11+
if !new_arch_enabled
12+
source_files.push("cpp/RNScreensTurboModule.cpp", "cpp/RNScreensTurboModule.h")
13+
end
14+
615
min_supported_ios_version = new_arch_enabled ? "15.1" : "15.1"
716
min_supported_tvos_version = "15.1"
817
min_supported_visionos_version = "1.0"
9-
source_files = new_arch_enabled ? 'ios/**/*.{h,m,mm,cpp,swift}' : ["ios/**/*.{h,m,mm,swift}", "cpp/RNScreensTurboModule.cpp", "cpp/RNScreensTurboModule.h"]
1018

1119
Pod::Spec.new do |s|
1220
s.name = "RNScreens"
@@ -21,9 +29,15 @@ Pod::Spec.new do |s|
2129
s.platforms = { :ios => min_supported_ios_version, :tvos => min_supported_tvos_version, :visionos => min_supported_visionos_version }
2230
s.source = { :git => "https://github.com/software-mansion/react-native-screens.git", :tag => "#{s.version}" }
2331
s.source_files = source_files
24-
s.project_header_files = "ios/gamma/bridging/Swift-Bridging.h"
32+
s.project_header_files = "ios/bridging/Swift-Bridging.h"
2533
s.requires_arc = true
2634

35+
if !gamma_project_enabled
36+
s.exclude_files = "ios/gamma/**/*.#{source_files_exts}"
37+
else
38+
Pod::UI.puts "[RNScreens] Gamma project enabled. Including source files."
39+
end
40+
2741
s.pod_target_xcconfig = {
2842
'DEFINES_MODULE' => 'YES'
2943
}
File renamed without changes.

0 commit comments

Comments
 (0)