move assembly references out of common.targets

This commit is contained in:
Jesse Plamondon-Willard 2019-06-18 23:59:30 -04:00
parent 6a951d29ae
commit 904c39eb72
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
5 changed files with 126 additions and 70 deletions

View File

@ -3,79 +3,10 @@
<!--compile constants --> <!--compile constants -->
<PropertyGroup> <PropertyGroup>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
<DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants> <DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<!-- add game references-->
<Choose>
<When Condition="'$(MSBuildProjectName)' == 'SMAPI' OR '$(MSBuildProjectName)' == 'SMAPI.Mods.ConsoleCommands' OR '$(MSBuildProjectName)' == 'SMAPI.Mods.SaveBackup' OR '$(MSBuildProjectName)' == 'SMAPI.Tests'">
<!-- Windows -->
<PropertyGroup>
<!--recognise XNA Framework DLLs in the GAC-->
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
</PropertyGroup>
<ItemGroup Condition="$(OS) == 'Windows_NT'">
<Reference Include="Stardew Valley">
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
<Private Condition="'$(MSBuildProjectName)' != 'SMAPI.Tests'">False</Private>
</Reference>
<Reference Include="StardewValley.GameData">
<HintPath>$(GamePath)\StardewValley.GameData.dll</HintPath>
<Private Condition="'$(MSBuildProjectName)' != 'SMAPI.Tests'">False</Private>
</Reference>
<Reference Include="Netcode">
<HintPath>$(GamePath)\Netcode.dll</HintPath>
<Private Condition="'$(MSBuildProjectName)' != 'SMAPI.Tests'">False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- Linux/Mac -->
<ItemGroup Condition="$(OS) != 'Windows_NT'">
<Reference Include="StardewValley">
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="StardewValley.GameData.MonoGame">
<HintPath>$(GamePath)\StardewValley.GameData.MonoGame.dll</HintPath>
<Private Condition="'$(MSBuildProjectName)' != 'SMAPI.Tests'">False</Private>
</Reference>
<Reference Include="MonoGame.Framework">
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- common -->
<ItemGroup>
<Reference Include="GalaxyCSharp">
<HintPath>$(GamePath)\GalaxyCSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lidgren.Network">
<HintPath>$(GamePath)\Lidgren.Network.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="xTile">
<HintPath>$(GamePath)\xTile.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors --> <!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
<Target Name="ValidateInstallPath" AfterTargets="BeforeBuild"> <Target Name="ValidateInstallPath" AfterTargets="BeforeBuild">
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a &lt;GamePath&gt; setting with the full directory path containing the Stardew Valley executable." /> <Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a &lt;GamePath&gt; setting with the full directory path containing the Stardew Valley executable." />

View File

@ -17,6 +17,55 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="$(GameExecutableName)">
<HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<Choose>
<!-- Windows -->
<When Condition="$(OS) == 'Windows_NT'">
<ItemGroup>
<Reference Include="StardewValley.GameData">
<HintPath>$(GamePath)\StardewValley.GameData.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Netcode">
<HintPath>$(GamePath)\Netcode.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
<!-- Linux/Mac -->
<Otherwise>
<ItemGroup>
<Reference Include="StardewValley.GameData.MonoGame">
<HintPath>$(GamePath)\StardewValley.GameData.MonoGame.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoGame.Framework">
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Compile Include="..\..\build\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link> <Link>Properties\GlobalAssemblyInfo.cs</Link>

View File

@ -17,6 +17,13 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="$(GameExecutableName)">
<HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Compile Include="..\..\build\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link> <Link>Properties\GlobalAssemblyInfo.cs</Link>

View File

@ -25,6 +25,13 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0" /> <PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="$(GameExecutableName)">
<HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Compile Include="..\..\build\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link> <Link>Properties\GlobalAssemblyInfo.cs</Link>

View File

@ -23,6 +23,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="$(GameExecutableName)">
<HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Numerics"> <Reference Include="System.Numerics">
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
@ -32,6 +36,64 @@
<Reference Include="System.Windows.Forms" Condition="$(OS) == 'Windows_NT'" /> <Reference Include="System.Windows.Forms" Condition="$(OS) == 'Windows_NT'" />
</ItemGroup> </ItemGroup>
<Choose>
<!-- Windows -->
<When Condition="$(OS) == 'Windows_NT'">
<ItemGroup>
<Reference Include="StardewValley.GameData">
<HintPath>$(GamePath)\StardewValley.GameData.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Netcode">
<HintPath>$(GamePath)\Netcode.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
<!-- Linux/Mac -->
<Otherwise>
<ItemGroup>
<Reference Include="StardewValley.GameData.MonoGame">
<HintPath>$(GamePath)\StardewValley.GameData.MonoGame.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoGame.Framework">
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Otherwise>
</Choose>
<!-- common -->
<ItemGroup>
<Reference Include="GalaxyCSharp">
<HintPath>$(GamePath)\GalaxyCSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lidgren.Network">
<HintPath>$(GamePath)\Lidgren.Network.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="xTile">
<HintPath>$(GamePath)\xTile.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SMAPI.Toolkit.CoreInterfaces\SMAPI.Toolkit.CoreInterfaces.csproj" /> <ProjectReference Include="..\SMAPI.Toolkit.CoreInterfaces\SMAPI.Toolkit.CoreInterfaces.csproj" />
<ProjectReference Include="..\SMAPI.Toolkit\SMAPI.Toolkit.csproj" /> <ProjectReference Include="..\SMAPI.Toolkit\SMAPI.Toolkit.csproj" />