mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	support to Expo (#486)
* support to Expo * update * update * update --------- Co-authored-by: Steven <steven@Stevens-MacBook-Pro.local>
This commit is contained in:
		| @@ -19,7 +19,7 @@ Pod::Spec.new do |s| | ||||
|   s.platform = :ios, "8.0" | ||||
|   s.platforms = { :ios => "11.0" } | ||||
|   s.source = { :git => 'https://github.com/reactnativecn/react-native-update.git', :tag => '#{s.version}' } | ||||
|   s.source_files    = "ios/**/*.{h,m,mm,swift}" | ||||
|   s.source_files    = Dir.glob("ios/**/*.{h,m,mm,swift}").reject { |f| f.start_with?("ios/Expo/") } | ||||
|   s.libraries = 'bz2', 'z' | ||||
|   s.vendored_libraries = 'RCTPushy/libRCTPushy.a' | ||||
|   s.pod_target_xcconfig = {  | ||||
| @@ -33,11 +33,25 @@ Pod::Spec.new do |s| | ||||
|   s.dependency "React-Core" | ||||
|   s.dependency 'SSZipArchive' | ||||
|  | ||||
|   project_root = File.expand_path('../../', __dir__) | ||||
|   project_package_json = File.join(project_root, 'package.json') | ||||
|   is_expo_project = false | ||||
|  | ||||
|   if (File.exist?(project_package_json)) | ||||
|     package_json = JSON.parse(File.read(project_package_json)) | ||||
|     has_expo_dependency = package_json['dependencies'] && package_json['dependencies']['expo'] | ||||
|     has_expo_modules_core = Dir.exist?('node_modules/expo-modules-core') | ||||
|     is_expo_project = has_expo_dependency || has_expo_modules_core | ||||
|     if is_expo_project | ||||
|       s.dependency 'ExpoModulesCore' | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   s.subspec 'RCTPushy' do |ss| | ||||
|     ss.source_files = 'ios/RCTPushy/*.{h,m,mm,swift}' | ||||
|     ss.public_header_files = ['ios/RCTPushy/RCTPushy.h'] | ||||
|   end | ||||
|    | ||||
|  | ||||
|   s.subspec 'HDiffPatch' do |ss| | ||||
|     ss.source_files = ['ios/RCTPushy/HDiffPatch/**/*.{h,m,c}', | ||||
|                        'android/jni/hpatch.{h,c}', | ||||
| @@ -47,7 +61,13 @@ Pod::Spec.new do |s| | ||||
|                        'android/jni/lzma/C/Lzma2Dec.{h,c}'] | ||||
|     ss.public_header_files = 'ios/RCTPushy/HDiffPatch/**/*.h' | ||||
|   end | ||||
|    | ||||
|  | ||||
|   if is_expo_project | ||||
|     s.subspec 'Expo' do |ss| | ||||
|       ss.source_files = 'ios/Expo/**/*.{h,m,mm,swift}' | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   if defined?(install_modules_dependencies()) != nil | ||||
|     install_modules_dependencies(s); | ||||
|   else | ||||
| @@ -60,7 +80,6 @@ Pod::Spec.new do |s| | ||||
|           "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", | ||||
|           "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" | ||||
|       } | ||||
|  | ||||
|       s.dependency "React-Codegen" | ||||
|       s.dependency "RCT-Folly" | ||||
|       s.dependency "RCTRequired" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 波仔糕
					波仔糕