How to access Podfile variable from podspect

14 Views Asked by At

I'm writing a React Native library, and for iOS, my lib depends on a third party lib with a default version, and I want to let user to be able to customize (override) the default version of the third party lib by specify their own version from Podfile.

Example:

my-lib.podspec:

Pod::Spec.new do |s|
  s.name         = "react-native-my-lib"
  s.version      = package["version"]
 
  s.dependency 'third-party-lib', '~> 6.0'

  # other configs
  end    
end

And root project Podfile (user project):

target 'MyAppExample' do
  thirdPartyVersion = '7.0'
  # find react-native-my-lib and install third-party-lib version 7.0 instead of 6.0
end

Is this possible?

Thank you

0

There are 0 best solutions below