
dev.lajoscseppento.ruthless.plugin.impl.JavaLanguageVersionSystemProperty Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruthless-plugin Show documentation
Show all versions of ruthless-plugin Show documentation
Ruthless conventions for Gradle projects to keep them DRY
package dev.lajoscseppento.ruthless.plugin.impl;
import dev.lajoscseppento.gradle.plugin.common.property.ObjectSystemProperty;
import org.gradle.api.GradleException;
import org.gradle.jvm.toolchain.JavaLanguageVersion;
/** System property for Java language version. */
public class JavaLanguageVersionSystemProperty extends ObjectSystemProperty {
private static final String PROPERTY_NAME = "ruthless.java.languageVersion";
public JavaLanguageVersionSystemProperty() {
super(
PROPERTY_NAME,
() -> {
throw new GradleException(
"Missing Java toolchain language version, please set the "
+ PROPERTY_NAME
+ " system property");
},
value -> {
try {
return JavaLanguageVersion.of(value);
} catch (Exception ex) {
throw new GradleException("Not recognised Java language version: " + value, ex);
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy