diff --git a/src/main/java/rife/bld/operations/AbstractToolProviderOperation.java b/src/main/java/rife/bld/operations/AbstractToolProviderOperation.java index 0266328..0001298 100644 --- a/src/main/java/rife/bld/operations/AbstractToolProviderOperation.java +++ b/src/main/java/rife/bld/operations/AbstractToolProviderOperation.java @@ -6,11 +6,13 @@ import rife.bld.operations.exceptions.ExitStatusException; +import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.Reader; import java.nio.charset.Charset; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; @@ -67,25 +69,23 @@ public void execute() throws Exception { /** * Adds arguments to pass to the tool. * - * @param arg one or more argument + * @param args tbe list of arguments * @return this operation */ - @SuppressWarnings("unchecked") - public T toolArgs(String... arg) { - toolArgs(List.of(arg)); + @SuppressWarnings({"unchecked"}) + public T toolArgs(List args) { + toolArgs_.addAll(args); return (T) this; } /** * Adds arguments to pass to the tool. * - * @param args the argument to add + * @param args one or more arguments * @return this operation */ - @SuppressWarnings({"unchecked", "UnusedReturnValue"}) - public T toolArgs(List args) { - toolArgs_.addAll(args); - return (T) this; + public T toolArgs(String... args) { + return toolArgs(List.of(args)); } /** @@ -97,6 +97,28 @@ public List toolArgs() { return toolArgs_; } + /** + * Parses arguments to pass to the tool from the given files. + * + * @param files one or more files + * @return this operation instance + * @throws FileNotFoundException if a file cannot be found + */ + public T toolArgsFromFile(String... files) throws IOException { + return toolArgsFromFileStrings(List.of(files)); + } + + /** + * Parses arguments to pass to the tool from the given files. + * + * @param files one or more files + * @return this operation instance + * @throws FileNotFoundException if a file cannot be found + */ + public T toolArgsFromFile(Path... files) throws IOException { + return toolArgsFromFilePaths(List.of(files)); + } + /** * Parses arguments to pass to the tool from the given files. * @@ -104,8 +126,41 @@ public List toolArgs() { * @return this operation instance * @throws FileNotFoundException if a file cannot be found */ - @SuppressWarnings({"unchecked", "UnusedReturnValue"}) - public T toolArgsFromFile(List files) throws IOException { + public T toolArgsFromFile(List files) throws IOException { + return toolArgsFromFileStrings(files.stream().map(File::getAbsolutePath).toList()); + } + + /** + * Parses arguments to pass to the tool from the given files. + * + * @param files one or more files + * @return this operation instance + * @throws FileNotFoundException if a file cannot be found + */ + public T toolArgsFromFile(File... files) throws IOException { + return toolArgsFromFile(List.of(files)); + } + + /** + * Parses arguments to pass to the tool from the given files. + * + * @param files the list of files + * @return this operation instance + * @throws FileNotFoundException if a file cannot be found + */ + public T toolArgsFromFilePaths(List files) throws IOException { + return toolArgsFromFileStrings(files.stream().map(Path::toFile).map(File::getAbsolutePath).toList()); + } + + /** + * Parses arguments to pass to the tool from the given files. + * + * @param files the list of files + * @return this operation instance + * @throws FileNotFoundException if a file cannot be found + */ + @SuppressWarnings({"unchecked"}) + public T toolArgsFromFileStrings(List files) throws IOException { var args = new ArrayList(); for (var file : files) { diff --git a/src/main/java/rife/bld/operations/JlinkOperation.java b/src/main/java/rife/bld/operations/JlinkOperation.java index 50ab932..498f5c0 100644 --- a/src/main/java/rife/bld/operations/JlinkOperation.java +++ b/src/main/java/rife/bld/operations/JlinkOperation.java @@ -7,7 +7,6 @@ import java.io.File; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -29,33 +28,63 @@ public JlinkOperation() { /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JlinkOperation cmdFiles(String... file) { - cmdFiles_.addAll(List.of(file)); + public JlinkOperation cmdFiles(String... files) { + return cmdFilesStrings(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JlinkOperation cmdFiles(List files) { + cmdFiles_.addAll(files.stream().map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files + * @return this operation instance + */ + public JlinkOperation cmdFiles(File... files) { + return cmdFiles(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files * @return this operation instance */ - public JlinkOperation cmdFiles(File... file) { - cmdFiles_.addAll(Arrays.stream(file).map(File::getAbsolutePath).toList()); + public JlinkOperation cmdFiles(Path... files) { + return cmdFilesPaths(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JlinkOperation cmdFilesPaths(List files) { + cmdFiles_.addAll(files.stream().map(Path::toFile).map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JlinkOperation cmdFiles(Path... file) { - cmdFiles_.addAll(Arrays.stream(file).map(Path::toFile).map(File::getAbsolutePath).toList()); + public JlinkOperation cmdFilesStrings(List files) { + cmdFiles_.addAll(files); return this; } @@ -69,19 +98,29 @@ public List cmdFiles() { } /** - * Disable the plugin mentioned. + * Disable the plugin(s) mentioned. * - * @param plugin the plugin name + * @param plugins the plugin name(s) * @return this map of options */ - public JlinkOperation disablePlugin(String... plugin) { - disabledPlugins_.addAll(List.of(plugin)); + public JlinkOperation disablePlugin(List plugins) { + disabledPlugins_.addAll(plugins); return this; } + /** + * Disable the plugin(s) mentioned. + * + * @param plugins the plugin name(s) + * @return this map of options + */ + public JlinkOperation disablePlugin(String... plugins) { + return disablePlugin(List.of(plugins)); + } + @Override public void execute() throws Exception { - toolArgsFromFile(cmdFiles_); + toolArgsFromFileStrings(cmdFiles_); disabledPlugins_.forEach(plugin -> toolArgs("--disable-plugin", plugin)); toolArgs(jlinkOptions_); super.execute(); diff --git a/src/main/java/rife/bld/operations/JlinkOptions.java b/src/main/java/rife/bld/operations/JlinkOptions.java index 425482e..6cef875 100644 --- a/src/main/java/rife/bld/operations/JlinkOptions.java +++ b/src/main/java/rife/bld/operations/JlinkOptions.java @@ -7,7 +7,7 @@ import java.io.File; import java.nio.file.Path; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; /** @@ -16,7 +16,7 @@ * @author Erik C. Thauvin * @since 2.1.0 */ -public class JlinkOptions extends HashMap { +public class JlinkOptions extends LinkedHashMap { /** * All Modules Path. */ @@ -28,14 +28,26 @@ public class JlinkOptions extends HashMap { *

* Module can also be {@link #ALL_MODULE_PATH} * - * @param modules one or more module + * @param modules one or more modules * @return this map of options */ - public JlinkOptions addModules(String... modules) { + public JlinkOptions addModules(List modules) { put("--add-modules", String.join(",", modules)); return this; } + /** + * Root modules to resolve in addition to the initial modules. + *

+ * Module can also be {@link #ALL_MODULE_PATH} + * + * @param modules one or more modules + * @return this map of options + */ + public JlinkOptions addModules(String... modules) { + return addModules(List.of(modules)); + } + /** * Link in service provider modules and their dependencies. * @@ -141,13 +153,22 @@ public JlinkOptions launcher(String name, String module, String mainClass) { /** * Limit the universe of observable modules. * - * @param module one or more module + * @param modules one or more modules * @return this map of options */ - public JlinkOptions limitModule(String... module) { - put("--limit-modules", String.join(",", module)); + public JlinkOptions limitModule(List modules) { + put("--limit-modules", String.join(",", modules)); return this; } + /** + * Limit the universe of observable modules. + * + * @param modules one or more modules + * @return this map of options + */ + public JlinkOptions limitModule(String... modules) { + return limitModule(List.of(modules)); + } /** * Module path. @@ -304,14 +325,24 @@ public JlinkOptions stripNativeCommands(boolean stripNativeCommands) { /** * Suggest providers that implement the given service types from the module path. * - * @param name one or more provider name + * @param names one or more provider names * @return this map of options */ - public JlinkOptions suggestProviders(String... name) { - put("--suggest-providers", String.join(",", name)); + public JlinkOptions suggestProviders(List names) { + put("--suggest-providers", String.join(",", names)); return this; } + /** + * Suggest providers that implement the given service types from the module path. + * + * @param names one or more provider names + * @return this map of options + */ + public JlinkOptions suggestProviders(String... names) { + return suggestProviders(List.of(names)); + } + public List toList() { var list = new ArrayList(); forEach((k, v) -> { diff --git a/src/main/java/rife/bld/operations/JmodOperation.java b/src/main/java/rife/bld/operations/JmodOperation.java index ae68688..34896bb 100644 --- a/src/main/java/rife/bld/operations/JmodOperation.java +++ b/src/main/java/rife/bld/operations/JmodOperation.java @@ -36,36 +36,57 @@ public List cmdFiles() { return cmdFiles; } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JmodOperation cmdFiles(String... files) { + return cmdFilesStrings(List.of(files)); + } + /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JmodOperation cmdFiles(String... file) { - cmdFiles.addAll(List.of(file)); + public JmodOperation cmdFiles(File... files) { + cmdFiles.addAll(Arrays.stream(files).map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JmodOperation cmdFiles(File... file) { - cmdFiles.addAll(Arrays.stream(file).map(File::getAbsolutePath).toList()); + public JmodOperation cmdFiles(Path... files) { + return cmdFilesPaths(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JmodOperation cmdFilesPaths(List files) { + cmdFiles.addAll(files.stream().map(Path::toFile).map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JmodOperation cmdFiles(Path... file) { - cmdFiles.addAll(Arrays.stream(file).map(Path::toFile).map(File::getAbsolutePath).toList()); + public JmodOperation cmdFilesStrings(List files) { + cmdFiles.addAll(files); return this; } @@ -75,7 +96,7 @@ public void execute() throws Exception { toolArgs(operationMode_.mode); } - toolArgsFromFile(cmdFiles); + toolArgsFromFileStrings(cmdFiles); toolArgs(jmodOptions_); if (jmodFile_ != null) { @@ -129,8 +150,7 @@ public JmodOperation jmodFile(File file) { * @return this operation instance */ public JmodOperation jmodFile(Path file) { - jmodFile_ = file.toFile().getAbsolutePath(); - return this; + return jmodFile(file.toFile()); } /** diff --git a/src/main/java/rife/bld/operations/JmodOptions.java b/src/main/java/rife/bld/operations/JmodOptions.java index 668163e..d9e3128 100644 --- a/src/main/java/rife/bld/operations/JmodOptions.java +++ b/src/main/java/rife/bld/operations/JmodOptions.java @@ -10,7 +10,8 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; /** * Options for jmod tool. @@ -18,7 +19,7 @@ * @author Erik C. Thauvin * @since 2.1.0 */ -public class JmodOptions extends HashMap { +public class JmodOptions extends LinkedHashMap { /** * Application jar files|dir containing classes. * @@ -187,12 +188,12 @@ public JmodOptions dryRun(boolean dryRun) { /** * Exclude files matching the supplied pattern list. * - * @param pattern one or more pattern + * @param patterns one or more patterns * @return the map of options */ - public JmodOptions exclude(FilePattern... pattern) { + public JmodOptions exclude(List patterns) { var args = new ArrayList(); - for (var p : pattern) { + for (var p : patterns) { if (p.type == FilePatternType.GLOB) { args.add("glob:" + p.pattern); } else if (p.type == FilePatternType.REGEX) { @@ -203,6 +204,16 @@ public JmodOptions exclude(FilePattern... pattern) { return this; } + /** + * Exclude files matching the supplied pattern list. + * + * @param patterns one or more patterns + * @return the map of options + */ + public JmodOptions exclude(FilePattern... patterns) { + return exclude(List.of(patterns)); + } + /** * Compute and record hashes to tie a packaged module with modules matching the given regular expression pattern and * depending upon it directly or indirectly. The hashes are recorded in the JMOD file being created, or a JMOD file diff --git a/src/main/java/rife/bld/operations/JpackageOperation.java b/src/main/java/rife/bld/operations/JpackageOperation.java index 9e2ff76..d359505 100644 --- a/src/main/java/rife/bld/operations/JpackageOperation.java +++ b/src/main/java/rife/bld/operations/JpackageOperation.java @@ -7,7 +7,6 @@ import java.io.File; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -34,44 +33,89 @@ public JpackageOperation() { * Additional alternative launchers can be built using this option, and this option can be used to build multiple * additional launchers. * - * @param launcher one or more {@link JpackageOperation.Launcher} + * @param launchers one or more {@link Launcher launchers} * @return this operation instance */ - public JpackageOperation addLauncher(Launcher... launcher) { - launchers_.addAll(Arrays.asList(launcher)); + public JpackageOperation addLauncher(List launchers) { + launchers_.addAll(launchers); return this; } + /** + * List of application launchers. + *

+ * The main application launcher will be built from the command line options. + *

+ * Additional alternative launchers can be built using this option, and this option can be used to build multiple + * additional launchers. + * + * @param launchers one or more {@link Launcher launchers} + * @return this operation instance + */ + public JpackageOperation addLauncher(Launcher... launchers) { + return addLauncher(List.of(launchers)); + } + /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JpackageOperation cmdFiles(File... file) { - cmdFiles_.addAll(Arrays.stream(file).map(File::getAbsolutePath).toList()); + public JpackageOperation cmdFiles(List files) { + cmdFiles_.addAll(files.stream().map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files + * @return this operation instance + */ + public JpackageOperation cmdFiles(File... files) { + return cmdFiles(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JpackageOperation cmdFiles(Path... files) { + return cmdFilesPaths(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files + * @return this operation instance + */ + public JpackageOperation cmdFiles(String... files) { + return cmdFilesStrings(List.of(files)); + } + + /** + * Read options and/or mode from file(s). + * + * @param files one or more files * @return this operation instance */ - public JpackageOperation cmdFiles(Path... file) { - cmdFiles_.addAll(Arrays.stream(file).map(Path::toFile).map(File::getAbsolutePath).toList()); + public JpackageOperation cmdFilesPaths(List files) { + cmdFiles_.addAll(files.stream().map(Path::toFile).map(File::getAbsolutePath).toList()); return this; } /** * Read options and/or mode from file(s). * - * @param file one or more file + * @param files one or more files * @return this operation instance */ - public JpackageOperation cmdFiles(String... file) { - cmdFiles_.addAll(List.of(file)); + public JpackageOperation cmdFilesStrings(List files) { + cmdFiles_.addAll(files); return this; } @@ -147,7 +191,7 @@ public Launcher(String name, File path) { } public Launcher(String name, Path path) { - this(name, path.toFile().getAbsolutePath()); + this(name, path.toFile()); } } } diff --git a/src/main/java/rife/bld/operations/JpackageOptions.java b/src/main/java/rife/bld/operations/JpackageOptions.java index 0e6412c..19122bf 100644 --- a/src/main/java/rife/bld/operations/JpackageOptions.java +++ b/src/main/java/rife/bld/operations/JpackageOptions.java @@ -6,8 +6,7 @@ import java.io.File; import java.nio.file.Path; -import java.util.Arrays; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; /** @@ -16,7 +15,7 @@ * @author Erik C. Thauvin * @since 2.1.0 */ -public class JpackageOptions extends HashMap { +public class JpackageOptions extends LinkedHashMap { /** * URL of the application's home page. * @@ -36,27 +35,54 @@ public JpackageOptions aboutUrl(String url) { * (if {@link #module(String, String) module} is specified), or the default set of modules (if * {@link #mainJar(String) mainJar} is specified) are used. * - * @param modules one or more module + * @param modules one or more modules * @return this map of options */ - public JpackageOptions addModules(String... modules) { + public JpackageOptions addModules(List modules) { put("--add-modules", String.join(",", modules)); return this; } + /** + * List of modules to add. + *

+ * This module list, along with the main module (if specified) will be passed to jlink as the + * {@link JlinkOptions#addModules(String...) addModules} argument. If not specified, either just the main module + * (if {@link #module(String, String) module} is specified), or the default set of modules (if + * {@link #mainJar(String) mainJar} is specified) are used. + * + * @param modules one or more modules + * @return this map of options + */ + public JpackageOptions addModules(String... modules) { + return addModules(List.of(modules)); + } + /** * List of paths to files and/or directories to add to the application payload. *

* Requires Java 20 or higher. * - * @param additionalContent one or more path + * @param additionalContents one or more paths * @return this map of options */ - public JpackageOptions appContent(String... additionalContent) { - put("--app-content", String.join(",", additionalContent)); + public JpackageOptions appContent(List additionalContents) { + put("--app-content", String.join(",", additionalContents)); return this; } + /** + * List of paths to files and/or directories to add to the application payload. + *

+ * Requires Java 20 or higher. + * + * @param additionalContents one or more paths + * @return this map of options + */ + public JpackageOptions appContent(String... additionalContents) { + return appContent(List.of(additionalContents)); + } + /** * Location of the predefined application image that is used to build an installable package. * @@ -103,14 +129,24 @@ public JpackageOptions appVersion(String version) { /** * Command line arguments to pass to main class if no command line arguments are given to the launcher. * - * @param argument one or more argument + * @param arguments one or more arguments * @return this map of options */ - public JpackageOptions arguments(String... argument) { - put("--arguments", String.join(" ", argument)); + public JpackageOptions arguments(List arguments) { + put("--arguments", String.join(" ", arguments)); return this; } + /** + * Command line arguments to pass to main class if no command line arguments are given to the launcher. + * + * @param arguments one or more arguments + * @return this map of options + */ + public JpackageOptions arguments(String... arguments) { + return arguments(List.of(arguments)); + } + /** * Copyright of the application. * @@ -180,8 +216,9 @@ public JpackageOptions dest(Path path) { * @param paths absolute paths or relative to the current directory * @return this map of options */ - public JpackageOptions fileAssociations(String... paths) { - return fileAssociationsStrings(List.of(paths)); + public JpackageOptions fileAssociationsStrings(List paths) { + put("--file-associations", String.join(",", paths)); + return this; } /** @@ -193,9 +230,8 @@ public JpackageOptions fileAssociations(String... paths) { * @param paths absolute paths or relative to the current directory * @return this map of options */ - public JpackageOptions fileAssociationsStrings(List paths) { - put("--file-associations", String.join(",", paths)); - return this; + public JpackageOptions fileAssociations(String... paths) { + return fileAssociationsStrings(List.of(paths)); } /** @@ -234,8 +270,8 @@ public JpackageOptions fileAssociations(List paths) { * @param paths absolute paths or relative to the current directory * @return this map of options */ - public JpackageOptions fileAssociations(Path... paths) { - return fileAssociationsPaths(List.of(paths)); + public JpackageOptions fileAssociationsPaths(List paths) { + return fileAssociations(paths.stream().map(Path::toFile).toList()); } /** @@ -247,8 +283,8 @@ public JpackageOptions fileAssociations(Path... paths) { * @param paths absolute paths or relative to the current directory * @return this map of options */ - public JpackageOptions fileAssociationsPaths(List paths) { - return fileAssociations(paths.stream().map(Path::toFile).toList()); + public JpackageOptions fileAssociations(Path... paths) { + return fileAssociationsPaths(List.of(paths)); } /** @@ -316,6 +352,7 @@ public JpackageOptions input(File path) { * @param path absolute path or relative to the current directory * @return this map of options */ + @SuppressWarnings("UnusedReturnValue") public JpackageOptions input(Path path) { return input(path.toFile()); } @@ -358,11 +395,21 @@ public JpackageOptions installDir(Path path) { * @param options the options * @return this map of options */ - public JpackageOptions javaOptions(String... options) { + public JpackageOptions javaOptions(List options) { put("--java-options", String.join(" ", options)); return this; } + /** + * Options to pass to the Java runtime. + * + * @param options the options + * @return this map of options + */ + public JpackageOptions javaOptions(String... options) { + return javaOptions(List.of(options)); + } + /** * List of options to pass to jlink. *

@@ -572,35 +619,66 @@ public JpackageOptions macAppStore(boolean appStore) { /** * Include all the referenced content in the dmg. * - * @param additionalContent one or more path + * @param additionalContents one or more paths * @return this map of options */ - public JpackageOptions macDmgContent(String... additionalContent) { - put("--mac-dmg-content", String.join(",", additionalContent)); - return this; + public JpackageOptions macDmgContent(String... additionalContents) { + return macDmgContentStrings(List.of(additionalContents)); } /** * Include all the referenced content in the dmg. * - * @param additionalContent one or more path + * @param additionalContents one or more paths * @return this map of options */ @SuppressWarnings("UnusedReturnValue") - public JpackageOptions macDmgContent(File... additionalContent) { - put("--mac-dmg-content", String.join(",", Arrays.stream(additionalContent).map(File::getAbsolutePath).toList())); + public JpackageOptions macDmgContent(List additionalContents) { + put("--mac-dmg-content", String.join(",", additionalContents.stream().map(File::getAbsolutePath).toList())); return this; } /** * Include all the referenced content in the dmg. * - * @param additionalContent one or more path + * @param additionalContents one or more paths + * @return this map of options + */ + @SuppressWarnings("UnusedReturnValue") + public JpackageOptions macDmgContent(File... additionalContents) { + return macDmgContent(List.of(additionalContents)); + } + + /** + * Include all the referenced content in the dmg. + * + * @param additionalContents one or more paths * @return this map of options */ - public JpackageOptions macDmgContent(Path... additionalContent) { + public JpackageOptions macDmgContentPaths(List additionalContents) { put("--mac-dmg-content", String.join(",", - Arrays.stream(additionalContent).map(Path::toFile).map(File::getAbsolutePath).toList())); + additionalContents.stream().map(Path::toFile).map(File::getAbsolutePath).toList())); + return this; + } + + /** + * Include all the referenced content in the dmg. + * + * @param additionalContents one or more paths + * @return this map of options + */ + public JpackageOptions macDmgContentPaths(Path... additionalContents) { + return macDmgContentPaths(List.of(additionalContents)); + } + + /** + * Include all the referenced content in the dmg. + * + * @param additionalContents one or more paths + * @return this map of options + */ + public JpackageOptions macDmgContentStrings(List additionalContents) { + put("--mac-dmg-content", String.join(",", additionalContents)); return this; } @@ -815,7 +893,7 @@ public JpackageOptions module(String name, String mainClass) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ public JpackageOptions modulePath(String... paths) { @@ -829,7 +907,7 @@ public JpackageOptions modulePath(String... paths) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ public JpackageOptions modulePathStrings(List paths) { @@ -844,9 +922,10 @@ public JpackageOptions modulePathStrings(List paths) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ + @SuppressWarnings("UnusedReturnValue") public JpackageOptions modulePath(File... paths) { return modulePath(List.of(paths)); } @@ -858,7 +937,7 @@ public JpackageOptions modulePath(File... paths) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ public JpackageOptions modulePath(List paths) { @@ -872,7 +951,7 @@ public JpackageOptions modulePath(List paths) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ public JpackageOptions modulePath(Path... paths) { @@ -886,7 +965,7 @@ public JpackageOptions modulePath(Path... paths) { *

* Each path is absolute or relative to the current directory. * - * @param paths one or more path + * @param paths one or more paths * @return this map of options */ public JpackageOptions modulePathPaths(List paths) { diff --git a/src/test/java/rife/bld/operations/TestJpackageOperation.java b/src/test/java/rife/bld/operations/TestJpackageOperation.java index f81a822..ed3df25 100644 --- a/src/test/java/rife/bld/operations/TestJpackageOperation.java +++ b/src/test/java/rife/bld/operations/TestJpackageOperation.java @@ -363,7 +363,7 @@ void testMacDmgContent() { var barPath = Path.of("bar"); var fooPath = Path.of("foo"); - options = options.macDmgContent(barPath, fooPath); + options = options.macDmgContentPaths(barPath, fooPath); assertEquals(barPath.toFile().getAbsolutePath() + ',' + fooPath.toFile().getAbsolutePath(), options.get("--mac-dmg-content"));