From 5d4b4765834f10ea6463e895084b46f889eb1a48 Mon Sep 17 00:00:00 2001 From: Konstantin Raev Date: Mon, 19 Dec 2016 13:07:16 -0800 Subject: [PATCH] boost is downloaded from https://github.com/react-native-community/boost Summary: Improvement over https://github.com/facebook/react-native/pull/11469. Depends on https://github.com/react-native-community/boost-for-react-native/issues/1, **don't merge before it is fixed**. It would be more in line with other dependencies to depend only on github for thirdparty bridge dependencies. **Test plan (required)** - Circle (testing with caches cleaned) - ./gradlew ReactAndroid:packageReactNdkLibsForBuck (check twice to make sure caches work) REACT_NATIVE_BOOST_PATH=./path-to-local-boost/ - ./gradlew ReactAndroid:packageReactNdkLibsForBuck (check twice to make sure caches work) Closes https://github.com/facebook/react-native/pull/11511 Differential Revision: D4348098 fbshipit-source-id: 5c2f25cc395ae0cad19d56b7c0b2b102513580fb --- ReactAndroid/build.gradle | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 721d69e38..a93e779cf 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -35,33 +35,17 @@ task createNativeDepsDirectories { } task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) { - src 'https://registry.yarnpkg.com/boost-react-native-bundle/-/boost-react-native-bundle-1.57.0.tgz' + src 'https://github.com/react-native-community/boost-for-react-native/releases/download/v1.57.0-1/boost_1_57_0.tar.gz' onlyIfNewer true overwrite false - dest new File(downloadsDir, 'boost-react-native-bundle-1.57.0.tgz') + dest new File(downloadsDir, 'boost_1_57_0.tar.gz') } -task unpackBoost(dependsOn: downloadBoost, type: Copy) { - from tarTree(resources.gzip(downloadBoost.dest)) - include 'package/boost_1_57_0/boost/**/*.hpp' - into "$thirdPartyNdkDir/boost" - // npm packages are unpacked into folder "package" that we want to strip - eachFile { FileCopyDetails fcp -> - if (fcp.relativePath.pathString.startsWith("package")) { - // remap the file to the root - def segments = fcp.relativePath.segments - def pathsegments = segments[1..-1] as String[] - fcp.relativePath = new RelativePath(!fcp.file.isDirectory(), pathsegments) - } else { - fcp.exclude() - } - } -} - -task prepareBoost(dependsOn: boostPath ? [] : [unpackBoost], type: Copy) { - from boostPath ?: [] +task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) { + from boostPath ?: tarTree(resources.gzip(downloadBoost.dest)) from 'src/main/jni/third-party/boost/Android.mk' include 'boost_1_57_0/boost/**/*.hpp', 'Android.mk' + includeEmptyDirs = false into "$thirdPartyNdkDir/boost" } @@ -135,7 +119,8 @@ task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) } task downloadJSCHeaders(type: Download) { - def jscAPIBaseURL = 'https://svn.webkit.org/repository/webkit/!svn/bc/174650/trunk/Source/JavaScriptCore/API/' + // in sync with webkit SVN revision 174650 + def jscAPIBaseURL = 'https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/' def jscHeaderFiles = ['JavaScript.h', 'JSBase.h', 'JSContextRef.h', 'JSObjectRef.h', 'JSRetainPtr.h', 'JSStringRef.h', 'JSValueRef.h', 'WebKitAvailability.h'] def output = new File(downloadsDir, 'jsc') output.mkdirs()