Merge branch '2.3.x' into 2.4.x

Closes gh-24994
This commit is contained in:
Phillip Webb 2021-01-25 21:36:12 -08:00
commit 522f68cb40

View File

@ -1,5 +1,5 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -183,6 +183,7 @@ public class GradleBuild {
if (this.gradleVersion != null) { if (this.gradleVersion != null) {
gradleRunner.withGradleVersion(this.gradleVersion); gradleRunner.withGradleVersion(this.gradleVersion);
} }
gradleRunner.withTestKitDir(getTestKitDir());
List<String> allArguments = new ArrayList<>(); List<String> allArguments = new ArrayList<>();
allArguments.add("-PbootVersion=" + getBootVersion()); allArguments.add("-PbootVersion=" + getBootVersion());
allArguments.add("--stacktrace"); allArguments.add("--stacktrace");
@ -195,6 +196,13 @@ public class GradleBuild {
return gradleRunner.withArguments(allArguments); return gradleRunner.withArguments(allArguments);
} }
private File getTestKitDir() {
File temp = new File(System.getProperty("java.io.tmpdir"));
String username = System.getProperty("user.name");
String gradleVersion = (this.gradleVersion != null) ? this.gradleVersion : "default";
return new File(temp, ".gradle-test-kit-" + username + "-" + getBootVersion() + "-" + gradleVersion);
}
public File getProjectDir() { public File getProjectDir() {
return this.projectDir; return this.projectDir;
} }