Merge pull request #11973 from Phrohdoh/csproj-afterbuild-targets

Fix AfterBuild tasks in csprojs
This commit is contained in:
Paul Chote
2016-10-11 02:51:47 +01:00
committed by GitHub
8 changed files with 152 additions and 118 deletions

View File

@@ -39,12 +39,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/ra" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/ra" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
@@ -58,12 +52,6 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/ra" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/ra" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -148,16 +136,29 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
<MakeDir Directories="$(SolutionDir)mods/ra/"/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)mods/ra/"/>
<!--
We need to copy OpenRA.Mods.RA.pdb (not `.dll.pdb`). This is only necessary on Windows.
Mono outputs a `.dll.mdb` so we can just append `.mdb` directly.
-->
<Copy
SourceFiles="$(TargetDir)$(TargetName).pdb"
DestinationFolder="$(SolutionDir)mods/ra/"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)mods/ra/"
Condition="'$(OS)' == 'Unix'"/>
<!-- Uncomment these lines when debugging or adding to this target
<Message Text="DEBUG OS: $(OS)"/>
<Message Text="DEBUG SolutionDir: $(SolutionDir)"/>
<Message Text="DEBUG TargetPath: $(TargetPath)"/>
<Message Text="DEBUG TargetDir: $(TargetDir)"/>
<Message Text="DEBUG TargetName: $(TargetName)"/>
-->
</Target>
-->
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)mods/ra/"
copy "$(TargetPath)" "$(SolutionDir)mods/ra/"
cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>