Make cmakeBuildTask accept opts instead of array (#1204)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1204 For expandability, consistency with other tasks, and added explicitness. Reviewed By: huntie Differential Revision: D42285129 fbshipit-source-id: 2b76a7dba7474bfae98509740c13c3e173fa9a27
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2359ccde78
commit
c3291912b3
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
root: true,
|
||||||
ignorePatterns: ["dist/**", "**/*.d.ts"],
|
ignorePatterns: ["dist/**", "**/*.d.ts"],
|
||||||
parser: "@babel/eslint-parser",
|
parser: "@babel/eslint-parser",
|
||||||
extends: [
|
extends: [
|
||||||
|
15
javascript/.prettierrc.js
Normal file
15
javascript/.prettierrc.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
trailingComma: "es5",
|
||||||
|
tabWidth: 2,
|
||||||
|
semi: true,
|
||||||
|
singleQuote: false,
|
||||||
|
};
|
@@ -40,7 +40,7 @@ task(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function defineFlavor(flavor, env) {
|
function defineFlavor(flavor, env) {
|
||||||
task(`cmake-build:${flavor}`, cmakeBuildTask([flavor]));
|
task(`cmake-build:${flavor}`, cmakeBuildTask({ targets: [flavor] }));
|
||||||
task(`jest:${flavor}`, jestTask({ env }));
|
task(`jest:${flavor}`, jestTask({ env }));
|
||||||
task(
|
task(
|
||||||
`test:${flavor}`,
|
`test:${flavor}`,
|
||||||
@@ -54,8 +54,14 @@ defineFlavor("wasm-async", { WASM: 1, SYNC: 0 });
|
|||||||
defineFlavor("wasm-sync", { WASM: 1, SYNC: 1 });
|
defineFlavor("wasm-sync", { WASM: 1, SYNC: 1 });
|
||||||
|
|
||||||
task("cmake-build:all", cmakeBuildTask());
|
task("cmake-build:all", cmakeBuildTask());
|
||||||
task("cmake-build:async", cmakeBuildTask(["asmjs-async", "wasm-async"]));
|
task(
|
||||||
task("cmake-build:sync", cmakeBuildTask(["asmjs-sync", "wasm-sync"]));
|
"cmake-build:async",
|
||||||
|
cmakeBuildTask({ targets: ["asmjs-async", "wasm-async"] })
|
||||||
|
);
|
||||||
|
task(
|
||||||
|
"cmake-build:sync",
|
||||||
|
cmakeBuildTask({ targets: ["asmjs-sync", "wasm-sync"] })
|
||||||
|
);
|
||||||
|
|
||||||
task("build", series("prepare-for-build", "cmake-build:all"));
|
task("build", series("prepare-for-build", "cmake-build:all"));
|
||||||
|
|
||||||
@@ -117,13 +123,13 @@ function emcmakeGenerateTask() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmakeBuildTask(targets) {
|
function cmakeBuildTask(opts) {
|
||||||
return () => {
|
return () => {
|
||||||
const cmake = which.sync("cmake");
|
const cmake = which.sync("cmake");
|
||||||
const args = [
|
const args = [
|
||||||
"--build",
|
"--build",
|
||||||
"build",
|
"build",
|
||||||
...(targets ? ["--target", ...targets] : []),
|
...(opts?.targets ? ["--target", ...opts.targets] : []),
|
||||||
];
|
];
|
||||||
logger.info(["cmake", ...args].join(" "));
|
logger.info(["cmake", ...args].join(" "));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user