diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-06-05 17:49:00 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-06-05 17:49:00 -0400 |
commit | 088d4e77f0e012e921543998bf121c0b4db95a4a (patch) | |
tree | d28ff0bf026c7b33a80303364c3eb2b726983aad /build/smapi.targets | |
parent | f681efd6e7950c5a1b40990904b6bcdc3c04818f (diff) | |
parent | f74a0429eccf205ac52f51244a716bab786eab2a (diff) | |
download | SMAPI-088d4e77f0e012e921543998bf121c0b4db95a4a.tar.gz SMAPI-088d4e77f0e012e921543998bf121c0b4db95a4a.tar.bz2 SMAPI-088d4e77f0e012e921543998bf121c0b4db95a4a.zip |
Merge branch 'develop'
Diffstat (limited to 'build/smapi.targets')
-rw-r--r-- | build/smapi.targets | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/build/smapi.targets b/build/smapi.targets index de3420d1..ea6af723 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -101,5 +101,33 @@ <Target Name="BeforeBuild"> <!-- 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." /> + <Error Condition="'$(GamePlatform)' != 'Windows' AND !Exists('$(GamePath)\StardewValley.exe')" Text="Found a game folder at $(GamePath), but it doesn't contain Stardew Valley. You should delete this folder if it's empty." /> + <Error Condition="!Exists('$(GamePath)\StardewModdingAPI.exe')" Text="Found a game folder at $(GamePath), but it doesn't contain SMAPI." /> + </Target> + + <!--###### + ## deploy mod files + #######--> + <Target Name="AfterBuild" Condition="'$(DeployModFolderName)' != ''"> + <!--generate paths--> + <PropertyGroup> + <ModDeployPath>$(GamePath)\Mods\$(DeployModFolderName)</ModDeployPath> + <FallbackManifestPath>$(ProjectDir)\manifest.json</FallbackManifestPath> + </PropertyGroup> + <ItemGroup> + <BuildFiles Include="$(TargetDir)\**\*.*" /> + <FallbackTranslationFiles Include="$(ProjectDir)\i18n\*.json" /> + </ItemGroup> + + <!--validate--> + <Error Text="Could not deploy mod automatically because no build output was found." Condition="'@(BuildFiles)' == ''" /> + <Error Text="Could not deploy mod automatically because no manifest.json was found in the project or build output." Condition="!Exists('$(TargetDir)\manifest.json') AND !Exists('$(FallbackManifestPath)')" /> + + <!-- copy mod files --> + <Message Text="Deploying mod to $(ModDeployPath)..." Importance="high" /> + <Copy SourceFiles="@(BuildFiles)" DestinationFolder="$(ModDeployPath)\%(RecursiveDir)" SkipUnchangedFiles="true" /> + <Copy SourceFiles="$(FallbackManifestPath)" DestinationFolder="$(ModDeployPath)" Condition="!Exists('$(TargetDir)\manifest.json')" /> + <Copy SourceFiles="@(FallbackTranslationFiles)" DestinationFolder="$(ModDeployPath)\i18n\%(RecursiveDir)" Condition="!Exists('$(TargetDir)\i18n')" /> </Target> </Project>
\ No newline at end of file |