Package com.github.zafarkhaja.semver

Examples of com.github.zafarkhaja.semver.Version


     *
     * @Return  a string to represent the version to update; null if there is
     *          no version to update
     */
    public static String fetchVersionToUpdate() throws GitAPIException {
        Version current = Version.valueOf(Config.semverize(Config.getCurrentVersion()));
        Version latest = current;
        boolean isUpdateRequired = false;

        Collection<Ref> refs;

        refs = Git.lsRemoteRepository()
                .setRemote(UPDATE_REPOSITORY_URL)
                .setHeads(false)
                .setTags(true)
                .call();

        for(Ref ref : refs) {
            String tag = ref.getName().replaceFirst("^refs/tags/", "");
            if (tag.charAt(0) == 'v') {
                String versionString = Config.semverize(tag);

                try {
                    Version ver = Version.valueOf(versionString);
                    if (ver.greaterThan(latest)) {
                        isUpdateRequired = true;
                        latest = ver;
                    }
                } catch (UnexpectedElementTypeException e) {
                    play.Logger.warn("Failed to parse a version: " +
View Full Code Here


    return result;
  }

  private void checkPluginCompatibility(PluginInfo pluginInfo) throws Exception {
    Version applicationVersion = Version.valueOf(Client.getApplicationVersion());
    Version pluginAppMinVersion = Version.valueOf(pluginInfo.getPluginAppMinVersion());
   
    logger.log(Level.INFO, "Checking plugin compatibility:");
    logger.log(Level.INFO, "- Application version:             " + Client.getApplicationVersion() + "(" + applicationVersion + ")");
    logger.log(Level.INFO, "- Plugin min. application version: " + pluginInfo.getPluginAppMinVersion() + "(" + pluginAppMinVersion + ")");
   
View Full Code Here

TOP

Related Classes of com.github.zafarkhaja.semver.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.