/** * Check if an existing version of dependency is compatible with the required version (from plugin descriptor). * * @param requiredVersion * @param existingVersion * @return */ protected boolean checkDependencyVersion(String requiredVersion, String existingVersion) { return versionManager.checkVersionConstraint(existingVersion, requiredVersion); }
/** * Check if this plugin is valid (satisfies "requires" param) for a given system version. * * @param pluginWrapper the plugin to check * @return true if plugin satisfies the "requires" or if requires was left blank */ protected boolean isPluginValid(PluginWrapper pluginWrapper) { String requires = pluginWrapper.getDescriptor().getRequires().trim(); if (!isExactVersionAllowed() && requires.matches("^\\d+\\.\\d+\\.\\d+$")) { // If exact versions are not allowed in requires, rewrite to >= expression requires = ">=" + requires; } if (systemVersion.equals("0.0.0") || versionManager.checkVersionConstraint(systemVersion, requires)) { return true; } PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); log.warn("Plugin '{}' requires a minimum system version of {}, and you have {}", getPluginLabel(pluginDescriptor), pluginWrapper.getDescriptor().getRequires(), getSystemVersion()); return false; }
/** * Check if an existing version of dependency is compatible with the required version (from plugin descriptor). * * @param requiredVersion * @param existingVersion * @return */ protected boolean checkDependencyVersion(String requiredVersion, String existingVersion) { return versionManager.checkVersionConstraint(existingVersion, requiredVersion); }
/** * Check if this plugin is valid (satisfies "requires" param) for a given system version. * * @param pluginWrapper the plugin to check * @return true if plugin satisfies the "requires" or if requires was left blank */ protected boolean isPluginValid(PluginWrapper pluginWrapper) { String requires = pluginWrapper.getDescriptor().getRequires().trim(); if (!isExactVersionAllowed() && requires.matches("^\\d+\\.\\d+\\.\\d+$")) { // If exact versions are not allowed in requires, rewrite to >= expression requires = ">=" + requires; } if (systemVersion.equals("0.0.0") || versionManager.checkVersionConstraint(systemVersion, requires)) { return true; } PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor(); log.warn("Plugin '{}' requires a minimum system version of {}, and you have {}", getPluginLabel(pluginDescriptor), pluginWrapper.getDescriptor().getRequires(), getSystemVersion()); return false; }