Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history


Summary:
Improvement over facebook#11469.
Depends on react-native-community/boost-for-react-native#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 facebook#11511

Differential Revision: D4348098

fbshipit-source-id: 5c2f25cc395ae0cad19d56b7c0b2b102513580fb
  • Loading branch information
bestander authored and facebook-github-bot committed Dec 19, 2016
1 parent 5671dc3 commit 5d4b476
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5d4b476

Please sign in to comment.