diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-23 00:19:22 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-23 00:19:22 -0400 |
commit | d9c6015163a3a20cc7e84c512efe04b6d210ac65 (patch) | |
tree | d20326f7573949b421c435ca8718cc000a44faf3 /src/SMAPI.ModBuildConfig | |
parent | f8ddbb1f2eedaa373a713a51beed86002460dd05 (diff) | |
download | SMAPI-d9c6015163a3a20cc7e84c512efe04b6d210ac65.tar.gz SMAPI-d9c6015163a3a20cc7e84c512efe04b6d210ac65.tar.bz2 SMAPI-d9c6015163a3a20cc7e84c512efe04b6d210ac65.zip |
exclude common non-mod files from mod release zips
Diffstat (limited to 'src/SMAPI.ModBuildConfig')
-rw-r--r-- | src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs index ba2e671d..3fec8215 100644 --- a/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs +++ b/src/SMAPI.ModBuildConfig/Framework/ModFileManager.cs @@ -73,11 +73,7 @@ namespace StardewModdingAPI.ModBuildConfig.Framework continue; // ignore release zips - if (this.EqualsInvariant(file.Extension, ".zip")) - continue; - - // ignore Json.NET (bundled into SMAPI) - if (this.EqualsInvariant(file.Name, "Newtonsoft.Json.dll") || this.EqualsInvariant(file.Name, "Newtonsoft.Json.xml")) + if (this.ShouldIgnore(file)) continue; // add file @@ -145,6 +141,27 @@ namespace StardewModdingAPI.ModBuildConfig.Framework /********* ** Private methods *********/ + /// <summary>Get whether a build output file should be ignored.</summary> + /// <param name="file">The file info.</param> + private bool ShouldIgnore(FileInfo file) + { + return + // release zips + this.EqualsInvariant(file.Extension, ".zip") + + // Json.NET (bundled into SMAPI) + || this.EqualsInvariant(file.Name, "Newtonsoft.Json.dll") + || this.EqualsInvariant(file.Name, "Newtonsoft.Json.xml") + + // code analysis files + || file.Name.EndsWith(".CodeAnalysisLog.xml", StringComparison.InvariantCultureIgnoreCase) + || file.Name.EndsWith(".lastcodeanalysissucceeded", StringComparison.InvariantCultureIgnoreCase) + + // OS metadata files + || this.EqualsInvariant(file.Name, ".DS_Store") + || this.EqualsInvariant(file.Name, "Thumbs.db"); + } + /// <summary>Get a case-insensitive dictionary matching the given JSON.</summary> /// <param name="json">The JSON to parse.</param> private IDictionary<string, object> Parse(string json) |