Skip to content

Commit cd6f002

Browse files
committed
rebase
1 parent 7028c8c commit cd6f002

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateTransportVersionDefinitionTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private <T> T readExistingFile(String name, Function<String, String> pathFunctio
196196

197197
// TODO duplicated
198198
private String latestRelativePath(String branch) {
199-
return relativePath(latestFilePath(resourcesDirPath(), branch));
199+
return relativePath(latestFilePath(getResourcesDirectory().get(), branch));
200200
}
201201

202202
// TODO duplicated

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionUtils.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
import org.gradle.api.attributes.Attribute;
1616
import org.gradle.api.attributes.AttributeContainer;
1717
import org.gradle.api.file.Directory;
18-
import org.gradle.process.ExecResult;
1918

20-
import java.io.ByteArrayOutputStream;
2119
import java.io.IOException;
2220
import java.nio.charset.StandardCharsets;
2321
import java.nio.file.Files;
2422
import java.nio.file.Path;
2523
import java.util.ArrayList;
26-
import java.util.Collections;
2724
import java.util.Comparator;
2825
import java.util.List;
2926
import java.util.regex.Pattern;
@@ -161,12 +158,12 @@ public int base() {
161158
}
162159
}
163160

164-
static Path definitionFilePath(Path resourcesDir, String name) {
165-
return getDefinitionsDirectory(resourcesDir).resolve(name + CSV_SUFFIX);
161+
static Path definitionFilePath(Directory resourcesDirectory, String name) {
162+
return getDefinitionsDirectory(resourcesDirectory).getAsFile().toPath().resolve(name + CSV_SUFFIX);
166163
}
167164

168-
static Path latestFilePath(Path resourcesDir, String name) {
169-
return getLatestDirectory(resourcesDir).resolve(name + CSV_SUFFIX);
165+
static Path latestFilePath(Directory resourcesDir, String name) {
166+
return getLatestDirectory(resourcesDir).getAsFile().toPath().resolve(name + CSV_SUFFIX);
170167
}
171168

172169
static TransportVersionDefinition readDefinitionFile(Path file) throws IOException {
@@ -222,12 +219,12 @@ static List<TransportVersionReference> readReferencesFile(Path file) throws IOEx
222219
return results;
223220
}
224221

225-
static Path getDefinitionsDirectory(Path resourcesDir) {
226-
return resourcesDir.resolve("defined");
222+
static Directory getDefinitionsDirectory(Directory resourcesDirectory) {
223+
return resourcesDirectory.dir(DEFINED_DIR);
227224
}
228225

229226
static Directory getLatestDirectory(Directory resourcesDirectory) {
230-
return resourcesDirectory.dir("latest");
227+
return resourcesDirectory.dir(LATEST_DIR);
231228
}
232229

233230
static Directory getResourcesDirectory(Project project) {

0 commit comments

Comments
 (0)