Package org.gradle.util

Examples of org.gradle.util.GradleVersion$Stage


        File gradleUserHomeDir = gradle.getStartParameter().getGradleUserHomeDir();
        if (gradleUserHomeDir != null) {
            connector.useGradleUserHomeDir(gradleUserHomeDir);
        }

        GradleVersion gradleVersion = executer.getGradleVersion();
        if (gradleVersion.equals(GradleVersion.current())) {
            connector.useInstallation(gradle.getGradleHomeDir());
        } else {
            connector.useGradleVersion(gradleVersion.getVersion());
        }

        return connector.connect();
    }
View Full Code Here


    protected boolean isSameOrOlder(String otherVersion) {
        return isVersion(otherVersion) || version.compareTo(GradleVersion.version(otherVersion)) <= 0;
    }

    protected boolean isVersion(String otherVersionString) {
        GradleVersion otherVersion = GradleVersion.version(otherVersionString);
        return version.compareTo(otherVersion) == 0 || (version.isSnapshot() && version.getBaseVersion().equals(otherVersion.getBaseVersion()));
    }
View Full Code Here

                    return !element.equals(GradleVersion.current());
                }
            };
        }
        if (trimmed.startsWith("=")) {
            final GradleVersion target = GradleVersion.version(trimmed.substring(1)).getBaseVersion();
            return new Spec<GradleVersion>() {
                public boolean isSatisfiedBy(GradleVersion element) {
                    return element.getBaseVersion().equals(target);
                }
            };
        }

        List<Spec> specs = new ArrayList<Spec>();
        String[] patterns = trimmed.split("\\s+");
        for (String value : patterns) {
            if (value.startsWith(">=")) {
                final GradleVersion minVersion = GradleVersion.version(value.substring(2));
                specs.add(new Spec<GradleVersion>() {
                    public boolean isSatisfiedBy(GradleVersion element) {
                        return element.getBaseVersion().compareTo(minVersion) >= 0;
                    }
                });
            } else if (value.startsWith(">")) {
                final GradleVersion minVersion = GradleVersion.version(value.substring(1));
                specs.add(new Spec<GradleVersion>() {
                    public boolean isSatisfiedBy(GradleVersion element) {
                        return element.getBaseVersion().compareTo(minVersion) > 0;
                    }
                });
            } else if (value.startsWith("<=")) {
                final GradleVersion maxVersion = GradleVersion.version(value.substring(2));
                specs.add(new Spec<GradleVersion>() {
                    public boolean isSatisfiedBy(GradleVersion element) {
                        return element.getBaseVersion().compareTo(maxVersion) <= 0;
                    }
                });
            } else if (value.startsWith("<")) {
                final GradleVersion maxVersion = GradleVersion.version(value.substring(1));
                specs.add(new Spec<GradleVersion>() {
                    public boolean isSatisfiedBy(GradleVersion element) {
                        return element.getBaseVersion().compareTo(maxVersion) < 0;
                    }
                });
View Full Code Here

        }
    }

    private static class ShowVersionAction implements Runnable {
        public void run() {
            GradleVersion currentVersion = GradleVersion.current();

            final StringBuilder sb = new StringBuilder();
            sb.append("\n------------------------------------------------------------\nGradle ");
            sb.append(currentVersion.getVersion());
            sb.append("\n------------------------------------------------------------\n\nBuild time:   ");
            sb.append(currentVersion.getBuildTime());
            sb.append("\nBuild number: ");
            sb.append(currentVersion.getBuildNumber());
            sb.append("\nRevision:     ");
            sb.append(currentVersion.getRevision());
            sb.append("\n\nGroovy:       ");
            sb.append(GroovySystem.getVersion());
            sb.append("\nAnt:          ");
            sb.append(Main.getAntVersion());
            sb.append("\nJVM:          ");
View Full Code Here

    protected ActionRunner getActionRunner() {
        return actionRunner;
    }

    protected static VersionDetails getVersionDetails(String versionString) {
        GradleVersion version = GradleVersion.version(versionString);
        if (version.compareTo(GradleVersion.version("1.11")) > 0) {
            return new R112VersionDetails(version.getVersion());
        }
        return new R18VersionDetails(version.getVersion());
    }
View Full Code Here

    public void setGradleVersion(String gradleVersion) {
        if (gradleVersion == null) {
            throw new IllegalArgumentException("gradleVersion cannot be null");
        }
        GradleVersion version = GradleVersion.version(gradleVersion);
        this.gradleVersion = version.getVersion();
    }
View Full Code Here

    public GradleVersion getGradleVersion() {
        return GradleVersion.version(getSpec().getGradleVersion());
    }

    public boolean isCanObtainProjectOutcomesModel() {
        GradleVersion version = getGradleVersion();
        boolean isMinimumVersionOrHigher = version.compareTo(PROJECT_OUTCOMES_MINIMUM_VERSION) >= 0;
        //noinspection SimplifiableIfStatement
        if (isMinimumVersionOrHigher) {
            return true;
        } else {
            // Special handling for snapshots/RCs of the minimum version
            return version.getBaseVersion().equals(PROJECT_OUTCOMES_MINIMUM_VERSION);
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.util.GradleVersion$Stage

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.