From 98515c0127eb0ea4ffe26c16992b5c6f2d142e9c Mon Sep 17 00:00:00 2001 From: FoxtrotSierra Date: Mon, 21 Oct 2024 01:16:16 +0300 Subject: [PATCH] build: adjust A380X build scripts --- .gitignore | 1 + ci.igniter.config.mjs | 225 ++++++++++++++++++++++++ igniter.config.mjs | 356 ++++++++++++++++++-------------------- package.json | 7 +- scripts/build_a380x.sh | 10 +- scripts/fragment_a380x.js | 16 +- scripts/setup.sh | 19 ++ 7 files changed, 442 insertions(+), 192 deletions(-) create mode 100644 ci.igniter.config.mjs diff --git a/.gitignore b/.gitignore index 763a5bb8241a..19a0d9b426ac 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ !.prettierrc !igniter.config.mjs +!ci.igniter.config.mjs !jsconfig.json !Cargo.lock diff --git a/ci.igniter.config.mjs b/ci.igniter.config.mjs new file mode 100644 index 000000000000..4945a26a8181 --- /dev/null +++ b/ci.igniter.config.mjs @@ -0,0 +1,225 @@ +import { ExecTask, TaskOfTasks } from '@flybywiresim/igniter'; +import { getInstrumentsIgniterTasks as getA320InstrumentsIgniterTasks } from './fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs'; +import { getInstrumentsIgniterTasks as getA380InstrumentsIgniterTasks } from './fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs'; + +export default new TaskOfTasks('all', [ + // A32NX Task + new TaskOfTasks('a32nx', [ + // Prepare the out folder and any other pre tasks. + // Currently, these can be run in parallel, but in the future, we may need to run them in sequence if there are any dependencies. + new TaskOfTasks( + 'preparation', + [ + new ExecTask('copy-base-files', 'npm run build-a32nx:copy-base-files'), + new TaskOfTasks( + 'localization', + [ + new ExecTask('efb-translation', 'npm run build-a32nx:efb-translation'), + new ExecTask('locPak-translation', 'npm run build-a32nx:locPak-translation'), + ], + true, + ), + ], + false, + ), + + // Group all typescript and react build tasks together. + new TaskOfTasks( + 'build', + [ + new ExecTask('model', 'npm run build-a32nx:model', [ + 'fbw-a32nx/src/model', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model', + ]), + new ExecTask('behavior', 'npm run build-a32nx:behavior', [ + 'fbw-a32nx/src/behavior', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated', + ]), + + new TaskOfTasks('atsu', [ + new ExecTask('common', 'npm run build-a32nx:atsu-common', [ + 'fbw-a32nx/src/systems/atsu/common', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/common.js', + ]), + new ExecTask('fmsclient', 'npm run build-a32nx:atsu-fms-client', [ + 'fbw-a32nx/src/systems/atsu/common', + 'fbw-a32nx/src/systems/atsu/fmsclient', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/fmsclient.js', + ]), + ]), + new ExecTask('extras-host', 'npm run build-a32nx:extras-host', [ + 'fbw-a32nx/src/systems/extras-host', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/ExtrasHost', + ]), + new ExecTask('failures', 'npm run build-a32nx:failures', [ + 'fbw-a32nx/src/systems/failures', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/failures/failures.js', + ]), + new ExecTask('fmgc', 'npm run build-a32nx:fmgc', [ + 'fbw-a32nx/src/systems/fmgc', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/fmgc', + ]), + new ExecTask('sentry-client', 'npm run build-a32nx:sentry-client', [ + 'fbw-a32nx/src/systems/sentry-client', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/sentry-client', + ]), + new ExecTask('simbridge-client', 'npm run build-a32nx:simbridge-client', [ + 'fbw-a32nx/src/systems/simbridge-client', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/simbridge-client', + ]), + new ExecTask('systems-host', 'npm run build-a32nx:systems-host', [ + 'fbw-a32nx/src/systems/systems-host', + 'fbw-common/src/systems/datalink', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/SystemsHost', + ]), + new ExecTask('tcas', 'npm run build-a32nx:tcas', [ + 'fbw-a32nx/src/systems/tcas', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/tcas', + ]), + + new TaskOfTasks('instruments', getA320InstrumentsIgniterTasks(), true), + ], + true, + ), + + // Group all WASM build tasks together but separate from the rest of the tasks as build run more stable like this. + new TaskOfTasks( + 'wasm', + [ + new ExecTask('systems', 'npm run build-a32nx:systems', [ + 'fbw-a32nx/src/wasm/systems', + 'fbw-common/src/wasm/systems', + 'Cargo.lock', + 'Cargo.toml', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm', + ]), + new ExecTask('systems-fbw', 'npm run build-a32nx:fbw', [ + 'fbw-a32nx/src/wasm/fbw_a320', + 'fbw-common/src/wasm/fbw_common', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fbw.wasm', + ]), + new ExecTask( + 'systems-terronnd', + ['npm run build-a32nx:terronnd'], + [ + 'fbw-common/src/wasm/terronnd', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/terronnd.wasm', + 'fbw-common/src/wasm/terronnd/out/terronnd.wasm', + ], + ), + new ExecTask('cpp-wasm-cmake', 'npm run build:cpp-wasm-cmake', [ + 'fbw-common/src/wasm/cpp-msfs-framework', + 'fbw-common/src/wasm/extra-backend', + 'fbw-common/src/wasm/fadec_common', + 'fbw-a32nx/src/wasm/extra-backend-a32nx', + 'fbw-a32nx/src/wasm/fadec_a32nx', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/extra-backend-a32nx.wasm', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fadec-a32nx.wasm', + ]), + ], + true, + ), + + // Create final package meta files. + new TaskOfTasks('dist', [ + new ExecTask('metadata', 'npm run build-a32nx:metadata'), + new ExecTask('manifests', 'npm run build-a32nx:manifest'), + ]), + ]), + + // A380X Tasks + new TaskOfTasks('a380x', [ + new TaskOfTasks( + 'preparation', + [ + new ExecTask('copy-base-files', [ + 'npm run build-a380x:link-base-files', + 'npm run unchunkLargeFiles', + 'npm run build-a380x:link-large-files', + // temporary until folder exists + 'mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/', + ]), + new TaskOfTasks( + 'localization', + [new ExecTask('locPak-translation', 'npm run build-a380x:locPak-translation')], + true, + ), + ], + false, + ), + + // Group all typescript and react build tasks together. + new TaskOfTasks( + 'build', + [ + new ExecTask('extras-host', 'npm run build-a380x:extras-host', [ + 'fbw-a380x/src/systems/extras-host', + 'fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X/ExtrasHost', + ]), + new ExecTask('systems-host', 'npm run build-a380x:systems-host', [ + 'fbw-a380x/src/systems/systems-host', + 'fbw-a380x/src/systems/shared/src', + 'fbw-common/src/systems/shared/src', + 'fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X/SystemsHost', + ]), + new TaskOfTasks('instruments', getA380InstrumentsIgniterTasks(), true), + ], + true, + ), + + new TaskOfTasks( + 'wasm', + [ + new ExecTask('systems', 'npm run build-a380x:systems', [ + 'fbw-common/src/wasm/systems', + 'Cargo.lock', + 'Cargo.toml', + 'fbw-a380x/src/wasm/systems', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/systems.wasm', + ]), + new ExecTask('systems-fbw', 'npm run build-a380x:fbw', [ + 'fbw-common/src/wasm/fbw_common', + 'fbw-a380x/src/wasm/fbw_a380', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fbw.wasm', + ]), + new ExecTask( + 'systems-terronnd', + ['npm run build-a380x:terronnd'], + [ + 'fbw-common/src/wasm/terronnd', + 'fbw-common/src/wasm/terronnd/out/terronnd.wasm', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/terronnd.wasm', + ], + ), + new ExecTask('cpp-wasm-cmake', 'npm run build:cpp-wasm-cmake', [ + 'fbw-common/src/wasm/cpp-msfs-framework', + 'fbw-common/src/wasm/extra-backend', + 'fbw-common/src/wasm/fadec_common', + 'fbw-a380x/src/wasm/extra-backend-a380x', + 'fbw-a380x/src/wasm/fadec_a380x', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/extra-backend-a380x.wasm', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fadec-a380x.wasm', + ]), + ], + true, + ), + + // Create final package meta files. + new TaskOfTasks('dist', [ + new ExecTask('metadata', 'npm run build-a380x:metadata'), + new ExecTask('manifests', 'npm run build-a380x:manifest'), + ]), + ]), + + // InGamePanels Checklist Fix Tasks + new TaskOfTasks('ingamepanels-checklist-fix', [ + // Prepare the out folder and any other pre tasks. + // Currently, these can be run in parallel, but in the future, we may need to run them in sequence if there are any dependencies. + new TaskOfTasks( + 'preparation', + [new ExecTask('copy-base-files', 'npm run build-ingamepanels-checklist-fix:copy-base-files')], + true, + ), + new TaskOfTasks('dist', [new ExecTask('manifests', 'npm run build-ingamepanels-checklist-fix:manifest')]), + ]), +]); diff --git a/igniter.config.mjs b/igniter.config.mjs index 975e83a6cd8c..b98432847b59 100644 --- a/igniter.config.mjs +++ b/igniter.config.mjs @@ -1,240 +1,226 @@ -import {ExecTask, TaskOfTasks} from "@flybywiresim/igniter"; -import { getInstrumentsIgniterTasks as getA320InstrumentsIgniterTasks } from "./fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs"; +import { ExecTask, TaskOfTasks } from '@flybywiresim/igniter'; +import { getInstrumentsIgniterTasks as getA320InstrumentsIgniterTasks } from './fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs'; import { getInstrumentsIgniterTasks as getA380InstrumentsIgniterTasks } from './fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs'; -export default new TaskOfTasks("all", [ +export default new TaskOfTasks('all', [ // A32NX Task - new TaskOfTasks("a32nx", [ + new TaskOfTasks('a32nx', [ // Prepare the out folder and any other pre tasks. // Currently, these can be run in parallel, but in the future, we may need to run them in sequence if there are any dependencies. - new TaskOfTasks("preparation", [ - new ExecTask("copy-base-files", "npm run build-a32nx:copy-base-files"), - new TaskOfTasks("localization", [ - new ExecTask("efb-translation", "npm run build-a32nx:efb-translation"), - new ExecTask("locPak-translation", "npm run build-a32nx:locPak-translation") - ], true), - ], false), + new TaskOfTasks( + 'preparation', + [ + new ExecTask('copy-base-files', 'npm run build-a32nx:copy-base-files'), + new TaskOfTasks( + 'localization', + [ + new ExecTask('efb-translation', 'npm run build-a32nx:efb-translation'), + new ExecTask('locPak-translation', 'npm run build-a32nx:locPak-translation'), + ], + true, + ), + ], + false, + ), // Group all typescript and react build tasks together. - new TaskOfTasks("build", [ - new ExecTask("model", - "npm run build-a32nx:model", - [ - "fbw-a32nx/src/model", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model" - ]), - new ExecTask("behavior", - "npm run build-a32nx:behavior", - [ - "fbw-a32nx/src/behavior", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated" + new TaskOfTasks( + 'build', + [ + new ExecTask('model', 'npm run build-a32nx:model', [ + 'fbw-a32nx/src/model', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model', + ]), + new ExecTask('behavior', 'npm run build-a32nx:behavior', [ + 'fbw-a32nx/src/behavior', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated', ]), - new TaskOfTasks('atsu', [ - new ExecTask( - 'common', - 'npm run build-a32nx:atsu-common', - [ + new TaskOfTasks('atsu', [ + new ExecTask('common', 'npm run build-a32nx:atsu-common', [ 'fbw-a32nx/src/systems/atsu/common', - 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/common.js' - ] - ), - new ExecTask( - 'fmsclient', - 'npm run build-a32nx:atsu-fms-client', - [ + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/common.js', + ]), + new ExecTask('fmsclient', 'npm run build-a32nx:atsu-fms-client', [ 'fbw-a32nx/src/systems/atsu/common', 'fbw-a32nx/src/systems/atsu/fmsclient', - 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/fmsclient.js' - ] - ), - ]), - new ExecTask( - 'extras-host', - 'npm run build-a32nx:extras-host', - [ + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/atsu/fmsclient.js', + ]), + ]), + new ExecTask('extras-host', 'npm run build-a32nx:extras-host', [ 'fbw-a32nx/src/systems/extras-host', - 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/ExtrasHost' - ] - ), - new ExecTask("failures", - "npm run build-a32nx:failures", - [ - "fbw-a32nx/src/systems/failures", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/failures/failures.js" - ]), - new ExecTask("fmgc", - "npm run build-a32nx:fmgc", - [ - "fbw-a32nx/src/systems/fmgc", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/fmgc" - ]), - new ExecTask("sentry-client", - "npm run build-a32nx:sentry-client", - [ - "fbw-a32nx/src/systems/sentry-client", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/sentry-client" - ]), - new ExecTask("simbridge-client", - "npm run build-a32nx:simbridge-client", - [ - "fbw-a32nx/src/systems/simbridge-client", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/simbridge-client" - ]), - new ExecTask( - 'systems-host', - 'npm run build-a32nx:systems-host', - [ + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/ExtrasHost', + ]), + new ExecTask('failures', 'npm run build-a32nx:failures', [ + 'fbw-a32nx/src/systems/failures', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/failures/failures.js', + ]), + new ExecTask('fmgc', 'npm run build-a32nx:fmgc', [ + 'fbw-a32nx/src/systems/fmgc', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/fmgc', + ]), + new ExecTask('sentry-client', 'npm run build-a32nx:sentry-client', [ + 'fbw-a32nx/src/systems/sentry-client', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/sentry-client', + ]), + new ExecTask('simbridge-client', 'npm run build-a32nx:simbridge-client', [ + 'fbw-a32nx/src/systems/simbridge-client', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/simbridge-client', + ]), + new ExecTask('systems-host', 'npm run build-a32nx:systems-host', [ 'fbw-a32nx/src/systems/systems-host', 'fbw-common/src/systems/datalink', - 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/SystemsHost' - ] - ), - new ExecTask("tcas", - "npm run build-a32nx:tcas", - [ - "fbw-a32nx/src/systems/tcas", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/tcas" + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/SystemsHost', + ]), + new ExecTask('tcas', 'npm run build-a32nx:tcas', [ + 'fbw-a32nx/src/systems/tcas', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/JS/fbw-a32nx/tcas', ]), - new TaskOfTasks("instruments", getA320InstrumentsIgniterTasks(), true), - ], true), + new TaskOfTasks('instruments', getA320InstrumentsIgniterTasks(), true), + ], + true, + ), // Group all WASM build tasks together but separate from the rest of the tasks as build run more stable like this. - new TaskOfTasks("wasm", [ - new ExecTask("systems", - "npm run build-a32nx:systems", - [ - "fbw-a32nx/src/wasm/systems", - "fbw-common/src/wasm/systems", - "Cargo.lock", - "Cargo.toml", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm" - ]), - new ExecTask("systems-fbw", - "npm run build-a32nx:fbw", - [ - "fbw-a32nx/src/wasm/fbw_a320", - "fbw-common/src/wasm/fbw_common", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fbw.wasm" - ]), - new ExecTask("systems-terronnd", [ - "npm run build-a32nx:terronnd", - ], [ - "fbw-common/src/wasm/terronnd", - "fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/terronnd.wasm", - "fbw-common/src/wasm/terronnd/out/terronnd.wasm", - ]), - new ExecTask('cpp-wasm-cmake', - "npm run build:cpp-wasm-cmake", - [ + new TaskOfTasks( + 'wasm', + [ + new ExecTask('systems', 'npm run build-a32nx:systems', [ + 'fbw-a32nx/src/wasm/systems', + 'fbw-common/src/wasm/systems', + 'Cargo.lock', + 'Cargo.toml', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm', + ]), + new ExecTask('systems-fbw', 'npm run build-a32nx:fbw', [ + 'fbw-a32nx/src/wasm/fbw_a320', + 'fbw-common/src/wasm/fbw_common', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fbw.wasm', + ]), + new ExecTask( + 'systems-terronnd', + ['npm run build-a32nx:terronnd'], + [ + 'fbw-common/src/wasm/terronnd', + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/terronnd.wasm', + 'fbw-common/src/wasm/terronnd/out/terronnd.wasm', + ], + ), + new ExecTask('cpp-wasm-cmake', 'npm run build:cpp-wasm-cmake', [ 'fbw-common/src/wasm/cpp-msfs-framework', 'fbw-common/src/wasm/extra-backend', 'fbw-common/src/wasm/fadec_common', 'fbw-a32nx/src/wasm/extra-backend-a32nx', 'fbw-a32nx/src/wasm/fadec_a32nx', 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/extra-backend-a32nx.wasm', - 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fadec-a32nx.wasm' + 'fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fadec-a32nx.wasm', ]), - ], true), + ], + true, + ), // Create final package meta files. - new TaskOfTasks("dist", [ - new ExecTask("metadata", "npm run build-a32nx:metadata"), - new ExecTask("manifests", "npm run build-a32nx:manifest") - ]) + new TaskOfTasks('dist', [ + new ExecTask('metadata', 'npm run build-a32nx:metadata'), + new ExecTask('manifests', 'npm run build-a32nx:manifest'), + ]), ]), // A380X Tasks - new TaskOfTasks("a380x", [ - - new TaskOfTasks("preparation", [ - new ExecTask("copy-base-files", [ - "npm run build-a380x:copy-base-files", - // temporary until folder exists - "mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/" - ]), - new TaskOfTasks("localization", [ - new ExecTask("locPak-translation", "npm run build-a380x:locPak-translation") - ], true), - ], true), + new TaskOfTasks('a380x', [ + new TaskOfTasks( + 'preparation', + [ + new ExecTask('copy-base-files', [ + 'npm run build-a380x:copy-base-files', + 'npm run unchunkLargeFiles', + 'npm run build-a380x:copy-large-files', + 'npm run chunkLargeFiles', + // temporary until folder exists + 'mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/', + ]), + new TaskOfTasks( + 'localization', + [new ExecTask('locPak-translation', 'npm run build-a380x:locPak-translation')], + true, + ), + ], + false, + ), // Group all typescript and react build tasks together. - new TaskOfTasks("build", [ - new ExecTask( - 'extras-host', - 'npm run build-a380x:extras-host', - [ + new TaskOfTasks( + 'build', + [ + new ExecTask('extras-host', 'npm run build-a380x:extras-host', [ 'fbw-a380x/src/systems/extras-host', - 'fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X/ExtrasHost' - ] - ), - new ExecTask( - 'systems-host', - 'npm run build-a380x:systems-host', - [ + 'fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X/ExtrasHost', + ]), + new ExecTask('systems-host', 'npm run build-a380x:systems-host', [ 'fbw-a380x/src/systems/systems-host', 'fbw-a380x/src/systems/shared/src', 'fbw-common/src/systems/shared/src', 'fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X/SystemsHost', - ] - ), - new TaskOfTasks("instruments", getA380InstrumentsIgniterTasks(), true), - ], true), + ]), + new TaskOfTasks('instruments', getA380InstrumentsIgniterTasks(), true), + ], + true, + ), - new TaskOfTasks("wasm", [ - new ExecTask("systems", - "npm run build-a380x:systems", - [ - "fbw-common/src/wasm/systems", - "Cargo.lock", - "Cargo.toml", - "fbw-a380x/src/wasm/systems", - "fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/systems.wasm" - ]), - new ExecTask("systems-fbw", - "npm run build-a380x:fbw", - [ - "fbw-common/src/wasm/fbw_common", - "fbw-a380x/src/wasm/fbw_a380", - "fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fbw.wasm" - ]), - new ExecTask("systems-terronnd", [ - "npm run build-a380x:terronnd", - ], [ - "fbw-common/src/wasm/terronnd", - "fbw-common/src/wasm/terronnd/out/terronnd.wasm", - "fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/terronnd.wasm", - ]), - new ExecTask('cpp-wasm-cmake', - "npm run build:cpp-wasm-cmake", - [ + new TaskOfTasks( + 'wasm', + [ + new ExecTask('systems', 'npm run build-a380x:systems', [ + 'fbw-common/src/wasm/systems', + 'Cargo.lock', + 'Cargo.toml', + 'fbw-a380x/src/wasm/systems', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/systems.wasm', + ]), + new ExecTask('systems-fbw', 'npm run build-a380x:fbw', [ + 'fbw-common/src/wasm/fbw_common', + 'fbw-a380x/src/wasm/fbw_a380', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fbw.wasm', + ]), + new ExecTask( + 'systems-terronnd', + ['npm run build-a380x:terronnd'], + [ + 'fbw-common/src/wasm/terronnd', + 'fbw-common/src/wasm/terronnd/out/terronnd.wasm', + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/terronnd.wasm', + ], + ), + new ExecTask('cpp-wasm-cmake', 'npm run build:cpp-wasm-cmake', [ 'fbw-common/src/wasm/cpp-msfs-framework', 'fbw-common/src/wasm/extra-backend', 'fbw-common/src/wasm/fadec_common', 'fbw-a380x/src/wasm/extra-backend-a380x', 'fbw-a380x/src/wasm/fadec_a380x', 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/extra-backend-a380x.wasm', - 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fadec-a380x.wasm' + 'fbw-a380x/out/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/panel/fadec-a380x.wasm', ]), - ], true), + ], + true, + ), // Create final package meta files. - new TaskOfTasks("dist", [ - new ExecTask("metadata", "npm run build-a380x:metadata"), - new ExecTask("manifests", "npm run build-a380x:manifest") + new TaskOfTasks('dist', [ + new ExecTask('metadata', 'npm run build-a380x:metadata'), + new ExecTask('manifests', 'npm run build-a380x:manifest'), ]), ]), // InGamePanels Checklist Fix Tasks - new TaskOfTasks("ingamepanels-checklist-fix", [ + new TaskOfTasks('ingamepanels-checklist-fix', [ // Prepare the out folder and any other pre tasks. // Currently, these can be run in parallel, but in the future, we may need to run them in sequence if there are any dependencies. - new TaskOfTasks("preparation", [ - new ExecTask("copy-base-files", "npm run build-ingamepanels-checklist-fix:copy-base-files") - ], true), - new TaskOfTasks("dist", [ - new ExecTask("manifests", "npm run build-ingamepanels-checklist-fix:manifest") - ]) - ]) + new TaskOfTasks( + 'preparation', + [new ExecTask('copy-base-files', 'npm run build-ingamepanels-checklist-fix:copy-base-files')], + true, + ), + new TaskOfTasks('dist', [new ExecTask('manifests', 'npm run build-ingamepanels-checklist-fix:manifest')]), + ]), ]); diff --git a/package.json b/package.json index 2bd6fdb83d0f..d9a886e508b0 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,9 @@ "watch:instruments": "rollup --max-old-space-size=8192 -wc src/systems/instruments/buildSrc/simulatorBuild.mjs", "====== A380 =============================================================": "========================================================", "build-a380x:copy-base-files": "mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842 && (rsync -a fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/ || cp -a -u fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/)", + "build-a380x:copy-large-files": "mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842 && (rsync -a large-files/fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/ || cp -a -u large-files/fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/)", + "build-a380x:link-base-files": "mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842 && cp -l -r fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/", + "build-a380x:link-large-files": "mkdir -p fbw-a380x/out/flybywire-aircraft-a380-842 && cp -l -r large-files/fbw-a380x/src/base/flybywire-aircraft-a380-842 fbw-a380x/out/", "build-a380x:efb-translation": "cd fbw-common/src/systems/instruments/src/EFB/Localization && node build-flypad-translation.js", "build-a380x:locPak-translation": "cd fbw-a380x/src/localization && node build-locPak-translation.js", "build-a380x:extras-host": "node fbw-a380x/src/systems/extras-host/build.js", @@ -62,7 +65,9 @@ "====== COMMON ===========================================================": "========================================================", "lint": "eslint --cache **/*.{js,mjs,jsx,ts,tsx}", "lint-fix": "npm run lint -- --fix", - "test": "jest" + "test": "jest", + "unchunkLargeFiles": "cd large-files && npm run unchunk", + "chunkLargeFiles": "cd large-files && npm run chunk" }, "lint-staged": { "*.{js,mjs,jsx}": "eslint --cache --fix", diff --git a/scripts/build_a380x.sh b/scripts/build_a380x.sh index 9fdcc4630b98..188a0ac124f5 100755 --- a/scripts/build_a380x.sh +++ b/scripts/build_a380x.sh @@ -27,8 +27,14 @@ for arg in "$@"; do fi done -# run build -time npx igniter -r "${AIRCRAFT_PROJECT_PREFIX}" "${args[@]}" + +if [ "${GITHUB_ACTIONS}" == "true" ]; then + # run build + time npx igniter -c "ci.igniter.config.mjs" -r "${AIRCRAFT_PROJECT_PREFIX}" "${args[@]}" +else + # run build + time npx igniter -r "${AIRCRAFT_PROJECT_PREFIX}" "${args[@]}" +fi # restore ownership (when run as github action) if [ "${GITHUB_ACTIONS}" == "true" ]; then diff --git a/scripts/fragment_a380x.js b/scripts/fragment_a380x.js index 9dd351e54dd3..d9a8137238b3 100644 --- a/scripts/fragment_a380x.js +++ b/scripts/fragment_a380x.js @@ -9,21 +9,29 @@ const execute = async () => { baseDir: './fbw-a380x/out/flybywire-aircraft-a380-842', outDir: './fbw-a380x/out/build-modules', modules: [ + { + name: 'effects', + sourceDir: './effects', + }, { name: 'html_ui', sourceDir: './html_ui', }, + { + name: 'Sound', + sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/sound', + }, { name: 'Model', sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/model', }, { - name: 'Panels', - sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/panel', + name: 'Textures', + sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/texture', }, { - name: 'Sound', - sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/sound', + name: 'Panels', + sourceDir: './SimObjects/AirPlanes/FlyByWire_A380_842/panel', }, ], }); diff --git a/scripts/setup.sh b/scripts/setup.sh index 6b0e1209c9a1..88cadc0dc44f 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -2,6 +2,15 @@ set -e +# store current file ownership +ORIGINAL_USER_ID=$(stat -c '%u' /external) +ORIGINAL_GROUP_ID=$(stat -c '%g' /external) + +# set ownership to root to fix cargo/rust build (when run as github action) +if [ "${GITHUB_ACTIONS}" == "true" ]; then + chown -R root:root /external +fi + cd /external for arg in "$@"; do @@ -11,4 +20,14 @@ for arg in "$@"; do fi done +if [ "${GITHUB_ACTIONS}" == "true" ]; then :; + else + git submodule init + git submodule update +fi pnpm i + +# restore ownership (when run as github action) +if [ "${GITHUB_ACTIONS}" == "true" ]; then + chown -R ${ORIGINAL_USER_ID}:${ORIGINAL_GROUP_ID} /external +fi