gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
372 stars 51 forks source link

added support for graalvm version strings without minor version #1234

Closed ennerf closed 7 months ago

ennerf commented 8 months ago

Substrate currently fails for some GraalVM builds that print versions without minor revision numbers, e.g., graalvm-jdk-21+35.1/bin/java -version

java version "21" 2023-09-19
Java(TM) SE Runtime Environment Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)

This PR changes the Regex from GraalVM .*?(\d\d.\d.\d) to GraalVM (\d{1,2}(\.\d+){0,2}) (same as for the Java version) and adds unit tests for a variety of old and new GraalVM builds on different platforms

Current Regex

GraalVM .*?(\d\d.\d.\d)

image

Updated Regex

GraalVM (\d{1,2}(.\d+){0,2})

image