Skip to content

Commit 4259b58

Browse files
committed
cleanup
1 parent 29276a7 commit 4259b58

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.gradle.api.provider.Property;
1515
import org.gradle.api.services.ServiceReference;
1616
import org.gradle.api.tasks.Input;
17-
import org.gradle.api.tasks.InputDirectory;
1817
import org.gradle.api.tasks.InputFiles;
1918
import org.gradle.api.tasks.Optional;
2019
import org.gradle.api.tasks.PathSensitive;
@@ -24,9 +23,9 @@
2423
import org.gradle.process.ExecOperations;
2524
import org.gradle.process.ExecResult;
2625

26+
import javax.inject.Inject;
2727
import java.io.ByteArrayOutputStream;
2828
import java.io.IOException;
29-
import java.nio.file.Path;
3029
import java.util.ArrayList;
3130
import java.util.Arrays;
3231
import java.util.Collections;
@@ -35,8 +34,6 @@
3534
import java.util.Set;
3635
import java.util.stream.Collectors;
3736

38-
import javax.inject.Inject;
39-
4037
/**
4138
* This task generates transport version definition files. These files
4239
* are runtime resources that TransportVersion loads statically.
@@ -45,28 +42,31 @@
4542
*/
4643
public abstract class GenerateTransportVersionDefinitionTask extends DefaultTask {
4744

48-
@InputDirectory
49-
@Optional
50-
@PathSensitive(PathSensitivity.RELATIVE)
51-
public Path getResourcesDir() {
52-
return getResources().get().getTransportResourcesDir();
53-
}
54-
45+
/**
46+
* Files that contain the references to the transport version names.
47+
*/
5548
@InputFiles
5649
@PathSensitive(PathSensitivity.RELATIVE)
5750
public abstract ConfigurableFileCollection getReferencesFiles();
5851

5952
@ServiceReference("transportVersionResources")
60-
abstract Property<TransportVersionResourcesService> getResources();
53+
abstract Property<TransportVersionResourcesService> getResourceService();
6154

6255
@Input
6356
@Optional
64-
@Option(option = "name", description = "The name of the Transport Version reference")
57+
@Option(
58+
option = "name",
59+
description = "The name of the Transport Version reference for which to generate a definition, e.g. --name=my_new_tv"
60+
)
6561
public abstract Property<String> getTransportVersionName();
6662

6763
@Optional
6864
@Input
69-
@Option(option = "branches", description = "The release branches for which to generate IDs, e.g. --branches=main,9.1")
65+
@Option(
66+
option = "branches",
67+
description = "The release branches for which to generate IDs, e.g. --branches=main,9.1. " +
68+
"Must always include the main release branch, and backport branches must be contiguous from main."
69+
)
7070
public abstract Property<String> getBranches();
7171

7272
@Input
@@ -90,7 +90,7 @@ public GenerateTransportVersionDefinitionTask(ExecOperations execOperations) {
9090

9191
@TaskAction
9292
public void run() throws IOException {
93-
TransportVersionResourcesService resources = getResources().get();
93+
TransportVersionResourcesService resources = getResourceService().get();
9494
Set<String> referencedNames = TransportVersionReference.collectNames(getReferencesFiles());
9595
List<String> changedDefinitionNames = resources.getChangedReferableDefinitionNames();
9696
String name = getTransportVersionName().isPresent()

0 commit comments

Comments
 (0)