Skip to content

Commit f323148

Browse files
committed
build: fix WatchDog build
1 parent 82613ea commit f323148

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/Everywhere.Watchdog/Everywhere.Watchdog.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<PublishAot>true</PublishAot>
6+
<SelfContained>true</SelfContained>
67
<OptimizationPreference>Size</OptimizationPreference>
78
</PropertyGroup>
89

src/Everywhere.Windows/Everywhere.Windows.csproj

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@
1111
<ApplicationManifest>app.manifest</ApplicationManifest>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<WatchdogProject>..\Everywhere.Watchdog\Everywhere.Watchdog.csproj</WatchdogProject>
16+
<WatchdogOutDir>$(MSBuildThisFileDirectory)$(WatchdogProject)\..\bin\$(Configuration)\net9.0\win-x64\publish\</WatchdogOutDir>
17+
<WatchdogExecutable>$(WatchdogOutDir)Everywhere.Watchdog.exe</WatchdogExecutable>
18+
</PropertyGroup>
19+
1420
<ItemGroup>
1521
<PackageReference Include="Avalonia.Desktop"/>
1622
<PackageReference Include="HotAvalonia" PrivateAssets="All"/>
1723
<PackageReference Include="Microsoft.PowerShell.SDK"/>
1824
<PackageReference Include="Microsoft.Windows.CsWin32"/>
1925
<PackageReference Include="FlaUI.UIA3"/>
20-
<PackageReference Include="SkiaSharp" />
21-
<PackageReference Include="SkiaSharp.NativeAssets.Win32" />
26+
<PackageReference Include="SkiaSharp"/>
27+
<PackageReference Include="SkiaSharp.NativeAssets.Win32"/>
2228
<PackageReference Include="Vortice.Direct3D11"/>
2329
<PackageReference Include="Vortice.DirectComposition"/>
2430
</ItemGroup>
@@ -31,10 +37,16 @@
3137
<None Include="..\..\img\Everywhere.ico">
3238
<Link>Everywhere.ico</Link>
3339
</None>
40+
<Content Include="$(WatchdogExecutable)">
41+
<Link>Everywhere.Watchdog.exe</Link>
42+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
43+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
44+
</Content>
3445
</ItemGroup>
3546

36-
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
37-
<Exec Command="dotnet publish -c $(Configuration) -r win-x64 ..\Everywhere.Watchdog\Everywhere.Watchdog.csproj -o ..\Everywhere.Watchdog\bin\$(Configuration)\publish --no-restore"/>
38-
<Exec Command="xcopy /Y /I ..\Everywhere.Watchdog\bin\$(Configuration)\publish\Everywhere.Watchdog.exe $(OutDir)"/>
47+
<Target Name="BuildWatchdog" BeforeTargets="BeforeBuild" Inputs="$(WatchdogProject)" Outputs="$(WatchdogExecutable)">
48+
<Message Text="Watchdog executable is out-of-date. Building..." Importance="high"/>
49+
<Exec Command="dotnet restore &quot;$(WatchdogProject)&quot; -r win-x64"/>
50+
<Exec Command="dotnet publish &quot;$(WatchdogProject)&quot; -c $(Configuration) -r win-x64 --self-contained -o &quot;$(WatchdogOutDir)&quot; --no-restore"/>
3951
</Target>
4052
</Project>

0 commit comments

Comments
 (0)