Skip to content

Commit ba608a2

Browse files
dulmandakhfacebook-github-bot
authored andcommittedSep 13, 2018
Consolidate native dependencies versions (#20742)
Summary: This PR tries to consolidate Android native dependencies versions to make it less error prone to version bumps. Pull Request resolved: #20742 Differential Revision: D9818155 Pulled By: hramos fbshipit-source-id: 9bf631640910edad5731014f4e23dbca45af2b59
1 parent 644fc57 commit ba608a2

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed
 

‎ReactAndroid/build.gradle

+19-18
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
// This source code is licensed under the MIT license found in the
44
// LICENSE file in the root directory of this source tree.
55

6-
apply plugin: 'com.android.library'
7-
apply plugin: 'maven'
8-
9-
apply plugin: 'de.undercouch.download'
6+
plugins {
7+
id("com.android.library")
8+
id("maven")
9+
id("de.undercouch.download")
10+
}
1011

1112
import de.undercouch.gradle.tasks.download.Download
1213
import org.apache.tools.ant.taskdefs.condition.Os
@@ -39,68 +40,68 @@ task createNativeDepsDirectories {
3940
}
4041

4142
task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
42-
src 'https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz'
43+
src "https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz"
4344
onlyIfNewer true
4445
overwrite false
45-
dest new File(downloadsDir, 'boost_1_63_0.tar.gz')
46+
dest new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz")
4647
}
4748

4849
task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
4950
from boostPath ?: tarTree(resources.gzip(downloadBoost.dest))
5051
from 'src/main/jni/third-party/boost/Android.mk'
51-
include 'Android.mk', 'boost_1_63_0/boost/**/*.hpp', 'boost/boost/**/*.hpp'
52+
include 'Android.mk', "boost_${BOOST_VERSION}/boost/**/*.hpp", 'boost/boost/**/*.hpp'
5253
includeEmptyDirs = false
5354
into "$thirdPartyNdkDir/boost"
5455
doLast {
55-
file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_1_63_0")
56+
file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_${BOOST_VERSION}")
5657
}
5758
}
5859

5960
task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {
60-
src 'https://github.com/google/double-conversion/archive/v1.1.6.tar.gz'
61+
src "https://github.com/google/double-conversion/archive/v${DOUBLE_CONVERSION_VERSION}.tar.gz"
6162
onlyIfNewer true
6263
overwrite false
63-
dest new File(downloadsDir, 'double-conversion-1.1.6.tar.gz')
64+
dest new File(downloadsDir, "double-conversion-${DOUBLE_CONVERSION_VERSION}.tar.gz")
6465
}
6566

6667
task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {
6768
from dependenciesPath ?: tarTree(downloadDoubleConversion.dest)
6869
from 'src/main/jni/third-party/double-conversion/Android.mk'
69-
include 'double-conversion-1.1.6/src/**/*', 'Android.mk'
70+
include "double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", 'Android.mk'
7071
filesMatching('*/src/**/*', {fname -> fname.path = "double-conversion/${fname.name}"})
7172
includeEmptyDirs = false
7273
into "$thirdPartyNdkDir/double-conversion"
7374
}
7475

7576
task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) {
76-
src 'https://github.com/facebook/folly/archive/v2016.10.31.00.tar.gz'
77+
src "https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz"
7778
onlyIfNewer true
7879
overwrite false
79-
dest new File(downloadsDir, 'folly-2016.10.31.00.tar.gz');
80+
dest new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz");
8081
}
8182

8283
task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {
8384
from dependenciesPath ?: tarTree(downloadFolly.dest)
8485
from 'src/main/jni/third-party/folly/Android.mk'
85-
include 'folly-2016.10.31.00/folly/**/*', 'Android.mk'
86-
eachFile {fname -> fname.path = (fname.path - "folly-2016.10.31.00/")}
86+
include "folly-${FOLLY_VERSION}/folly/**/*", 'Android.mk'
87+
eachFile {fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/")}
8788
includeEmptyDirs = false
8889
into "$thirdPartyNdkDir/folly"
8990
}
9091

9192
task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {
92-
src 'https://github.com/google/glog/archive/v0.3.5.tar.gz'
93+
src "https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz"
9394
onlyIfNewer true
9495
overwrite false
95-
dest new File(downloadsDir, 'glog-0.3.5.tar.gz')
96+
dest new File(downloadsDir, "glog-${GLOG_VERSION}.tar.gz")
9697
}
9798

9899
// Prepare glog sources to be compiled, this task will perform steps that normally should've been
99100
// executed by automake. This way we can avoid dependencies on make/automake
100101
task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {
101102
from dependenciesPath ?: tarTree(downloadGlog.dest)
102103
from 'src/main/jni/third-party/glog/'
103-
include 'glog-0.3.5/src/**/*', 'Android.mk', 'config.h'
104+
include "glog-${GLOG_VERSION}/src/**/*", 'Android.mk', 'config.h'
104105
includeEmptyDirs = false
105106
filesMatching('**/*.h.in') {
106107
filter(ReplaceTokens, tokens: [

‎ReactAndroid/gradle.properties

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ FEST_ASSERT_CORE_VERSION=2.0M10
1313

1414
FRESCO_VERSION=1.10.0
1515
OKHTTP_VERSION=3.10.0
16+
17+
BOOST_VERSION=1_63_0
18+
DOUBLE_CONVERSION_VERSION=1.1.6
19+
FOLLY_VERSION=2016.10.31.00
20+
GLOG_VERSION=0.3.5

0 commit comments

Comments
 (0)
Please sign in to comment.