Skip to content

Commit

Permalink
Allow to customize used framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas committed Jun 29, 2020
1 parent a3b97a4 commit 62e41f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions react-native-mapbox-gl.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))


REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION = ENV["REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION"] || '~> 5.8'

Pod::Spec.new do |s|
s.name = "react-native-mapbox-gl"
s.summary = "React Native Component for Mapbox GL"
Expand All @@ -12,7 +15,7 @@ Pod::Spec.new do |s|
s.license = "MIT"
s.platform = :ios, "8.0"

s.dependency 'Mapbox-iOS-SDK', '~> 5.8'
s.dependency 'Mapbox-iOS-SDK', REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION
s.dependency 'React'

s.subspec 'DynamicLibrary' do |sp|
Expand All @@ -23,7 +26,7 @@ Pod::Spec.new do |s|
s.default_subspecs= ['DynamicLibrary']
else
s.subspec 'StaticLibraryFixer' do |sp|
s.dependency '@react-native-mapbox-gl-mapbox-static', '~> 5.8'
s.dependency '@react-native-mapbox-gl-mapbox-static', REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION
end

s.default_subspecs= ['DynamicLibrary', 'StaticLibraryFixer']
Expand Down
2 changes: 1 addition & 1 deletion scripts/autogenerate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function readIosVersion() {
'react-native-mapbox-gl.podspec',
);
const lines = fs.readFileSync(podspecPath, 'utf8').split('\n');
const mapboxLineRegex = /^\s+s\.dependency\s+'Mapbox-iOS-SDK', '~>\s+(\d+\.\d+)'$/;
const mapboxLineRegex = /^REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION\s*=\s*.+'~>\s+(\d+\.\d+)'$/;
const mapboxLine = lines.filter(i => mapboxLineRegex.exec(i))[0];
return `${mapboxLineRegex.exec(mapboxLine)[1]}.0`;
}
Expand Down

0 comments on commit 62e41f7

Please sign in to comment.