From 1020ac9481b5fedc2cc6aa31f757501f7ef556df Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Thu, 29 Mar 2018 20:59:47 -0700 Subject: [PATCH] OSS: add gradle wrapper helper to prepare offline gradle caches Summary: This is to help build offline module caches for gradle builds. allow-large-files Reviewed By: hramos Differential Revision: D7441450 fbshipit-source-id: 37ceb070223f0de06720f5c104ecfce2ad6cedfd --- ReactAndroid/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 25ba9d2c1b2..fa1be07afa7 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -13,7 +13,8 @@ import org.apache.tools.ant.filters.ReplaceTokens // We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk. // After that we build native code from src/main/jni with module path pointing at third-party-ndk. -def downloadsDir = new File("$buildDir/downloads") +def customDownloadsDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR") +def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File("$buildDir/downloads") def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") // You need to have following folders in this directory: @@ -145,6 +146,16 @@ task prepareJSC(dependsOn: dependenciesPath ? [] : [downloadJSCHeaders]) << { } } +task downloadNdkBuildDependencies { + if (!boostPath) { + dependsOn downloadBoost + } + dependsOn downloadDoubleConversion + dependsOn downloadFolly + dependsOn downloadGlog + dependsOn downloadJSCHeaders +} + def getNdkBuildName() { if (Os.isFamily(Os.FAMILY_WINDOWS)) { return "ndk-build.cmd"