@@ -73,7 +73,7 @@ class DaisyExporter final : public ExporterBase {
7373
7474 flashButton.onClick = [this ] {
7575 auto const tempFolder = File::getSpecialLocation (File::tempDirectory).getChildFile (" Heavy-" + Uuid ().toString ().substring (10 ));
76- Toolchain:: deleteTempFileLater (tempFolder);
76+ deleteTempFileLater (tempFolder);
7777 startExport (tempFolder);
7878 };
7979
@@ -82,10 +82,10 @@ class DaisyExporter final : public ExporterBase {
8282 exportingView->monitorProcessOutput (this );
8383 exportingView->showState (ExportingProgressView::Flashing);
8484
85- auto const bin = Toolchain::dir .getChildFile (" bin" );
85+ auto const bin = toolchainDir .getChildFile (" bin" );
8686 auto const make = bin.getChildFile (" make" + exeSuffix);
8787 auto const & gccPath = bin.getFullPathName ();
88- auto const sourceDir = Toolchain::dir .getChildFile (" lib" ).getChildFile (" libdaisy" ).getChildFile (" core" );
88+ auto const sourceDir = toolchainDir .getChildFile (" lib" ).getChildFile (" libdaisy" ).getChildFile (" core" );
8989
9090 int const result = flashBootloader (bin, sourceDir, make, gccPath);
9191
@@ -218,7 +218,7 @@ class DaisyExporter final : public ExporterBase {
218218 + pathToString (make) + " program-boot"
219219 + " GCC_PATH=" + gccPath;
220220
221- Toolchain:: startShellScript (bootloaderScript, this );
221+ startShellScript (bootloaderScript);
222222
223223 waitForProcessToFinish (-1 );
224224 exportingView->flushConsole ();
@@ -262,7 +262,7 @@ class DaisyExporter final : public ExporterBase {
262262 if (board == " custom" ) {
263263 metaDaisy.getDynamicObject ()->setProperty (" board_file" , customBoardDefinition.getFullPathName ());
264264 } else if (extra_boards.contains (board)) {
265- metaDaisy.getDynamicObject ()->setProperty (" board_file" , Toolchain::dir .getChildFile (" etc" ).getChildFile (board + " .json" ).getFullPathName ());
265+ metaDaisy.getDynamicObject ()->setProperty (" board_file" , toolchainDir .getChildFile (" etc" ).getChildFile (board + " .json" ).getFullPathName ());
266266 } else {
267267 metaDaisy.getDynamicObject ()->setProperty (" board" , board);
268268 }
@@ -301,15 +301,15 @@ class DaisyExporter final : public ExporterBase {
301301 } else if (size == 3 ) {
302302 metaDaisy.getDynamicObject ()->setProperty (
303303 " linker_script" ,
304- Toolchain::dir .getChildFile (" etc" ).getChildFile (" linkers" ).getChildFile (" sram_linker_sdram.lds" ).getFullPathName ());
304+ toolchainDir .getChildFile (" etc" ).getChildFile (" linkers" ).getChildFile (" sram_linker_sdram.lds" ).getFullPathName ());
305305 metaDaisy.getDynamicObject ()->setProperty (" bootloader" , " BOOT_SRAM" );
306306 } else if (size == 4 ) {
307307 metaDaisy.getDynamicObject ()->setProperty (" linker_script" , " ../../libdaisy/core/STM32H750IB_qspi.lds" );
308308 metaDaisy.getDynamicObject ()->setProperty (" bootloader" , " BOOT_QSPI" );
309309 } else if (size == 5 ) {
310310 metaDaisy.getDynamicObject ()->setProperty (
311311 " linker_script" ,
312- Toolchain::dir .getChildFile (" etc" ).getChildFile (" linkers" ).getChildFile (" qspi_linker_sdram.lds" ).getFullPathName ());
312+ toolchainDir .getChildFile (" etc" ).getChildFile (" linkers" ).getChildFile (" qspi_linker_sdram.lds" ).getFullPathName ());
313313 metaDaisy.getDynamicObject ()->setProperty (" bootloader" , " BOOT_QSPI" );
314314 } else if (size == 6 ) {
315315 metaDaisy.getDynamicObject ()->setProperty (" linker_script" , customLinker.getFullPathName ());
@@ -333,8 +333,8 @@ class DaisyExporter final : public ExporterBase {
333333 }
334334
335335 auto const command = args.joinIntoString (" " );
336- exportingView-> logToConsole ( " Command: " + command + " \n " );
337- Toolchain::startShellScript (command, this );
336+ startShellScript ( command);
337+
338338 waitForProcessToFinish (-1 );
339339 exportingView->flushConsole ();
340340
@@ -353,8 +353,8 @@ class DaisyExporter final : public ExporterBase {
353353 metaJsonFile.copyFileTo (outputFile.getChildFile (" meta.json" ));
354354
355355 if (compile) {
356- auto bin = Toolchain::dir .getChildFile (" bin" );
357- auto libDaisy = Toolchain::dir .getChildFile (" lib" ).getChildFile (" libdaisy" );
356+ auto bin = toolchainDir .getChildFile (" bin" );
357+ auto libDaisy = toolchainDir .getChildFile (" lib" ).getChildFile (" libdaisy" );
358358 auto make = bin.getChildFile (" make" + exeSuffix);
359359 auto compiler = bin.getChildFile (" arm-none-eabi-gcc" + exeSuffix);
360360
@@ -371,17 +371,22 @@ class DaisyExporter final : public ExporterBase {
371371 sourceDir.getChildFile (" build" ).createDirectory ();
372372 auto const & gccPath = pathToString (bin);
373373
374+ // Bit hacky, but the only way to get colour coding on daisy builds for Windows
375+ #if JUCE_WINDOWS
376+ sourceDir.getChildFile (" Makefile" ).appendText (" \n CFLAGS += -fdiagnostics-color=always" );
377+ #endif
378+
374379 auto buildScript = pathToString (make)
375380 + " -j4 -f "
376381 + pathToString (sourceDir.getChildFile (" Makefile" )).quoted ()
377382#if JUCE_WINDOWS
378- + " SHELL=" + pathToString (Toolchain::dir .getChildFile (" bin" ).getChildFile (" bash.exe" )).quoted ()
383+ + " SHELL=" + pathToString (toolchainDir .getChildFile (" bin" ).getChildFile (" bash.exe" )).quoted ()
379384#endif
380385 + " GCC_PATH="
381386 + gccPath
382387 + " PROJECT_NAME=" + name;
383388
384- Toolchain:: startShellScript (buildScript, this );
389+ startShellScript (buildScript);
385390
386391 waitForProcessToFinish (-1 );
387392 exportingView->flushConsole ();
@@ -416,8 +421,7 @@ class DaisyExporter final : public ExporterBase {
416421 String testBootloaderScript = " export PATH=\" " + bin.getFullPathName () + " :$PATH\"\n "
417422 + dfuUtil.getFullPathName () + " -l " ;
418423
419- Toolchain runTest;
420- auto output = runTest.startShellScriptWithOutput (testBootloaderScript);
424+ auto output = startShellScriptWithOutput (testBootloaderScript);
421425 if (output.contains (" alt=1" )) {
422426 exportingView->logToConsole (" Bootloader not found...\n " );
423427 bootloaderExitCode = flashBootloader (bin, sourceDir, make, gccPath);
@@ -434,7 +438,7 @@ class DaisyExporter final : public ExporterBase {
434438 + " GCC_PATH=" + gccPath
435439 + " PROJECT_NAME=" + name;
436440
437- Toolchain:: startShellScript (flashScript, this );
441+ startShellScript (flashScript);
438442
439443 waitForProcessToFinish (-1 );
440444 exportingView->flushConsole ();
@@ -456,7 +460,7 @@ class DaisyExporter final : public ExporterBase {
456460 } else {
457461 auto outputFile = File (outdir);
458462
459- auto libDaisy = Toolchain::dir .getChildFile (" lib" ).getChildFile (" libdaisy" );
463+ auto libDaisy = toolchainDir .getChildFile (" lib" ).getChildFile (" libdaisy" );
460464 libDaisy.copyDirectoryTo (outputFile.getChildFile (" libdaisy" ));
461465
462466 outputFile.getChildFile (" ir" ).deleteRecursively ();
0 commit comments