Skip to content

Commit b1f27b7

Browse files
committed
Merge branch '2.4.x'
Closes gh-24995
2 parents c268f5d + 522f68c commit b1f27b7

File tree

1 file changed

+9
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit

1 file changed

+9
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -183,6 +183,7 @@ public GradleRunner prepareRunner(String... arguments) throws IOException {
183183
if (this.gradleVersion != null) {
184184
gradleRunner.withGradleVersion(this.gradleVersion);
185185
}
186+
gradleRunner.withTestKitDir(getTestKitDir());
186187
List<String> allArguments = new ArrayList<>();
187188
allArguments.add("-PbootVersion=" + getBootVersion());
188189
allArguments.add("--stacktrace");
@@ -195,6 +196,13 @@ public GradleRunner prepareRunner(String... arguments) throws IOException {
195196
return gradleRunner.withArguments(allArguments);
196197
}
197198

199+
private File getTestKitDir() {
200+
File temp = new File(System.getProperty("java.io.tmpdir"));
201+
String username = System.getProperty("user.name");
202+
String gradleVersion = (this.gradleVersion != null) ? this.gradleVersion : "default";
203+
return new File(temp, ".gradle-test-kit-" + username + "-" + getBootVersion() + "-" + gradleVersion);
204+
}
205+
198206
public File getProjectDir() {
199207
return this.projectDir;
200208
}

0 commit comments

Comments
 (0)