|
3 | 3 | // This source code is licensed under the MIT license found in the
|
4 | 4 | // LICENSE file in the root directory of this source tree.
|
5 | 5 |
|
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 | +} |
10 | 11 |
|
11 | 12 | import de.undercouch.gradle.tasks.download.Download
|
12 | 13 | import org.apache.tools.ant.taskdefs.condition.Os
|
@@ -39,68 +40,68 @@ task createNativeDepsDirectories {
|
39 | 40 | }
|
40 | 41 |
|
41 | 42 | 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" |
43 | 44 | onlyIfNewer true
|
44 | 45 | overwrite false
|
45 |
| - dest new File(downloadsDir, 'boost_1_63_0.tar.gz') |
| 46 | + dest new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz") |
46 | 47 | }
|
47 | 48 |
|
48 | 49 | task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
|
49 | 50 | from boostPath ?: tarTree(resources.gzip(downloadBoost.dest))
|
50 | 51 | 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' |
52 | 53 | includeEmptyDirs = false
|
53 | 54 | into "$thirdPartyNdkDir/boost"
|
54 | 55 | doLast {
|
55 |
| - file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_1_63_0") |
| 56 | + file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_${BOOST_VERSION}") |
56 | 57 | }
|
57 | 58 | }
|
58 | 59 |
|
59 | 60 | 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" |
61 | 62 | onlyIfNewer true
|
62 | 63 | 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") |
64 | 65 | }
|
65 | 66 |
|
66 | 67 | task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {
|
67 | 68 | from dependenciesPath ?: tarTree(downloadDoubleConversion.dest)
|
68 | 69 | 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' |
70 | 71 | filesMatching('*/src/**/*', {fname -> fname.path = "double-conversion/${fname.name}"})
|
71 | 72 | includeEmptyDirs = false
|
72 | 73 | into "$thirdPartyNdkDir/double-conversion"
|
73 | 74 | }
|
74 | 75 |
|
75 | 76 | 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" |
77 | 78 | onlyIfNewer true
|
78 | 79 | overwrite false
|
79 |
| - dest new File(downloadsDir, 'folly-2016.10.31.00.tar.gz'); |
| 80 | + dest new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz"); |
80 | 81 | }
|
81 | 82 |
|
82 | 83 | task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {
|
83 | 84 | from dependenciesPath ?: tarTree(downloadFolly.dest)
|
84 | 85 | 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}/")} |
87 | 88 | includeEmptyDirs = false
|
88 | 89 | into "$thirdPartyNdkDir/folly"
|
89 | 90 | }
|
90 | 91 |
|
91 | 92 | 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" |
93 | 94 | onlyIfNewer true
|
94 | 95 | overwrite false
|
95 |
| - dest new File(downloadsDir, 'glog-0.3.5.tar.gz') |
| 96 | + dest new File(downloadsDir, "glog-${GLOG_VERSION}.tar.gz") |
96 | 97 | }
|
97 | 98 |
|
98 | 99 | // Prepare glog sources to be compiled, this task will perform steps that normally should've been
|
99 | 100 | // executed by automake. This way we can avoid dependencies on make/automake
|
100 | 101 | task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {
|
101 | 102 | from dependenciesPath ?: tarTree(downloadGlog.dest)
|
102 | 103 | 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' |
104 | 105 | includeEmptyDirs = false
|
105 | 106 | filesMatching('**/*.h.in') {
|
106 | 107 | filter(ReplaceTokens, tokens: [
|
|
0 commit comments