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

1
.gitignore vendored
View File

@@ -21,6 +21,7 @@ _ReSharper.*/
# binaries
mods/*/*.dll
mods/*/*.mdb
mods/*/*.pdb
/*.dll
/*.dll.config
/*.so

View File

@@ -36,7 +36,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<OutputPath>..\</OutputPath>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
@@ -45,7 +45,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>pdbonly</DebugType>
@@ -339,12 +339,28 @@
<Content Include="OpenRA.ico" />
</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">
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)"/>
<!--
We need to copy OpenRA.Game.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)"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)"
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>
-->
<ItemGroup />
</Project>
</Project>

View File

@@ -39,12 +39,6 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<OutputPath>bin\Debug\</OutputPath>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/cnc" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/cnc" 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/cnc" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/cnc" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -119,16 +107,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/cnc/"/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)mods/cnc/"/>
<!--
We need to copy OpenRA.Mods.Cnc.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/cnc/"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)mods/cnc/"
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/cnc/"
copy "$(TargetPath)" "$(SolutionDir)mods/cnc/"
cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@@ -24,12 +24,6 @@
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/common" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/common" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -41,12 +35,6 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/common" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/common" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="FuzzyLogicLibrary">
@@ -787,16 +775,29 @@
<Compile Include="Traits\AutoCarryall.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)mods/common/"
copy "$(TargetPath)" "$(SolutionDir)mods/common/"
cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
<!-- 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/common/"/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)mods/common/"/>
<!--
We need to copy OpenRA.Mods.Common.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/common/"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)mods/common/"
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>
-->
</Project>
</Project>

View File

@@ -39,12 +39,6 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<OutputPath>bin\Debug\</OutputPath>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/d2k" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/d2k" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -59,12 +53,6 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/d2k" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/d2k" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -101,7 +89,6 @@
<Compile Include="Traits\World\D2kEditorResourceLayer.cs" />
<Compile Include="Lint\CheckImportActors.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)mods/d2k/"
copy "$(TargetPath)" "$(SolutionDir)mods/d2k/"
@@ -136,6 +123,30 @@ cd "$(SolutionDir)"</PostBuildEvent>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup />
</Project>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<MakeDir Directories="$(SolutionDir)mods/d2k/"/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)mods/d2k/"/>
<!--
We need to copy OpenRA.Mods.D2k.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/d2k/"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)mods/d2k/"
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>
</Project>

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>

View File

@@ -17,12 +17,6 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/ts" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/ts" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugType>full</DebugType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -37,12 +31,6 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} ../mods/ts" workingdir="${ProjectDir}" />
<Command type="AfterBuild" command="cp ${TargetFile}.mdb ../mods/ts" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -53,7 +41,6 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
@@ -84,16 +71,30 @@
<Compile Include="UtilityCommands\LegacyRulesImporter.cs" />
<Compile Include="UtilityCommands\LegacySequenceImporter.cs" />
</ItemGroup>
<!-- 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>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<MakeDir Directories="$(SolutionDir)mods/ts/"/>
<Copy
SourceFiles="$(TargetPath)"
DestinationFolder="$(SolutionDir)mods/ts/"/>
<!--
We need to copy OpenRA.Mods.TS.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/ts/"
Condition="'$(OS)' == 'Windows_NT'"/>
<Copy
SourceFiles="$(TargetPath).mdb"
DestinationFolder="$(SolutionDir)mods/ts/"
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/ts/"
copy "$(TargetPath)" "$(SolutionDir)mods/ts/"
cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@@ -80,6 +80,8 @@ elseif ($command -eq "clean")
rm *.dll
rm *.dll.config
rm mods/*/*.dll
rm *.pdb
rm mods/*/*.pdb
if (Test-Path thirdparty/download/)
{
rmdir thirdparty/download -Recurse -Force