All Downloads are FREE. Search and download functionalities are using the official Maven repository.

name.remal.gradle_plugins.toolkit.GradleCompatibilityUtils Maven / Gradle / Ivy

There is a newer version: 0.69.7
Show newest version
package name.remal.gradle_plugins.toolkit;

import static java.lang.Integer.parseInt;
import static lombok.AccessLevel.PRIVATE;

import lombok.NoArgsConstructor;
import org.gradle.api.JavaVersion;
import org.gradle.util.GradleVersion;

@NoArgsConstructor(access = PRIVATE)
public abstract class GradleCompatibilityUtils {

    public static GradleCompatibilityMode getGradleJavaCompatibility(int javaMajorVersion) {
        return GradleCompatibilityJava.get(GradleVersion.current(), javaMajorVersion);
    }

    public static GradleCompatibilityMode getGradleJavaCompatibility(JavaVersion javaVersion) {
        return GradleCompatibilityJava.get(GradleVersion.current(), parseInt(javaVersion.getMajorVersion()));
    }

    public static GradleCompatibilityMode getGradleJavaCompatibility() {
        return getGradleJavaCompatibility(JavaVersion.current());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy