TS csproj: Use MSBuild tasks instead of shelling out

This commit is contained in:
Taryn Hill
2016-09-04 18:35:30 -05:00
parent 1cfe9ed512
commit cacb2a304a

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>