INNER CODE UNIT · Java
configureJdkForAllJavaTasks
scalar-labs/scalardb · buildSrc/src/main/java/com/scalar/db/JdkConfigurationPlugin.java:71
private void configureJdkForAllJavaTasks(Project project) {
JavaPluginExtension javaPlugin = project.getExtensions().getByType(JavaPluginExtension.class);
if (javaVersion == null) {
// When the JDK is not set explicitly with the `javaVersion` property, this ensures the
// project is compiled to Java 8 bytecode
javaPlugin.setSourceCompatibility(JavaLanguageVersion.of(8));
javaPlugin.setTargetCompatibility(JavaLanguageVersion.of(8));
} else {
javaPlugin.getToolchain().getLanguageVersion().set(javaVersion);
logger.debug("Configure to use JDK {} for Java tasks", javaVersion);
}
if (javaVendor != null) {
javaPlugin.getToolchain().getVendor().set(javaVendor);
logger.debug("Configure to use JDK from {} vendor for Java tasks", javaVendor);
}
}
private void configureJdkForIntegrationTestTasks(Project project) {