Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Aug 16, 2024
1 parent 3a40037 commit b3720a3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ examples/SampleApp/tmp/
index.android.bundle
*.app
*.DSYM.zip
**/metrics/
4 changes: 2 additions & 2 deletions examples/SampleApp/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ GEM
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
fastlane-plugin-load_json (0.0.1)
fastlane-plugin-stream_actions (0.3.59)
fastlane-plugin-stream_actions (0.3.62)
xctest_list (= 1.2.1)
ffi (1.17.0)
fourflusher (2.3.1)
Expand Down Expand Up @@ -320,7 +320,7 @@ DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution
fastlane-plugin-load_json
fastlane-plugin-stream_actions (= 0.3.59)
fastlane-plugin-stream_actions (= 0.3.62)
rubocop-performance
rubocop-require_tools

Expand Down
47 changes: 26 additions & 21 deletions examples/SampleApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bundle_id = 'io.getstream.reactnative.SampleApp'
xcode_project = 'ios/SampleApp.xcodeproj'
xcode_workspace = 'ios/SampleApp.xcworkspace'
template_app_name = 'DemoApp'
react_native_version = '0.74.5'
rn_version = '0.74.5'
@force_check = false
temp_dir = Dir.mktmpdir

Expand Down Expand Up @@ -64,6 +64,7 @@ lane :ios_app_size do |options|
profile_name: "match AdHoc #{bundle_id}"
)

FileUtils.rm_rf("#{ios_project_dir}/Podfile.lock") if File.file?("#{ios_project_dir}/Podfile.lock")
cocoapods(podfile: ios_project_dir, clean_install: true)

gym(
Expand Down Expand Up @@ -166,32 +167,36 @@ end

lane :create_template_project do
Dir.chdir(temp_dir) do
sh("npx @react-native-community/cli@latest init #{template_app_name} --install-pods false --package-name #{bundle_id}")
UI.important("Temp dir path: #{temp_dir} 👀")
sh("npx @react-native-community/cli@latest init #{template_app_name} --version #{rn_version} --install-pods false --package-name #{bundle_id}")
Dir.chdir(template_app_name) { sh("yarn add react-native@#{rn_version}") }
File.absolute_path(template_app_name)
end
end

lane :yarn_sdk do |options|
root_path = File.absolute_path('../../../')
package_path = 'package.json'
podfile_path = 'ios/Podfile'

Dir.chdir("#{root_path}/examples/TypeScriptMessaging") do
['App.tsx', 'useStreamChatTheme.ts', package_path].each { |file| sh("cp #{file} #{options[:path]}") }
end

Dir.chdir("#{root_path}/examples/TypeScriptMessaging") do
[podfile_path].each { |file| sh("cp #{file} #{options[:path]}/ios") }
end

Dir.chdir(options[:path]) do
node_modules = [
# FIXME: "stream-chat-react-native@https://github.com/GetStream/stream-chat-react-native.git##{current_branch}"
'stream-chat-react-native',
'@react-native-community/netinfo',
'@stream-io/flat-list-mvcp',
'add react-native-image-picker',
'react-native-document-picker',
'react-native-fs',
'react-native-gesture-handler',
'react-native-haptic-feedback',
'react-native-haptic-feedback',
'react-native-image-crop-picker',
'react-native-image-resizer',
'react-native-reanimated',
'react-native-safe-area-context',
'react-native-share',
'react-native-svg'
]
sh("yarn add #{node_modules.join(' ')}")
package_content = File.read(package_path)
package_content.gsub!('../..', root_path)
File.write(package_path, package_content)

# podfile_content = File.read(podfile_path)
# podfile_content.gsub!(':path => config[:reactNativePath]', ':flipper_configuration => FlipperConfiguration.disabled, :path => config[:reactNativePath]')
# File.write(podfile_path, podfile_content)

sh('yarn')
end
end

Expand Down
2 changes: 1 addition & 1 deletion examples/SampleApp/fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

gem 'fastlane-plugin-firebase_app_distribution'
gem 'fastlane-plugin-load_json'
gem 'fastlane-plugin-stream_actions', '0.3.59'
gem 'fastlane-plugin-stream_actions', '0.3.62'

0 comments on commit b3720a3

Please sign in to comment.