From ca20fcd47d55585e66f429e698afda49abdc339c Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Sun, 25 Mar 2018 22:00:11 -0700 Subject: [PATCH] Use afterEvaluate to make gradle bundle task work with configureondemand Summary: The js bundle task does not run when `org.gradle.configureondemand` is set to true. This uses `afterEvaluate` instead of `gradle.projectsEvaluated` which is executed properly. Add `org.gradle.configureondemand=true`, run RNTester in release mode and make sure the bundle task is run. [ANDROID] [BUGFIX] [LOCATION] - Fix release bundle task when org.gradle.configureondemand=true Closes https://github.com/facebook/react-native/pull/18557 Differential Revision: D7396744 Pulled By: mdvacca fbshipit-source-id: 9ea134cb49e8a087cec16f82b990cd19af76785a --- RNTester/android/app/gradle.properties | 2 ++ react.gradle | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RNTester/android/app/gradle.properties b/RNTester/android/app/gradle.properties index 74027349d..04cbf4f74 100644 --- a/RNTester/android/app/gradle.properties +++ b/RNTester/android/app/gradle.properties @@ -1,4 +1,6 @@ android.useDeprecatedNdk=true +org.gradle.parallel=true +org.gradle.configureondemand=true MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=***** diff --git a/react.gradle b/react.gradle index 64b2f02f8..bdf392ad9 100644 --- a/react.gradle +++ b/react.gradle @@ -23,7 +23,7 @@ void runBefore(String dependentTaskName, Task task) { } } -gradle.projectsEvaluated { +afterEvaluate { // Grab all build types and product flavors def buildTypes = android.buildTypes.collect { type -> type.name } def productFlavors = android.productFlavors.collect { flavor -> flavor.name }