2016-10-20 02:33:13 +08:00
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2016-10-20 07:26:33 +08:00
<!-- find game install path -->
2016-10-20 02:33:13 +08:00
<PropertyGroup>
2016-10-20 08:43:35 +08:00
<!-- injected by Silverplum -->
<GamePath Condition="!Exists('$(GamePath)')">$(STARDEWVALLEY_DIR)</GamePath>
<!-- Linux -->
2016-10-21 13:25:21 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
2016-10-20 10:53:49 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
2016-10-20 08:43:35 +08:00
<!-- Mac -->
2016-10-20 10:53:49 +08:00
<GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
2016-10-20 08:43:35 +08:00
<!-- Windows -->
<GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
2016-10-20 02:33:13 +08:00
<GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
</PropertyGroup>
2016-10-20 07:26:33 +08:00
<!-- set up configuration -->
<Choose>
<When Condition="$(OS) == 'Windows_NT'">
<!-- references -->
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Stardew Valley">
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
</Reference>
<Reference Include="StardewModdingAPI">
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
</Reference>
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(GamePath)\xTile.dll</HintPath>
</Reference>
</ItemGroup>
2016-10-20 02:33:13 +08:00
2016-10-20 07:26:33 +08:00
<!-- launch game for debugging -->
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>$(GamePath)\StardewModdingAPI.exe</StartProgram>
<StartWorkingDirectory>$(GamePath)</StartWorkingDirectory>
</PropertyGroup>
</When>
<Otherwise>
<!-- references -->
<ItemGroup>
<Reference Include="MonoGame.Framework">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="StardewValley">
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
</Reference>
<Reference Include="StardewModdingAPI">
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
</Reference>
<Reference Include="xTile">
<HintPath>$(GamePath)\xTile.dll</HintPath>
</Reference>
</ItemGroup>
</Otherwise>
</Choose>
2016-10-20 02:33:13 +08:00
2016-10-20 08:16:06 +08:00
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
2016-10-20 02:33:13 +08:00
<Target Name="BeforeBuild">
2016-10-20 08:16:06 +08:00
<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." />
2016-10-20 02:33:13 +08:00
</Target>
</Project>