summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-09 23:33:42 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-09 23:33:42 -0400
commit09034f61a14494bc7a255137fbec4b05023a22cd (patch)
tree51ac41488d6a3041351727870a128347afddbc9a /build
parent088d4e77f0e012e921543998bf121c0b4db95a4a (diff)
parent9beefb65fa0213603c3aa52875d88c0b410dbfd6 (diff)
downloadSMAPI-09034f61a14494bc7a255137fbec4b05023a22cd.tar.gz
SMAPI-09034f61a14494bc7a255137fbec4b05023a22cd.tar.bz2
SMAPI-09034f61a14494bc7a255137fbec4b05023a22cd.zip
Merge branch 'develop'
Diffstat (limited to 'build')
-rw-r--r--build/smapi.targets63
1 files changed, 36 insertions, 27 deletions
diff --git a/build/smapi.targets b/build/smapi.targets
index ea6af723..b2ce5967 100644
--- a/build/smapi.targets
+++ b/build/smapi.targets
@@ -6,35 +6,41 @@
<Import Condition="$(OS) == 'Windows_NT' AND Exists('$(USERPROFILE)\stardewvalley.targets')" Project="$(USERPROFILE)\stardewvalley.targets" />
<!--######
- ## select target OS
+ ## find platform + game path
#######-->
- <PropertyGroup>
- <GamePlatform Condition="$(OS) == 'Unix'">Linux</GamePlatform>
- <GamePlatform Condition="$(OS) == 'OSX'">Mac</GamePlatform>
- <GamePlatform Condition="$(OS) == 'Windows_NT'">Windows</GamePlatform>
- </PropertyGroup>
-
- <!--######
- ## select game path
- #######-->
- <PropertyGroup>
- <!-- Linux -->
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
-
- <!-- Mac -->
- <GamePath Condition="!Exists('$(GamePath)')">/Applications/Stardew Valley.app/Contents/MacOS</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
-
- <!-- Windows -->
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
- <GamePath Condition="!Exists('$(GamePath)') AND '$(GamePlatform)' == 'Windows'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32))</GamePath>
- <GamePath Condition="!Exists('$(GamePath)') AND '$(GamePlatform)' == 'Windows'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32))</GamePath>
- </PropertyGroup>
+ <Choose>
+ <When Condition="$(OS) == 'Unix'">
+ <PropertyGroup>
+ <GamePlatform>Linux</GamePlatform>
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
+ </PropertyGroup>
+ </When>
+ <When Condition="$(OS) == 'OSX'">
+ <PropertyGroup>
+ <GamePlatform>Mac</GamePlatform>
+ <GamePath Condition="!Exists('$(GamePath)')">/Applications/Stardew Valley.app/Contents/MacOS</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
+ </PropertyGroup>
+ </When>
+ <When Condition="$(OS) == 'Windows_NT'">
+ <PropertyGroup>
+ <GamePlatform>Windows</GamePlatform>
+ <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32))</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32))</GamePath>
+ </PropertyGroup>
+ </When>
+ <Otherwise>
+ <PropertyGroup>
+ <GamePlatform></GamePlatform>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
<!--######
- ## set up configuration
+ ## configure build
#######-->
<Choose>
<When Condition="$(GamePlatform) == 'Windows'">
@@ -99,6 +105,9 @@
## validate
#######-->
<Target Name="BeforeBuild">
+ <!-- show error for unknown platform -->
+ <Error Condition="'$(GamePlatform)' != 'Linux' AND '$(GamePlatform)' != 'Mac' AND '$(GamePlatform)' != 'Windows'" Text="The build config package doesn't recognise OS type '$(OS)' (mapped to game platform '$(GamePlatform)')." />
+
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path. See https://github.com/Pathoschild/Stardew.ModBuildConfig#troubleshoot for help." />
<Error Condition="'$(GamePlatform)' == 'Windows' AND !Exists('$(GamePath)\Stardew Valley.exe')" Text="Found a game folder at $(GamePath), but it doesn't contain Stardew Valley. You should delete this folder if it's empty." />
@@ -107,7 +116,7 @@
</Target>
<!--######
- ## deploy mod files
+ ## deploy mod files on build
#######-->
<Target Name="AfterBuild" Condition="'$(DeployModFolderName)' != ''">
<!--generate paths-->