From 5843e8e6d5bb4ea0850d23378a01f313ccaa7569 Mon Sep 17 00:00:00 2001 From: Michael Corcoran Date: Sat, 6 Jan 2024 03:04:54 +1300 Subject: [PATCH] fix(build): nd dependencies (#8384) * fix(build): nd dependencies * fix(build): a380x too --- .../instruments/buildSrc/igniter/tasks.mjs | 22 +++++++++++-------- .../systems/instruments/src/ND/config.json | 5 ++++- .../instruments/buildSrc/igniter/tasks.mjs | 22 +++++++++++-------- .../systems/instruments/src/ND/config.json | 5 ++++- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs b/fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs index b46ce859973..82cdd1e3665 100644 --- a/fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs +++ b/fbw-a32nx/src/systems/instruments/buildSrc/igniter/tasks.mjs @@ -7,13 +7,17 @@ export function getInstrumentsIgniterTasks() { const baseInstruments = fs.readdirSync(join(Directories.instruments, 'src'), { withFileTypes: true }) .filter((d) => d.isDirectory() && fs.existsSync(join(Directories.instruments, 'src', d.name, 'config.json'))); - return baseInstruments.map(({ name }) => new ExecTask( - name, - `cd fbw-a32nx && mach build -f ${name}`, - [ - join('fbw-a32nx/src/systems/instruments/src', name), - 'fbw-a32nx/src/systems/instruments/src/Common', - join('fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX', name), - ], - )); + return baseInstruments.map(({ name }) => { + const config = JSON.parse(fs.readFileSync(join(Directories.instruments, 'src', name, 'config.json'))); + return new ExecTask( + name, + `cd fbw-a32nx && mach build -f ${name}`, + [ + join('fbw-a32nx/src/systems/instruments/src', name), + 'fbw-a32nx/src/systems/instruments/src/Common', + join('fbw-a32nx/out/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX', name), + ...(config.extraDeps || []), + ], + ); + }); } diff --git a/fbw-a32nx/src/systems/instruments/src/ND/config.json b/fbw-a32nx/src/systems/instruments/src/ND/config.json index ade492578f8..c99f13d05c9 100644 --- a/fbw-a32nx/src/systems/instruments/src/ND/config.json +++ b/fbw-a32nx/src/systems/instruments/src/ND/config.json @@ -1,4 +1,7 @@ { "index": "./instrument.tsx", - "isInteractive": false + "isInteractive": false, + "extraDeps": [ + "fbw-common/src/systems/instruments/src/ND" + ] } diff --git a/fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs b/fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs index edf671ff0d8..8ee02edc681 100644 --- a/fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs +++ b/fbw-a380x/src/systems/instruments/buildSrc/igniter/tasks.mjs @@ -7,13 +7,17 @@ export function getInstrumentsIgniterTasks() { const baseInstruments = fs.readdirSync(join(Directories.instruments, 'src'), { withFileTypes: true }) .filter((d) => d.isDirectory() && fs.existsSync(join(Directories.instruments, 'src', d.name, 'config.json'))); - return baseInstruments.map(({ name }) => new ExecTask( - name, - `cd fbw-a380x && mach build -f ${name}`, - [ - join('fbw-a380x/src/systems/instruments/src', name), - 'fbw-a380x/src/systems/instruments/src/Common', - join('fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X', name), - ], - )); + return baseInstruments.map(({ name }) => { + const config = JSON.parse(fs.readFileSync(join(Directories.instruments, 'src', name, 'config.json'))); + return new ExecTask( + name, + `cd fbw-a380x && mach build -f ${name}`, + [ + join('fbw-a380x/src/systems/instruments/src', name), + 'fbw-a380x/src/systems/instruments/src/Common', + join('fbw-a380x/out/flybywire-aircraft-a380-842/html_ui/Pages/VCockpit/Instruments/A380X', name), + ...(config.extraDeps || []), + ], + ); + }); } diff --git a/fbw-a380x/src/systems/instruments/src/ND/config.json b/fbw-a380x/src/systems/instruments/src/ND/config.json index ade492578f8..c99f13d05c9 100644 --- a/fbw-a380x/src/systems/instruments/src/ND/config.json +++ b/fbw-a380x/src/systems/instruments/src/ND/config.json @@ -1,4 +1,7 @@ { "index": "./instrument.tsx", - "isInteractive": false + "isInteractive": false, + "extraDeps": [ + "fbw-common/src/systems/instruments/src/ND" + ] }