From 24bf1c5e8bdff52e454de6a442ac441c0679ff7c Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 13 Sep 2021 07:36:32 -0700 Subject: [PATCH] Fix broken Android CI due to broken `BundleJsAndAssetsTask` override (#32194) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32194 This Diff fixes the `test_android` CircleCI that is currently broken due to a faulty `BundleJsAndAssetsTask` (that's my fault sorry for this). The CI is failing with a `execCommand == null!` error message. The message is happening as the aformentioned task is not correctly overriding `exec()` but just declaring a `TaskAction`. I'm fixing it. Changelog: [Internal] [Changed] - Fix broken Android CI due to broken `BundleJsAndAssetsTask` override Reviewed By: GijsWeterings Differential Revision: D30899742 fbshipit-source-id: a39b01b7d429bd7e87411282e1c22a7606ea22e0 --- .../com/facebook/react/tasks/BundleJsAndAssetsTask.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleJsAndAssetsTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleJsAndAssetsTask.kt index 51c23b32a67a0e..a00d3a6e28aef4 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleJsAndAssetsTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleJsAndAssetsTask.kt @@ -34,10 +34,10 @@ abstract class BundleJsAndAssetsTask : Exec() { @get:OutputDirectory lateinit var jsSourceMapsDir: File @get:OutputFile lateinit var jsSourceMapsFile: File - @TaskAction - fun run() { + override fun exec() { cleanOutputDirectories() - executeBundleCommand() + configureBundleCommand() + super.exec() } private fun cleanOutputDirectories() { @@ -47,7 +47,7 @@ abstract class BundleJsAndAssetsTask : Exec() { jsSourceMapsDir.recreateDir() } - private fun executeBundleCommand() { + private fun configureBundleCommand() { workingDir(reactRoot) @Suppress("SpreadOperator") @@ -69,7 +69,5 @@ abstract class BundleJsAndAssetsTask : Exec() { "--sourcemap-output", jsSourceMapsFile, *extraArgs.toTypedArray())) - - super.exec() } }