diff --git a/common/utils/src/test/java/org/graalvm/buildtools/utils/FileUtilsTest.java b/common/utils/src/test/java/org/graalvm/buildtools/utils/FileUtilsTest.java index c266c2e7a..48fdc92fc 100644 --- a/common/utils/src/test/java/org/graalvm/buildtools/utils/FileUtilsTest.java +++ b/common/utils/src/test/java/org/graalvm/buildtools/utils/FileUtilsTest.java @@ -80,21 +80,21 @@ void testDownloadOk(@TempDir Path tempDir) throws IOException { @Test @DisplayName("It doesn't blow up with a URL that isn't a file download") void testDownloadNoFile(@TempDir Path tempDir) throws IOException { - URL url = new URL("https://httpstat.us/200"); + URL url = new URL("https://httpbin.org/html"); List errorLogs = new ArrayList<>(); Optional download = FileUtils.download(url, tempDir, errorLogs::add); System.out.println("errorLogs = " + errorLogs); assertTrue(download.isPresent()); - assertEquals("200", download.get().getFileName().toString()); + assertEquals("html", download.get().getFileName().toString()); assertEquals(0, errorLogs.size()); } @Test @DisplayName("It doesn't blow up with a URL that does not exist") void testDownloadNotFound(@TempDir Path tempDir) throws IOException { - URL url = new URL("https://httpstat.us/404"); + URL url = new URL("https://google.com/notfound"); List errorLogs = new ArrayList<>(); Optional download = FileUtils.download(url, tempDir, errorLogs::add); @@ -107,7 +107,7 @@ void testDownloadNotFound(@TempDir Path tempDir) throws IOException { @Test @DisplayName("It doesn't blow up with connection timeouts") void testDownloadTimeout(@TempDir Path tempDir) throws IOException { - URL url = new URL("https://httpstat.us/200?sleep=" + (FileUtils.READ_TIMEOUT + 1000)); + URL url = new URL("https://httpbin.org/delay/10"); List errorLogs = new ArrayList<>(); Optional download = FileUtils.download(url, tempDir, errorLogs::add); diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index b5c6bc095..334a9eb67 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -19,6 +19,12 @@ If you are using alternative build systems, see < args = getBuildArgs(); + List conversionResult = NativeImageUtils.convertToArgsFile(args, outputDirectory.toPath()); + if (conversionResult.size() == 1) { + String argsFileName = conversionResult.get(0).replace("@", ""); + getLog().info("Args file written to: " + argsFileName); + File argsFile = new File(argsFileName); + project.getProperties().setProperty(PROPERTY_NAME, argsFile.getAbsolutePath()); + } else { + throw new MojoExecutionException("Error writing args file"); + } + } +}