use copy/delete task instead of shell command because it's faster

This commit is contained in:
JohnCorby 2022-02-24 20:57:09 -08:00
parent 90c91571d4
commit 05ea4fa1c3

View File

@ -8,43 +8,61 @@
</PropertyGroup>
<Target Name="clean before building" BeforeTargets="PreBuildEvent">
<Exec Command="del /f /q &quot;$(OutputPath)\*.dll&quot;" IgnoreExitCode="true" />
<Exec Command="del /f /q &quot;$(OutputPath)\*.exe&quot;" IgnoreExitCode="true" />
<Exec Command="del /f /q &quot;$(OutputPath)\*.pdb&quot;" IgnoreExitCode="true" />
<Exec Command="del /f /q &quot;$(OutputPath)\AssetBundles\*&quot;" IgnoreExitCode="true" />
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(OutputPath)\*.dll" />
<_Files Include="$(OutputPath)\*.exe" />
<_Files Include="$(OutputPath)\*.pdb" />
<_Files Include="$(OutputPath)\AssetBundles\*" />
</ItemGroup>
<Delete Files="@(_Files)" />
</Target>
<Target Name="clean after building" AfterTargets="PostBuildEvent">
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(OutputPath)\*.exe.config" />
</ItemGroup>
<Delete Files="@(_Files)" />
</Target>
<Target Name="weave qsb" AfterTargets="PostBuildEvent">
<Exec Command="&quot;..\MirrorWeaver\bin\$(Configuration)\MirrorWeaver&quot; &quot;$(TargetPath)&quot; ..\GameDlls" />
</Target>
<PropertyGroup>
<GameDllsDir Condition="Exists('$(GameDir)')">$(GameDir)\OuterWilds_Data\Managed</GameDllsDir>
<UnityDllsDir Condition="Exists('$(UnityAssetsDir)')">$(UnityAssetsDir)\Dlls</UnityDllsDir>
</PropertyGroup>
<Target Name="remove dumb files" AfterTargets="PostBuildEvent">
<Exec Command="del /f /q &quot;$(OutputPath)\*.exe.config&quot;" />
</Target>
<Target Name="weave qsb" AfterTargets="PostBuildEvent">
<Exec Command="&quot;..\MirrorWeaver\bin\$(Configuration)\MirrorWeaver&quot; &quot;$(TargetPath)&quot; ..\GameDlls" />
</Target>
<Target Name="copy dlls to unity" AfterTargets="PostBuildEvent" Condition="Exists('$(UnityDllsDir)') and Exists('$(GameDllsDir)')">
<Exec Command="del /f /q &quot;$(UnityDllsDir)\*.dll&quot;" />
<Exec Command="del /f /q &quot;$(UnityDllsDir)\*.exe&quot;" />
<Exec Command="del /f /q &quot;$(UnityDllsDir)\*.pdb&quot;" />
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(UnityDllsDir)\*.dll" />
<_Files Include="$(UnityDllsDir)\*.exe" />
<_Files Include="$(UnityDllsDir)\*.pdb" />
</ItemGroup>
<Delete Files="@(_Files)" />
<Exec Command="copy /y &quot;$(OutputPath)\*.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(OutputPath)\*.exe&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(OutputPath)\*.pdb&quot; &quot;$(UnityDllsDir)&quot;" IgnoreExitCode="true" />
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(OutputPath)\*.dll" />
<_Files Include="$(OutputPath)\*.exe" />
<_Files Include="$(OutputPath)\*.pdb" />
<Exec Command="copy /y &quot;$(GameDllsDir)\Assembly-CSharp*.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\Unity.InputSystem.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\UnityEngine.UI.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\EOS-SDK.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\UniSense.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\Autofac.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\Newtonsoft.Json.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\0Harmony.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\MonoMod*.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\Mono.Cecil.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\OWML*.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<Exec Command="copy /y &quot;$(GameDllsDir)\NAudio-Unity.dll&quot; &quot;$(UnityDllsDir)&quot;" />
<_Files Include="$(GameDllsDir)\Assembly-CSharp*.dll" />
<_Files Include="$(GameDllsDir)\Unity.InputSystem.dll" />
<_Files Include="$(GameDllsDir)\UnityEngine.UI.dll" />
<_Files Include="$(GameDllsDir)\EOS-SDK.dll" />
<_Files Include="$(GameDllsDir)\UniSense.dll" />
<_Files Include="$(GameDllsDir)\Autofac.dll" />
<_Files Include="$(GameDllsDir)\Newtonsoft.Json.dll" />
<_Files Include="$(GameDllsDir)\0Harmony.dll" />
<_Files Include="$(GameDllsDir)\MonoMod*.dll" />
<_Files Include="$(GameDllsDir)\Mono.Cecil.dll" />
<_Files Include="$(GameDllsDir)\OWML*.dll" />
<_Files Include="$(GameDllsDir)\NAudio-Unity.dll" />
</ItemGroup>
<Copy SourceFiles="@(_Files)" DestinationFolder="$(UnityDllsDir)" />
</Target>
<ItemGroup>