Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Fixes version parsing for WARNING situations #443

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions build.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -43,6 +40,9 @@
import java.util.stream.IntStream;
import java.util.stream.Stream;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

public class build
{
static final Logger logger = LogManager.getLogger(build.class);
Expand Down Expand Up @@ -337,8 +337,21 @@ else if (archiveName.endsWith("zip") && !IS_WINDOWS)

private static String getMandrelVersion(FileSystem fs, OperatingSystem os, Path mandrelRepo)
{
String mandrelVersion = os.exec(Mx.mandrelVersion(fs.mxHome(), fs.mandrelRepo()), true).get(0);

final Pattern startsWithNumber = Pattern.compile("^\\d.*");
String mandrelVersion = null;
final List<String> o = os.exec(Mx.mandrelVersion(fs.mxHome(), fs.mandrelRepo()), true);
for (String s : o)
{
logger.info("mx's graalvm-version output: " + s);
if (mandrelVersion == null && startsWithNumber.matcher(s).matches())
{
mandrelVersion = s;
}
}
if (mandrelVersion == null)
{
throw new RuntimeException("Could not determine Mandrel version from mx graalvm-version output");
}
if (mandrelVersion.endsWith("-dev"))
{
final Tasks.Exec command = Tasks.Exec.of(Arrays.asList("git", "rev-parse", "--short", "HEAD"), mandrelRepo);
Expand Down
Loading