Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java
index 28d346f..deb3e1c 100644
--- a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java
+++ b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java
@@ -28,7 +28,9 @@ import java.util.stream.Collectors;
public class TemurinIndexer
{
- static final Pattern TAG_NAME = Pattern.compile("\"name\"\\s*:\\s*\"(jdk-([0-9]+)(?:\\.([0-9]+))(?:\\.([0-9]+))(?:\\.([0-9]+))?\\+([0-9]+))\"");
+ static final Pattern TAG_NAME_ANY = Pattern.compile("\"name\"\\s*:\\s*\"([^\"]+)\"");
+
+ static final Pattern TAG_NAME = Pattern.compile("\"name\"\\s*:\\s*\"(jdk-([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?(?:\\.([0-9]+))?\\+([0-9]+))\"");
static final Pattern JDK_URL1 = Pattern.compile(
"href=\"/adoptium/temurin([0-9]+)-binaries/releases/download/jdk-([0-9]+)%2B35/OpenJDK([0-9]+)-jdk_([^_]+)_([^_]+)_hotspot_([0-9.]+)\\.(tar.gz|zip)\"");
@@ -40,7 +42,7 @@ public class TemurinIndexer
{
System.out.println("// Generated by /org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TemurinIndexer.java");
- for (String repo : new String []{ "11", "17" })
+ for (String repo : new String []{ "11", "17", "18" })
{
URL url = new URL("https://api.github.com/repos/adoptium/temurin" + repo + "-binaries/tags");
try (InputStream input = url.openStream())
@@ -52,19 +54,21 @@ public class TemurinIndexer
for (Matcher matcher = TAG_NAME.matcher(line); matcher.find();)
{
long version = Integer.parseInt(matcher.group(2));
- version = 1000L * version + Integer.parseInt(matcher.group(3));
- version = 100L * version + Integer.parseInt(matcher.group(4));
- if (matcher.group(5) != null)
- {
- version = 100L * version + Integer.parseInt(matcher.group(5));
- }
- else
- {
- version = 100L * version;
- }
+ version = 1000L * version + (matcher.group(3) == null ? 0 : Integer.parseInt(matcher.group(3)));
+ version = 100L * version + (matcher.group(4) == null ? 0 : Integer.parseInt(matcher.group(4)));
+ version = 100L * version + (matcher.group(5) == null ? 0 : Integer.parseInt(matcher.group(5)));
version = 100L * version + Integer.parseInt(matcher.group(6));
versionTags.put(version, matcher.group(1));
}
+
+ if (versionTags.isEmpty())
+ {
+ for (Matcher matcher = TAG_NAME_ANY.matcher(line); matcher.find();)
+ {
+ String name = matcher.group(1);
+ System.err.println("###" + name);
+ }
+ }
}
System.out.println();

Back to the top