fix: accept schema-2 composite module manifests
This commit is contained in:
@@ -14,7 +14,9 @@ internal static class CompositeModuleManifest
|
||||
var path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(assemblyPath)!, "..", "module-manifest.json"));
|
||||
if (!File.Exists(path)) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_MISSING");
|
||||
var manifest = JsonSerializer.Deserialize<CompositeManifest>(File.ReadAllText(path), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }) ?? throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
|
||||
if (manifest.SchemaVersion != 1 || !string.Equals(manifest.Package, "P_Rec_Annot", StringComparison.Ordinal) || manifest.Modules.Count == 0) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
|
||||
// Schema 2 adds the package-wide file manifest while preserving the
|
||||
// required composite module/assembly contract consumed here.
|
||||
if (manifest.SchemaVersion is not (1 or 2) || !string.Equals(manifest.Package, "P_Rec_Annot", StringComparison.Ordinal) || manifest.Modules.Count == 0) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
|
||||
foreach (var item in manifest.Assemblies.Where(value => value.Required))
|
||||
{
|
||||
var file = Path.Combine(Path.GetDirectoryName(assemblyPath)!, item.Name);
|
||||
|
||||
Reference in New Issue
Block a user