Account for length of Gradle version when relocating test kit dir

This commit is contained in:
Andy Wilkinson
2026-08-25 09:26:59 +01:00
parent e33f3c6781
commit 67d7523f52
@@ -210,14 +210,15 @@ public class GradleBuild {
}
private File getTestKitDir() {
File testKitRoot = getTestKitRoot();
String gradleVersion = (this.gradleVersion != null) ? this.gradleVersion : "default";
File testKitRoot = getTestKitRoot(gradleVersion);
return new File(testKitRoot, gradleVersion).getAbsoluteFile();
}
private File getTestKitRoot() {
private File getTestKitRoot(String gradleVersion) {
File build = this.buildOutput.getRootLocation();
if (isWindows() && build.getAbsolutePath().length() >= 80) {
int length = build.getAbsolutePath().length() + gradleVersion.length();
if (isWindows() && length >= 85) {
return new File(System.getProperty("java.io.tmpdir"), "gradle-test-kit");
}
return new File(build, "gradle-test-kit");