Fix and simplify PostBuild file moving
This commit is contained in:
parent
41e7c04678
commit
b654d4a2ac
|
@ -1,8 +1,11 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Import Project="MainSlnCommon.props" />
|
<Import Project="MainSlnCommon.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputPath>$(MSBuildProjectDirectory)/../../output</OutputPath>
|
<OutputPath>$(MSBuildProjectDirectory)/../../output/</OutputPath>
|
||||||
<ProjectNameTail>$(MSBuildProjectName.Substring($([MSBuild]::Add($(MSBuildProjectName.LastIndexOf('.')), 1))))</ProjectNameTail>
|
<!-- Setting TargetFileName does not change the AssemblyName (as setting TargetName would), but also does not change the output file name
|
||||||
|
for the executable on build (as one would expect). So we still need to rename the executable file below. Using this method has the advantage
|
||||||
|
of IDEs respecting the TargetFileName and expecting it. -->
|
||||||
|
<TargetFileName>$(MSBuildProjectName.Substring($([MSBuild]::Add($(MSBuildProjectName.LastIndexOf('.')), 1)))).exe</TargetFileName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -12,13 +15,9 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ExecutableAndConfigFromExecProj Include="$(OutputPath)$(MSBuildProjectName).exe*" />
|
|
||||||
<NotExecFilesFromExecProj Include="$(OutputPath)*.deps.json" />
|
|
||||||
<NotExecFilesFromExecProj Include="$(OutputPath)*.dll" />
|
<NotExecFilesFromExecProj Include="$(OutputPath)*.dll" />
|
||||||
<NotExecFilesFromExecProj Include="$(OutputPath)*.pdb" Exclude="$(OutputPath)EmuHawk.pdb;$(OutputPath)DiscoHawk.pdb" />
|
|
||||||
<NotExecFilesFromExecProj Include="$(OutputPath)*.xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Move Condition=" $(IsTargetingNetFramework) " SourceFiles="@(NotExecFilesFromExecProj)" DestinationFolder="$(OutputPath)dll/" />
|
<Move SourceFiles="@(NotExecFilesFromExecProj)" DestinationFolder="$(OutputPath)dll/" />
|
||||||
<Move SourceFiles="@(ExecutableAndConfigFromExecProj)" DestinationFiles="@(ExecutableAndConfigFromExecProj->Replace($(MSBuildProjectName), $(ProjectNameTail)))" /> <!-- keep assembly name as e.g. `BizHawk.Client.EmuHawk`, but rename file to simply `EmuHawk.exe` as we've been doing -->
|
<Move SourceFiles="$(OutputPath)$(MSBuildProjectName).exe" DestinationFiles="$(OutputPath)$(TargetFileName)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue