Files
2026-02-27 11:26:57 +07:00

54 lines
2.6 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<Platforms>x64</Platforms>
<OutputType>WinExe</OutputType>
<AssemblyName>TimeMocker</AssemblyName>
<RootNamespace>TimeMocker.UI</RootNamespace>
<UseWindowsForms>true</UseWindowsForms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyHook" Version="2.7.7097.0"/>
<PackageReference Include="System.Text.Json" Version="8.0.5"/>
</ItemGroup>
<!-- Build both x86 and x64 versions of the hook DLL and copy with architecture suffix -->
<Target Name="BuildAllHookDlls" AfterTargets="Build" DependsOnTargets="_BuildX64Hook;_BuildX86Hook;_CopyHookDlls">
</Target>
<Target Name="_BuildX64Hook">
<MSBuild Projects="$(SolutionDir)TimeMocker.Hook\TimeMocker.Hook.csproj"
Properties="Platform=x64;Configuration=$(Configuration)"
Targets="Build"
RunEachTargetSeparately="true" />
</Target>
<Target Name="_BuildX86Hook">
<MSBuild Projects="$(SolutionDir)TimeMocker.Hook\TimeMocker.Hook.csproj"
Properties="Platform=x86;Configuration=$(Configuration)"
Targets="Build"
RunEachTargetSeparately="true" />
</Target>
<Target Name="_CopyHookDlls" DependsOnTargets="_BuildX64Hook;_BuildX86Hook">
<PropertyGroup>
<HookBuildDir>$(SolutionDir)TimeMocker.Hook\bin\</HookBuildDir>
<X64DllPath>$(HookBuildDir)x64\$(Configuration)\net48\TimeMocker.Hook.dll</X64DllPath>
<X86DllPath>$(HookBuildDir)x86\$(Configuration)\net48\TimeMocker.Hook.dll</X86DllPath>
<X64Dest>$(OutputPath)TimeMocker.Hook.x64.dll</X64Dest>
<X86Dest>$(OutputPath)TimeMocker.Hook.x86.dll</X86Dest>
</PropertyGroup>
<!-- Copy x64 version with x64 suffix -->
<Copy SourceFiles="$(X64DllPath)"
DestinationFiles="$(X64Dest)"
SkipUnchangedFiles="true" />
<!-- Copy x86 version with x86 suffix -->
<Copy SourceFiles="$(X86DllPath)"
DestinationFiles="$(X86Dest)"
SkipUnchangedFiles="true" />
</Target>
<!-- Clean the renamed DLLs as well -->
<Target Name="CleanRenamedHookDlls" AfterTargets="Clean">
<Delete Files="$(OutputPath)TimeMocker.Hook.x64.dll" TreatErrorsAsWarnings="true" />
<Delete Files="$(OutputPath)TimeMocker.Hook.x86.dll" TreatErrorsAsWarnings="true" />
</Target>
</Project>