summaryrefslogtreecommitdiff
path: root/build/smapi.targets
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-28 11:10:06 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-28 11:10:06 -0400
commita10e555095a4f7f0a6858149b3ffd6595fbd24e6 (patch)
treef7407991071cbee5412bd9db3568dc9b5c66c31f /build/smapi.targets
parentb01ce3b31d441aa6ea13da2c0c54652d0c066f49 (diff)
downloadSMAPI-a10e555095a4f7f0a6858149b3ffd6595fbd24e6.tar.gz
SMAPI-a10e555095a4f7f0a6858149b3ffd6595fbd24e6.tar.bz2
SMAPI-a10e555095a4f7f0a6858149b3ffd6595fbd24e6.zip
fix i18n folder being flattened
Diffstat (limited to 'build/smapi.targets')
-rw-r--r--build/smapi.targets11
1 files changed, 8 insertions, 3 deletions
diff --git a/build/smapi.targets b/build/smapi.targets
index b9f7e98e..ea0cfffb 100644
--- a/build/smapi.targets
+++ b/build/smapi.targets
@@ -34,9 +34,13 @@
{
foreach (ITaskItem file in Files)
{
+ // get file info
string filePath = file.ItemSpec;
string entryName = file.GetMetadata("RecursiveDir") + file.GetMetadata("Filename") + file.GetMetadata("Extension");
-
+ if (new FileInfo(filePath).Directory.Name.Equals("i18n", StringComparison.InvariantCultureIgnoreCase))
+ entryName = Path.Combine("i18n", entryName);
+
+ // add to zip
using (Stream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
using (Stream fileStreamInZip = archive.CreateEntry(entryName).Open())
{
@@ -187,8 +191,8 @@
</PropertyGroup>
<ItemGroup>
<BuildFiles Include="$(TargetDir)\**\*.*" />
- <BuildFiles Include="$(ProjectDir)\i18n\*.json" Condition="'@(BuildFiles)' != '' AND EXISTS('$(ProjectDir)\i18n')" />
<BuildFiles Include="$(ProjectDir)\manifest.json" Condition="'@(BuildFiles)' != '' AND EXISTS('$(ProjectDir)\manifest.json')" />
+ <I18nFiles Include="$(ProjectDir)\i18n\*.json" Condition="'@(BuildFiles)' != '' AND EXISTS('$(ProjectDir)\i18n')" />
</ItemGroup>
<!--validate paths-->
@@ -198,9 +202,10 @@
<!-- copy mod files into mod folder if <DeployModFolderName> property is set -->
<Message Text="Deploying mod to $(ModDeployPath)..." Importance="high" Condition="'$(DeployModFolderName)' != ''" />
<Copy SourceFiles="@(BuildFiles)" DestinationFolder="$(ModDeployPath)\%(RecursiveDir)" SkipUnchangedFiles="true" Condition="'$(DeployModFolderName)' != ''" />
+ <Copy SourceFiles="@(I18nFiles)" DestinationFolder="$(ModDeployPath)\i18n" SkipUnchangedFiles="true" Condition="'$(DeployModFolderName)' != ''" />
<!-- create release zip if <DeployModZipTo> property is set -->
<Message Text="Generating mod release at $(DeployModZipTo)\$(MSBuildProjectName).zip..." Importance="high" Condition="'$(DeployModZipTo)' != ''" />
- <CreateModReleaseZip ModName="$(MSBuildProjectName)" Files="@(BuildFiles)" OutputFolderPath="$(DeployModZipTo)" Condition="'$(DeployModZipTo)' != ''" />
+ <CreateModReleaseZip ModName="$(MSBuildProjectName)" Files="@(BuildFiles);@(I18nFiles)" OutputFolderPath="$(DeployModZipTo)" Condition="'$(DeployModZipTo)' != ''" />
</Target>
</Project>