Skip to content

Commit d21e286

Browse files
committed
chore(build): suppress redundant error messages and respect ElectronSkipExecCommands in logging
- Remove redundant "Electron setup/installation failed!" messages that duplicate MSBuild's built-in error reporting - Add ElectronSkipExecCommands condition to Message tasks to prevent logging when commands are skipped - Increase electron install timeout from 600000ms to 1800000ms for Electron 42+ to accommodate slower installations
1 parent 3705509 commit d21e286

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

src/ElectronNET/build/ElectronNET.LateImport.targets

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,29 +450,25 @@
450450

451451
<!--<Message Importance="High" Text="ElectronConfigureApp: CopiedFiles - @(_CopiedFiles)" />-->
452452

453-
<Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="@(_CopiedFiles->Count()) > 0" />
453+
<Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="'$(ElectronSkipExecCommands)' != 'true' AND @(_CopiedFiles->Count()) > 0" />
454454

455455
<Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="600000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="'$(ElectronSkipExecCommands)' != 'true' AND @(_CopiedFiles->Count()) > 0">
456456
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
457457
</Exec>
458458

459-
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
460-
461459
<PropertyGroup>
462460
<_NpmCmd>node node_modules/electron/install.js</_NpmCmd>
463461
<!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) -->
464462
<_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd>
465463
<_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd>
466464
</PropertyGroup>
467465

468-
<Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="$(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0" />
466+
<Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="'$(ElectronSkipExecCommands)' != 'true' AND $(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0" />
469467

470-
<Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="600000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="$(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0">
468+
<Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="1800000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="'$(ElectronSkipExecCommands)' != 'true' AND $(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0">
471469
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
472470
</Exec>
473471

474-
<Message Importance="High" Text="Electron installation failed!" Condition="'$(ExecExitCode)' != '0'" />
475-
476472
<!-- Fix up incorrect symlinks created by npm on Windows when targeting macOS -->
477473
<PropertyGroup>
478474
<_ElectronFrameworksDir>$(ElectronOutDir)node_modules\electron\dist\Electron.app\Contents\Frameworks</_ElectronFrameworksDir>
@@ -610,8 +606,6 @@ For more information, see: https://github.com/ElectronNET/Electron.NET/wiki/Migr
610606
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
611607
</Exec>
612608

613-
<Message Importance="High" Text="Electron app dependency install failed!" Condition="'$(ExecExitCode)' != '0'" />
614-
615609
<!-- Install electron-builder (the dev tool) into the publish root, which is the
616610
electron-builder projectDir (cwd). app metadata + runtime deps are read from
617611
app\ via directories.app (standard electron-builder two-package.json layout).
@@ -640,8 +634,6 @@ For more information, see: https://github.com/ElectronNET/Electron.NET/wiki/Migr
640634
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
641635
</Exec>
642636

643-
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
644-
645637
<!-- Transform ElectronPublishUrlFullPath to a wslpath if IsLinuxWsl is true -->
646638
<Exec Command="wsl wslpath '$(ElectronPublishUrlFullPath)'" ConsoleToMsBuild="true" Condition="'$(IsLinuxWsl)' == 'true'">
647639
<Output TaskParameter="ConsoleOutput" PropertyName="ElectronPublishUrlFullPath" />
@@ -668,7 +660,6 @@ For more information, see: https://github.com/ElectronNET/Electron.NET/wiki/Migr
668660
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
669661
</Exec>
670662

671-
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
672663

673664
</Target>
674665

0 commit comments

Comments
 (0)