summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/smapi.targets19
-rw-r--r--package.nuspec10
2 files changed, 20 insertions, 9 deletions
diff --git a/build/smapi.targets b/build/smapi.targets
index b9f7e98e..58737fba 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())
{
@@ -186,9 +190,13 @@
<DeployModZipTo Condition="'$(OS)' != 'Windows_NT'"><!--disable on Linux/Mac where CodeTaskFactory doesn't seem to be available--></DeployModZipTo>
</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')" />
+ <BuildFiles Include="$(TargetDir)\**\*.*" Exclude="$(TargetDir)\manifest.json;$(TargetDir)\i18n\**\*.*" />
+
+ <BuildFiles Include="$(ProjectDir)\manifest.json" Condition="'@(BuildFiles)' != ''" />
+ <BuildFiles Include="$(TargetDir)\manifest.json" Condition="'@(BuildFiles)' != '' AND !EXISTS('$(ProjectDir)\manifest.json')" />
+
+ <I18nFiles Include="$(ProjectDir)\i18n\*.json" Condition="'@(BuildFiles)' != ''" />
+ <I18nFiles Include="$(TargetDir)\i18n\*.json" Condition="'@(BuildFiles)' != '' AND !EXISTS('$(ProjectDir)\i18n')" />
</ItemGroup>
<!--validate paths-->
@@ -198,9 +206,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>
diff --git a/package.nuspec b/package.nuspec
index 9abc7251..b8e96481 100644
--- a/package.nuspec
+++ b/package.nuspec
@@ -2,16 +2,18 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Pathoschild.Stardew.ModBuildConfig</id>
- <version>1.7</version>
+ <version>1.7.1</version>
<title>MSBuild config for Stardew Valley mods</title>
<authors>Pathoschild</authors>
<owners>Pathoschild</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <licenseUrl>https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.7/LICENSE.txt</licenseUrl>
+ <licenseUrl>https://github.com/Pathoschild/Stardew.ModBuildConfig/blob/1.7.1/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/Pathoschild/Stardew.ModBuildConfig#readme</projectUrl>
- <iconUrl>https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.7/assets/nuget-icon.png</iconUrl>
+ <iconUrl>https://raw.githubusercontent.com/Pathoschild/Stardew.ModBuildConfig/1.7.1/assets/nuget-icon.png</iconUrl>
<description>Automates the build configuration for crossplatform Stardew Valley SMAPI mods.</description>
- <releaseNotes>Added option to create release zips on build; added reference to XNA's XACT library for audio-related mods.</releaseNotes>
+ <releaseNotes>
+ 1.7 added an option to create release zips on build and added a reference to XNA's XACT library for audio-related mods.
+ 1.7.1 fixed an issue where i18n folders were flattened, and ensures that the manifest/i18n files in the project take precedence over those in the build output if both are present.</releaseNotes>
</metadata>
<files>
<file src="build/smapi.targets" target="build/Pathoschild.Stardew.ModBuildConfig.targets" />