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
This commit is contained in:
Janic Duplessis 2018-03-25 22:00:11 -07:00 committed by Facebook Github Bot
parent 226bff3ed0
commit ca20fcd47d
2 changed files with 3 additions and 1 deletions

View File

@ -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=*****

View File

@ -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 }