Commit f07e4707 authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '2.4.x'

Closes gh-24736
parents d7ed2b2d 3c3aa9e4
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -21,10 +21,12 @@ import java.lang.reflect.Method;
import java.util.Set;
import org.gradle.api.file.SourceDirectorySet;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.JavaExec;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetOutput;
import org.gradle.jvm.toolchain.JavaLauncher;
/**
* Custom {@link JavaExec} task for running a Spring Boot application.
......@@ -87,6 +89,15 @@ public class BootRun extends JavaExec {
}
private boolean isJava13OrLater() {
try {
Property<JavaLauncher> javaLauncher = this.getJavaLauncher();
if (javaLauncher.isPresent()) {
return javaLauncher.get().getMetadata().getLanguageVersion().asInt() >= 13;
}
}
catch (NoSuchMethodError ex) {
// Continue
}
for (Method method : String.class.getMethods()) {
if (method.getName().equals("stripIndent")) {
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment