Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab.

Summary:
I've noticed that `test_android` and the Test Android Docker image jobs fails sometime with a missing
`libhermes.so` file. That is happening because the `configureNdkBuild*` tasks are executing
before the prefab for Hermes is ready. I'm adding an explicit dependency here that will prevent this
kind of situations from happening.

Changelog:
[Internal] [Changed] - Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab.

Reviewed By: ShikaSD

Differential Revision: D34859961

fbshipit-source-id: e4dc4b22c808359018ec952287b2d8a7094f0698
This commit is contained in:
Nicola Corti 2022-03-15 06:39:40 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 68fde3b35b
Коммит 21dd646eca
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -420,6 +420,16 @@ afterEvaluate {
configureNdkBuildDebug.dependsOn(preBuild)
configureNdkBuildRelease.dependsOn(preBuild)
// As we're consuming Hermes via Prefab, we're using the AGP C++ reference feature
// which is supposed to work for CMake only, we need to introduce an explicit dependency
// on publishing libraries prefab tasks.
// See https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#cpp-references.
// If we don't do this, the `configureNdkBuild*` is flaky and fails if the `prefabDebugPackage`
// is not yet executed.
// This can be safely removed once we move to CMake or once AGP supports C++ references on ndk-build.
configureNdkBuildDebug.dependsOn(":ReactAndroid:hermes-engine:prefabDebugPackage")
configureNdkBuildRelease.dependsOn(":ReactAndroid:hermes-engine:prefabReleasePackage")
publishing {
publications {
release(MavenPublication) {