Revisit content assembly copying, now much neater.

This commit is contained in:
Pieter-Jan Briers
2017-08-07 00:31:11 +02:00
parent 4454525e6d
commit 133763c43c
3 changed files with 25 additions and 48 deletions

View File

@@ -11,6 +11,7 @@
<AssemblyName>Content.Client</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ContentAssemblyTarget>..\bin\Client\Assemblies\</ContentAssemblyTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -74,24 +75,13 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Choose>
<When Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">
<PropertyGroup>
<PostBuildEvent>
if not exist "..\Client\Assemblies" (
mkdir ..\Client\Assemblies\
)
copy Content.* ..\Client\Assemblies\ > NUL
</PostBuildEvent>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PostBuildEvent>
mkdir -p ../Client/Assemblies/
cp Content.* ../Client/Assemblies/
</PostBuildEvent>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="..\SS14.Content.targets" />
<Target Name="AfterBuild" DependsOnTargets="CopyContentAssemblies" />
<ItemGroup>
<!-- Files to be copied into Client/Assemblies -->
<ContentAssemblies Include="$(OutputPath)Content.Client.dll" />
<ContentAssemblies Include="$(OutputPath)Content.Shared.dll" />
<ContentAssemblies Include="$(OutputPath)Content.Client.pdb" Condition="'$(Configuration)' == 'Debug'" />
<ContentAssemblies Include="$(OutputPath)Content.Shared.pdb" Condition="'$(Configuration)' == 'Debug'" />
</ItemGroup>
</Project>

View File

@@ -11,13 +11,10 @@
<AssemblyName>Content.Server</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ContentAssemblyTarget>..\bin\Server\Assemblies\</ContentAssemblyTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<!--
This copies all dependencies,
but on the plus side it's automatically located in the right place.
-->
<OutputPath>..\bin\Content.Server\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
@@ -26,10 +23,6 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<!--
This copies all dependencies,
but on the plus side it's automatically located in the right place.
-->
<OutputPath>..\bin\Content.Server\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
@@ -70,24 +63,12 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Choose>
<When Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">
<PropertyGroup>
<PostBuildEvent>
if not exist "..\Server\Assemblies" (
mkdir ..\Server\Assemblies\
)
copy Content.* ..\Server\Assemblies\ > NUL
</PostBuildEvent>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PostBuildEvent>
mkdir -p ../Server/Assemblies/
cp Content.* ../Server/Assemblies/
</PostBuildEvent>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="..\SS14.Content.targets" />
<Target Name="AfterBuild" DependsOnTargets="CopyContentAssemblies" />
<ItemGroup>
<ContentAssemblies Include="$(OutputPath)Content.Server.dll" />
<ContentAssemblies Include="$(OutputPath)Content.Shared.dll" />
<ContentAssemblies Include="$(OutputPath)Content.Server.pdb" Condition="'$(Configuration)' == 'Debug'" />
<ContentAssemblies Include="$(OutputPath)Content.Shared.pdb" Condition="'$(Configuration)' == 'Debug'" />
</ItemGroup>
</Project>

6
SS14.Content.targets Normal file
View File

@@ -0,0 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Common target to copy content assemblies to the parent projects. -->
<Target Name="CopyContentAssemblies">
<Copy SourceFiles="@(ContentAssemblies)" DestinationFolder="$(ContentAssemblyTarget)" />
</Target>
</Project>