diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-06-05 15:24:53 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-06-05 17:45:05 -0400 |
commit | ffc339bc29a9b4b08d53a5d147546630116d82d7 (patch) | |
tree | 39746b67020b69b2d2915a91303d5fc0d0ecdaf0 /build/smapi.targets | |
parent | 66b1b583e5233a4b50b832733d8e2cbc329a70be (diff) | |
download | SMAPI-ffc339bc29a9b4b08d53a5d147546630116d82d7.tar.gz SMAPI-ffc339bc29a9b4b08d53a5d147546630116d82d7.tar.bz2 SMAPI-ffc339bc29a9b4b08d53a5d147546630116d82d7.zip |
add support for deploying mods to game folder automatically
Diffstat (limited to 'build/smapi.targets')
-rw-r--r-- | build/smapi.targets | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/build/smapi.targets b/build/smapi.targets index 21989bd1..ea6af723 100644 --- a/build/smapi.targets +++ b/build/smapi.targets @@ -105,4 +105,29 @@ <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 |