|
| 1 | +require "json" |
| 2 | + |
| 3 | +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) |
| 4 | +corePackage = JSON.parse(File.read(File.join(__dir__, "..", "core", "package.json"))) |
| 5 | +sdk_version = corePackage['sdkVersions']['ios']['core'] |
| 6 | + |
| 7 | +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' |
| 8 | + |
| 9 | +Pod::Spec.new do |s| |
| 10 | + s.name = "RNCKakaoCore" |
| 11 | + s.version = package["version"] |
| 12 | + s.summary = package["description"] |
| 13 | + s.homepage = package["homepage"] |
| 14 | + s.license = package["license"] |
| 15 | + s.authors = package["author"] |
| 16 | + |
| 17 | + s.platforms = { :ios => min_ios_version_supported } |
| 18 | + s.source = { :git => "https://github.com/mj-studio-library/react-native-kakao.git", :tag => "#{s.version}" } |
| 19 | + |
| 20 | + s.source_files = "ios/**/*.{h,m,mm}" |
| 21 | + |
| 22 | + # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. |
| 23 | + # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. |
| 24 | + if respond_to?(:install_modules_dependencies, true) |
| 25 | + install_modules_dependencies(s) |
| 26 | + else |
| 27 | + s.dependency "React-Core" |
| 28 | + |
| 29 | + # Don't install the dependencies when we run `pod install` in the old architecture. |
| 30 | + if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then |
| 31 | + s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" |
| 32 | + s.pod_target_xcconfig = { |
| 33 | + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", |
| 34 | + "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1", |
| 35 | + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" |
| 36 | + } |
| 37 | + s.dependency "React-Codegen" |
| 38 | + s.dependency "RCT-Folly" |
| 39 | + s.dependency "RCTRequired" |
| 40 | + s.dependency "RCTTypeSafety" |
| 41 | + s.dependency "ReactCommon/turbomodule/core" |
| 42 | + end |
| 43 | + end |
| 44 | + |
| 45 | + # Override Version by User |
| 46 | + if defined?($KakaoCoreSDKVersion) |
| 47 | + Pod::UI.puts "#{s.name}: Using user specified Firebase SDK version '#{$KakaoCoreSDKVersion}'" |
| 48 | + sdk_version = $KakaoCoreSDKVersion |
| 49 | + end |
| 50 | + |
| 51 | + # Kakao dependencies |
| 52 | + s.dependency 'KakaoSDKCommon', sdk_version |
| 53 | +end |
0 commit comments