mirror of
https://github.com/status-im/react-native-config.git
synced 2026-09-01 15:11:08 +00:00
Add subspec for iOS extensions without React (#471)
* Add subspec for iOS extensions without React * hard code script_phase to Extension subspec
This commit is contained in:
@@ -28,8 +28,28 @@ HOST_PATH="$SRCROOT/../.."
|
||||
input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb']
|
||||
}
|
||||
|
||||
s.source_files = 'ios/**/*.{h,m}'
|
||||
s.requires_arc = true
|
||||
s.default_subspec = 'App'
|
||||
|
||||
s.subspec 'App' do |app|
|
||||
app.source_files = 'ios/**/*.{h,m}'
|
||||
app.dependency 'React'
|
||||
end
|
||||
|
||||
# Use this subspec for iOS extensions that cannot use React dependency
|
||||
s.subspec 'Extension' do |ext|
|
||||
# Had to duplicate the script_phase since it wasn't being passed down. Not sure why
|
||||
ext.script_phase = {
|
||||
name: 'Config codegen',
|
||||
script: %(
|
||||
set -ex
|
||||
HOST_PATH="$SRCROOT/../.."
|
||||
"${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig/BuildDotenvConfig.rb" "$HOST_PATH" "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig"
|
||||
),
|
||||
execution_position: :before_compile,
|
||||
input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb']
|
||||
}
|
||||
ext.source_files = ['ios/**/ReactNativeConfig.{h,m}', 'ios/**/GeneratedDotEnv.m']
|
||||
end
|
||||
|
||||
s.dependency 'React'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user