Files
flipper/xplat/build.gradle
Lorenzo Blasa c72088a137 Execute third-party prepare before configureCMake
Summary:
^

:android:third-party task, on ocassions, gets parallelised with the :configureCMake task resulting in build errors.

:configureCMake depends on dependencies being in-place and patched.

Our current setup was achieving this via setting these tasks as dependencies of the preBuild task.

Unfortunately, this seems not be a bullet-proof solution.

This patch aims to improve this situation by ensuring the tasks are executed before :configureCMake. Whatever happens first.

Changelog: Execute :third-party:prepare before :configureCMake task on Android

Reviewed By: passy

Differential Revision: D36001637

fbshipit-source-id: 6c53b6852e40e354337c0ac940b5bbad4ef83078
2022-04-28 06:36:42 -07:00

56 lines
1.4 KiB
Groovy

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
ndkVersion rootProject.ndkVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
externalNativeBuild {
cmake {
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared'
}
}
}
externalNativeBuild {
cmake {
path './CMakeLists.txt'
}
}
sourceSets {
main {
manifest.srcFile './AndroidManifest.xml'
}
}
buildFeatures {
prefab true
}
dependencies {
implementation project(':third-party')
implementation project(':folly')
implementation deps.openssl
}
}
// Patch below is used in case the 'configureCMake' task
// gets executed in parallel with the 'preBuild' task.
// Our CMakeFile expects third-party dependencies to be already
// in-place and patched.
tasks.matching { it.name.startsWith("configureCMake") }.all {
dependsOn(tasks.getByPath(':third-party:prepare'))
}
preBuild.dependsOn(tasks.getByPath(':third-party:prepare'))