return true;
}
- log.warn("Plugin '{}:{}' requires a minimum system version of {}",
+ log.warn("Plugin '{}:{}' requires a minimum system version of {}, and you have {}",
pluginWrapper.getPluginId(),
pluginWrapper.getDescriptor().getVersion(),
- requires);
+ pluginWrapper.getDescriptor().getRequiresString(),
+ system);
return false;
}
private String pluginClass;
private Version version;
private Expression requires;
+ private String requiresString;
private String provider;
private List<PluginDependency> dependencies;
private String license;
return requires;
}
+ /**
+ * Returns the requires of this plugin as a string.
+ */
+ public String getRequiresString() {
+ return requiresString;
+ }
+
/**
* Returns the provider name of this plugin.
*/
return "PluginDescriptor [pluginId=" + pluginId + ", pluginClass="
+ pluginClass + ", version=" + version + ", provider="
+ provider + ", dependencies=" + dependencies + ", description="
- + pluginDescription + ", requires=" + requires + ", license="
+ + pluginDescription + ", requires=" + requiresString + ", license="
+ license + "]";
}
}
void setRequires(String requires) {
+ requiresString = requires;
Parser<Expression> parser = ExpressionParser.newInstance();
setRequires(parser.parse(requires));
}
assertEquals("test-plugin-3", plugin1.getDependencies().get(1).getPluginId());
assertEquals("~1.0", plugin1.getDependencies().get(1).getPluginVersionSupport());
assertEquals("Apache-2.0", plugin1.getLicense());
+ assertEquals("*", plugin1.getRequiresString());
assertTrue(plugin1.getRequires().interpret(Version.valueOf("1.0.0")));
assertEquals("test-plugin-2", plugin2.getPluginId());