2828import org .gradle .process .ExecOperations ;
2929import org .gradle .process .ExecResult ;
3030
31- import javax .inject .Inject ;
3231import java .io .ByteArrayOutputStream ;
3332import java .io .IOException ;
3433import java .nio .charset .StandardCharsets ;
4241import java .util .function .BiFunction ;
4342import java .util .function .Function ;
4443
44+ import javax .inject .Inject ;
45+
4546import static org .elasticsearch .gradle .internal .transport .TransportVersionUtils .IdComponents .PATCH ;
4647import static org .elasticsearch .gradle .internal .transport .TransportVersionUtils .IdComponents .SERVER ;
4748import static org .elasticsearch .gradle .internal .transport .TransportVersionUtils .IdComponents .SUBSIDIARY ;
6162 */
6263public abstract class GenerateTransportVersionDefinitionTask extends DefaultTask {
6364
64-
6565 /**
6666 * Specifies the directory in which contains all TransportVersionSet data files.
6767 *
6868 * @return
6969 */
7070 @ InputDirectory
71- // @Optional
71+ // @Optional
7272 @ PathSensitive (PathSensitivity .RELATIVE )
7373 public abstract DirectoryProperty getResourcesDirectory ();// The plugin should always set this, not optional
7474
@@ -79,7 +79,7 @@ public abstract class GenerateTransportVersionDefinitionTask extends DefaultTask
7979 * Used to set the name of the TransportVersionSet for which a data file will be generated.
8080 */
8181 @ Input
82- // @Optional
82+ // @Optional
8383 @ Option (option = "name" , description = "TBD" )
8484 public abstract Property <String > getTransportVersionName (); // The plugin should always set this, not optional
8585
@@ -112,9 +112,7 @@ public void generateTransportVersionData() throws IOException {
112112 Path resourcesDir = Objects .requireNonNull (getResourcesDirectory ().getAsFile ().get ()).toPath ();
113113 String name = getTransportVersionName ().isPresent () ? getTransportVersionName ().get () : findLocalTransportVersionName ();
114114 Set <String > targetMinorVersions = new HashSet <>(
115- getBranches ().isPresent ()
116- ? new HashSet <>(getBranches ().get ())
117- : findTargetMinorVersions ()
115+ getBranches ().isPresent () ? new HashSet <>(getBranches ().get ()) : findTargetMinorVersions ()
118116 );
119117
120118 List <TransportVersionId > ids = new ArrayList <>();
0 commit comments