don't validate manifest if we're not deploying or zipping the mod
That would break cases like unit test projects, which don't have a manifest.json file.
This commit is contained in:
parent
346fddda67
commit
6ee0d2f93d
|
@ -79,6 +79,14 @@ namespace StardewModdingAPI.ModBuildConfig
|
||||||
this.Log.LogMessage(MessageImportance.High, $"[mod build package] Handling build with options {string.Join(", ", properties)}");
|
this.Log.LogMessage(MessageImportance.High, $"[mod build package] Handling build with options {string.Join(", ", properties)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skip if nothing to do
|
||||||
|
// (This must be checked before the manifest validation, to allow cases like unit test projects.)
|
||||||
|
if (!this.EnableModDeploy && !this.EnableModZip)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// validate the manifest file
|
||||||
|
Manifest manifest;
|
||||||
|
{
|
||||||
// check if manifest file exists
|
// check if manifest file exists
|
||||||
FileInfo manifestFile = new(Path.Combine(this.ProjectDir, "manifest.json"));
|
FileInfo manifestFile = new(Path.Combine(this.ProjectDir, "manifest.json"));
|
||||||
if (!manifestFile.Exists)
|
if (!manifestFile.Exists)
|
||||||
|
@ -88,7 +96,6 @@ namespace StardewModdingAPI.ModBuildConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the json is valid
|
// check if the json is valid
|
||||||
Manifest manifest;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new JsonHelper().ReadJsonFileIfExists(manifestFile.FullName, out manifest);
|
new JsonHelper().ReadJsonFileIfExists(manifestFile.FullName, out manifest);
|
||||||
|
@ -107,10 +114,9 @@ namespace StardewModdingAPI.ModBuildConfig
|
||||||
this.Log.LogError($"[mod build package] The mod manifest is invalid: {error}");
|
this.Log.LogError($"[mod build package] The mod manifest is invalid: {error}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.EnableModDeploy && !this.EnableModZip)
|
// deploy files
|
||||||
return true; // nothing to do
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// parse extra DLLs to bundle
|
// parse extra DLLs to bundle
|
||||||
|
|
Loading…
Reference in New Issue