Java Code Examples for org.gradle.api.JavaVersion#getMajorVersion()

The following examples show how to use org.gradle.api.JavaVersion#getMajorVersion() . 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: ResolveJavadocLinks.java    From gradle-plugins with MIT License 5 votes vote down vote up
private String getJavaSeLink() {
    JavaVersion javaVersion = JavaVersion.current();

    JavaToolChain toolChain = javadoc.getToolChain();
    if (toolChain instanceof JavaToolChainInternal) {
        javaVersion = ((JavaToolChainInternal) toolChain).getJavaVersion();
    }

    if (javaVersion.isJava11Compatible()) {
        return "https://docs.oracle.com/en/java/javase/" + javaVersion.getMajorVersion() + "/docs/api/";
    }
    else {
        return "https://docs.oracle.com/javase/" + javaVersion.getMajorVersion() + "/docs/api/";
    }
}
 
Example 2
Source File: ResolveJavadocLinks.java    From gradle-plugins with MIT License 5 votes vote down vote up
private String getJavaSeLink() {
    JavaVersion javaVersion = JavaVersion.current();

    JavaToolChain toolChain = javadoc.getToolChain();
    if (toolChain instanceof JavaToolChainInternal) {
        javaVersion = ((JavaToolChainInternal) toolChain).getJavaVersion();
    }

    if (javaVersion.isJava11Compatible()) {
        return "https://docs.oracle.com/en/java/javase/" + javaVersion.getMajorVersion() + "/docs/api/";
    }
    else {
        return "https://docs.oracle.com/javase/" + javaVersion.getMajorVersion() + "/docs/api/";
    }
}
 
Example 3
Source File: DefaultJavaPlatform.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private static String generateName(JavaVersion javaVersion) {
    return "java" + javaVersion.getMajorVersion();
}
 
Example 4
Source File: DefaultJavaPlatform.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private static String generateName(JavaVersion javaVersion) {
    return "java" + javaVersion.getMajorVersion();
}