Skip to content

Commit 7dd88b2

Browse files
author
Petter Hesselberg
committed
Remove leading ^ in RN version
Add RN version as BuildConfig field
1 parent e9e8b10 commit 7dd88b2

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

android/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ android {
103103
ndk {
104104
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
105105
}
106+
107+
buildConfigField 'String', 'REACT_NATIVE_VERSION', "\"$rootProject.ext.reactNativeVersion\""
106108
}
107109

108110
splits {

android/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ final getReactNativeVersion() {
6565
}
6666

6767
final packageJson = json.parse packageJsonFile
68-
final reactNativeVersion = packageJson.dependencies."react-native"
68+
def reactNativeVersion = packageJson.dependencies."react-native"
6969
if (!reactNativeVersion) {
7070
throw new Exception('No react native version found in package.json dependencies')
7171
}
7272

7373
println "React native version: $reactNativeVersion"
7474

75+
if (reactNativeVersion.startsWith('^')) {
76+
reactNativeVersion = reactNativeVersion.substring(1);
77+
}
78+
7579
return reactNativeVersion
7680
}

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,10 +3589,10 @@ react-is@^16.8.1:
35893589
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
35903590
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
35913591

3592-
3593-
version "0.59.10"
3594-
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.10.tgz#352f381e382f93a0403be499c9e384bf51c2591c"
3595-
integrity sha512-guB9YW+pBqS1dnfZ4ntzjINopiCUAbdmshU2wMWD1W32fRczLAopi/7Q2iHKP8LTCdxuYZV3fa9Mew5PSuANAw==
3592+
3593+
version "0.59.9"
3594+
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.9.tgz#c94ee4fa35121720c05235a2dd6cdd2784bf5177"
3595+
integrity sha512-/+8EgIZwFpYHyyJ7Zav7B6LHNrytwUQ+EKGT/QV7HSrgpf2Y5NZNeUYUHKiVKLYpBip1G32/LcAECQj37YRwGQ==
35963596
dependencies:
35973597
"@babel/runtime" "^7.0.0"
35983598
"@react-native-community/cli" "^1.2.1"
@@ -3666,15 +3666,15 @@ react-transform-hmr@^1.0.4:
36663666
global "^4.3.0"
36673667
react-proxy "^1.1.7"
36683668

3669-
react@^16.8.6:
3670-
version "16.8.6"
3671-
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
3672-
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
3669+
3670+
version "16.8.3"
3671+
resolved "https://registry.yarnpkg.com/react/-/react-16.8.3.tgz#c6f988a2ce895375de216edcfaedd6b9a76451d9"
3672+
integrity sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==
36733673
dependencies:
36743674
loose-envify "^1.1.0"
36753675
object-assign "^4.1.1"
36763676
prop-types "^15.6.2"
3677-
scheduler "^0.13.6"
3677+
scheduler "^0.13.3"
36783678

36793679
read-pkg-up@^2.0.0:
36803680
version "2.0.0"
@@ -3909,7 +3909,7 @@ sax@~1.1.1:
39093909
resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240"
39103910
integrity sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA=
39113911

3912-
scheduler@^0.13.6:
3912+
scheduler@^0.13.3:
39133913
version "0.13.6"
39143914
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
39153915
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==

0 commit comments

Comments
 (0)