Java Code Examples for org.gradle.util.GradleVersion#equals()

The following examples show how to use org.gradle.util.GradleVersion#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultGradleDistribution.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public boolean wrapperCanExecute(GradleVersion version) {
    if (version.equals(GradleVersion.version("0.8")) || isVersion("0.8")) {
        // There was a breaking change after 0.8
        return false;
    }
    if (isVersion("0.9.1")) {
        // 0.9.1 couldn't handle anything with a timestamp whose timezone was behind GMT
        return version.getVersion().matches(".*+\\d{4}");
    }
    if (isSameOrNewer("0.9.2") && isSameOrOlder("1.0-milestone-2")) {
        // These versions couldn't handle milestone patches
        if (version.getVersion().matches("1.0-milestone-\\d+[a-z]-.+")) {
            return false;
        }
    }
    return true;
}
 
Example 2
Source File: GradleBuildComparison.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private ProjectConnection createProjectConnection(ComparableGradleBuildExecuter executer) {
    GradleConnector connector = GradleConnector.newConnector();
    connector.forProjectDirectory(executer.getSpec().getProjectDir());
    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();
}
 
Example 3
Source File: DefaultGradleDistribution.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public boolean wrapperCanExecute(GradleVersion version) {
    if (version.equals(GradleVersion.version("0.8")) || isVersion("0.8")) {
        // There was a breaking change after 0.8
        return false;
    }
    if (isVersion("0.9.1")) {
        // 0.9.1 couldn't handle anything with a timestamp whose timezone was behind GMT
        return version.getVersion().matches(".*+\\d{4}");
    }
    if (isSameOrNewer("0.9.2") && isSameOrOlder("1.0-milestone-2")) {
        // These versions couldn't handle milestone patches
        if (version.getVersion().matches("1.0-milestone-\\d+[a-z]-.+")) {
            return false;
        }
    }
    return true;
}
 
Example 4
Source File: GradleBuildComparison.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private ProjectConnection createProjectConnection(ComparableGradleBuildExecuter executer) {
    GradleConnector connector = GradleConnector.newConnector();
    connector.forProjectDirectory(executer.getSpec().getProjectDir());
    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();
}
 
Example 5
Source File: DefaultGradleDistribution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public boolean wrapperCanExecute(GradleVersion version) {
    if (version.equals(GradleVersion.version("0.8")) || isVersion("0.8")) {
        // There was a breaking change after 0.8
        return false;
    }
    if (isVersion("0.9.1")) {
        // 0.9.1 couldn't handle anything with a timestamp whose timezone was behind GMT
        return version.getVersion().matches(".*+\\d{4}");
    }
    if (isSameOrNewer("0.9.2") && isSameOrOlder("1.0-milestone-2")) {
        // These versions couldn't handle milestone patches
        if (version.getVersion().matches("1.0-milestone-\\d+[a-z]-.+")) {
            return false;
        }
    }
    return true;
}
 
Example 6
Source File: GradleBuildComparison.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private ProjectConnection createProjectConnection(ComparableGradleBuildExecuter executer) {
    GradleConnector connector = GradleConnector.newConnector();
    connector.forProjectDirectory(executer.getSpec().getProjectDir());
    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();
}
 
Example 7
Source File: DefaultGradleDistribution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public boolean wrapperCanExecute(GradleVersion version) {
    if (version.equals(GradleVersion.version("0.8")) || isVersion("0.8")) {
        // There was a breaking change after 0.8
        return false;
    }
    if (isVersion("0.9.1")) {
        // 0.9.1 couldn't handle anything with a timestamp whose timezone was behind GMT
        return version.getVersion().matches(".*+\\d{4}");
    }
    if (isSameOrNewer("0.9.2") && isSameOrOlder("1.0-milestone-2")) {
        // These versions couldn't handle milestone patches
        if (version.getVersion().matches("1.0-milestone-\\d+[a-z]-.+")) {
            return false;
        }
    }
    return true;
}
 
Example 8
Source File: GradleBuildComparison.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private ProjectConnection createProjectConnection(ComparableGradleBuildExecuter executer) {
    GradleConnector connector = GradleConnector.newConnector();
    connector.forProjectDirectory(executer.getSpec().getProjectDir());
    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();
}