9
9
import java .net .http .HttpClient ;
10
10
import java .net .http .HttpRequest ;
11
11
import java .net .http .HttpResponse ;
12
+ import java .util .ArrayList ;
12
13
import java .util .List ;
13
14
import java .util .StringJoiner ;
14
15
import java .util .TreeMap ;
31
32
*
32
33
* <ul>
33
34
* <li>{@code RELEASE}: Either a release number or a name of an early-access project
34
- * <li>{@code VERSION}: Either a specific version or `latest`
35
+ * <li>{@code VERSION}: Either a specific version or `latest` or `stable`
35
36
* <li>{@code OS-NAME}: An operating system name, usually one of: `linux`, `macos`, `windows`
36
37
* <li>{@code OS-ARCH}: An operating system architecture, like: `aarch64`, `x64`, or `x64-musl`
37
38
* </ul>
@@ -47,6 +48,12 @@ class ListOpenJavaDevelopmentKits {
47
48
/** Early-Access Releases, as comma separated names. */
48
49
static final String EA = System .getProperty ("EA" , "24,23,jextract,loom,valhalla" );
49
50
51
+ /** Current "latest" Early-Access Release number. */
52
+ static final String EA_LATEST = System .getProperty ("EA_LATEST" , "24" );
53
+
54
+ /** Current "stable" Early-Access Release number. */
55
+ static final String EA_STABLE = System .getProperty ("EA_STABLE" , "23" );
56
+
50
57
/** Include archived releases flag. */
51
58
static final boolean ARCHIVES = Boolean .getBoolean ("ARCHIVES" );
52
59
@@ -137,12 +144,25 @@ static List<String> generateEarlyAccessAliasKeys(String[] components) {
137
144
var from = version .indexOf ('-' );
138
145
var till = version .indexOf ('+' );
139
146
var project = from >= 0 && from < till ? version .substring (from + 1 , till ) : version ;
140
- components [0 ] = project ;
147
+ if (project .equals ("ea" )) {
148
+ var earlyAccessAliases = new ArrayList <String >();
149
+ components [0 ] = release ; // "23", "24", ...
150
+ components [1 ] = "latest" ;
151
+ earlyAccessAliases .add (String .join ("," , components ));
152
+ components [0 ] = "ea" ;
153
+ if (release .equals (EA_LATEST )) {
154
+ components [1 ] = "latest" ;
155
+ earlyAccessAliases .add (String .join ("," , components ));
156
+ }
157
+ if (release .equals (EA_STABLE )) {
158
+ components [1 ] = "stable" ;
159
+ earlyAccessAliases .add (String .join ("," , components ));
160
+ }
161
+ return earlyAccessAliases ;
162
+ }
163
+ components [0 ] = project ; // "loom", "valhalla", ...
141
164
components [1 ] = "latest" ;
142
- var alias = String .join ("," , components );
143
- if (!project .equals ("ea" )) return List .of (alias );
144
- components [0 ] = release ; // 18-latest-...
145
- return List .of (alias , String .join ("," , components ));
165
+ return List .of (String .join ("," , components ));
146
166
} catch (IndexOutOfBoundsException exception ) {
147
167
System .err .println ("Early-Access version without `-` and `+`: " + version );
148
168
return List .of ();
0 commit comments