diff options
-rw-r--r-- | build/common.targets | 71 | ||||
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj | 49 | ||||
-rw-r--r-- | src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj | 7 | ||||
-rw-r--r-- | src/SMAPI.Tests/SMAPI.Tests.csproj | 7 | ||||
-rw-r--r-- | src/SMAPI/SMAPI.csproj | 62 |
5 files changed, 126 insertions, 70 deletions
diff --git a/build/common.targets b/build/common.targets index 6bf1305e..abcf2d87 100644 --- a/build/common.targets +++ b/build/common.targets @@ -3,79 +3,10 @@ <!--compile constants --> <PropertyGroup> + <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths> <DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);SMAPI_FOR_WINDOWS</DefineConstants> </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 --> <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 <GamePath> setting with the full directory path containing the Stardew Valley executable." /> diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index 13f92443..6cceb22d 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -18,6 +18,55 @@ </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> <Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Link>Properties\GlobalAssemblyInfo.cs</Link> </Compile> diff --git a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj index 9375cb64..d2e41e77 100644 --- a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj +++ b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj @@ -18,6 +18,13 @@ </ItemGroup> <ItemGroup> + <Reference Include="$(GameExecutableName)"> + <HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + + <ItemGroup> <Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Link>Properties\GlobalAssemblyInfo.cs</Link> </Compile> diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 1c414127..2f632a49 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -26,6 +26,13 @@ </ItemGroup> <ItemGroup> + <Reference Include="$(GameExecutableName)"> + <HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath> + <Private>True</Private> + </Reference> + </ItemGroup> + + <ItemGroup> <Compile Include="..\..\build\GlobalAssemblyInfo.cs"> <Link>Properties\GlobalAssemblyInfo.cs</Link> </Compile> diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index d723d954..8b7d6277 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -23,6 +23,10 @@ </ItemGroup> <ItemGroup> + <Reference Include="$(GameExecutableName)"> + <HintPath>$(GamePath)\$(GameExecutableName).exe</HintPath> + <Private>False</Private> + </Reference> <Reference Include="System.Numerics"> <Private>True</Private> </Reference> @@ -32,6 +36,64 @@ <Reference Include="System.Windows.Forms" Condition="$(OS) == 'Windows_NT'" /> </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> <ProjectReference Include="..\SMAPI.Toolkit.CoreInterfaces\SMAPI.Toolkit.CoreInterfaces.csproj" /> <ProjectReference Include="..\SMAPI.Toolkit\SMAPI.Toolkit.csproj" /> |