Browse Source

Fix dependency checks to actually check version

pull/72/head
Anairkoen Schno 3 years ago
parent
commit
e16d96b3f7
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
4 changed files with 15 additions and 11 deletions
  1. +1
    -1
      BuildTools
  2. +9
    -8
      IPA.Loader/Loader/PluginLoader.cs
  3. +1
    -1
      IPA.Loader/Loader/manifest.json
  4. +4
    -1
      docs/docfx.json

+ 1
- 1
BuildTools

@ -1 +1 @@
Subproject commit 41c3a12d56de96a3495893d1fea4a485a98c67af
Subproject commit b04769a3aebdd111b81f5a59d438907310e83207

+ 9
- 8
IPA.Loader/Loader/PluginLoader.cs View File

@ -955,16 +955,17 @@ namespace IPA.Loader
// first load dependencies // first load dependencies
var dependsOnSelf = false; var dependsOnSelf = false;
foreach (var dep in plugin.Manifest.Dependencies)
foreach (var (id, range) in plugin.Manifest.Dependencies)
{ {
if (dep.Key == SelfMeta.Id)
if (id == SelfMeta.Id)
dependsOnSelf = true; dependsOnSelf = true;
if (!TryResolveId(dep.Key, out var depMeta, out var depDisabled, out var depIgnored))
if (!TryResolveId(id, out var depMeta, out var depDisabled, out var depIgnored)
|| !range.IsSatisfied(depMeta.Version))
{ {
Logger.loader.Warn($"Dependency '{dep.Key}@{dep.Value}' for '{plugin.Id}' does not exist; ignoring '{plugin.Id}'");
Logger.loader.Warn($"Dependency '{id}@{range}' for '{plugin.Id}' does not exist; ignoring '{plugin.Id}'");
ignoredPlugins.Add(plugin, new(Reason.Dependency) ignoredPlugins.Add(plugin, new(Reason.Dependency)
{ {
ReasonText = $"Dependency '{dep.Key}@{dep.Value}' not found",
ReasonText = $"Dependency '{id}@{range}' not found",
}); });
ignored = true; ignored = true;
return; return;
@ -972,10 +973,10 @@ namespace IPA.Loader
// make a point to propagate ignored // make a point to propagate ignored
if (depIgnored) if (depIgnored)
{ {
Logger.loader.Warn($"Dependency '{dep.Key}' for '{plugin.Id}' previously ignored; ignoring '{plugin.Id}'");
Logger.loader.Warn($"Dependency '{id}' for '{plugin.Id}' previously ignored; ignoring '{plugin.Id}'");
ignoredPlugins.Add(plugin, new(Reason.Dependency) ignoredPlugins.Add(plugin, new(Reason.Dependency)
{ {
ReasonText = $"Dependency '{dep.Key}' ignored",
ReasonText = $"Dependency '{id}' ignored",
RelatedTo = depMeta RelatedTo = depMeta
}); });
ignored = true; ignored = true;
@ -984,7 +985,7 @@ namespace IPA.Loader
// make a point to propagate disabled // make a point to propagate disabled
if (depDisabled) if (depDisabled)
{ {
Logger.loader.Warn($"Dependency '{dep.Key}' for '{plugin.Id}' disabled; disabling");
Logger.loader.Warn($"Dependency '{id}' for '{plugin.Id}' disabled; disabling");
disabledPlugins!.Add(plugin); disabledPlugins!.Add(plugin);
_ = disabledIds!.Add(plugin.Id); _ = disabledIds!.Add(plugin.Id);
disabled = true; disabled = true;


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -8,7 +8,7 @@
"gameVersion": "1.16.1", "gameVersion": "1.16.1",
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",
"version": "4.1.7-pre.3",
"version": "4.1.7-pre.4",
"icon": "IPA.icon_white.png", "icon": "IPA.icon_white.png",
"features": { "features": {
"IPA.DefineFeature": { "IPA.DefineFeature": {


+ 4
- 1
docs/docfx.json View File

@ -18,7 +18,10 @@
}], }],
"dest": "api", "dest": "api",
"disableGitFeatures": false, "disableGitFeatures": false,
"disableDefaultFilter": false
"disableDefaultFilter": false,
"properties": {
"TargetFramework": "net461"
}
}], }],
"build": { "build": {
"content": [{ "content": [{


Loading…
Cancel
Save