mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 08:17:11 -07:00
Cleanups to JlinkOptions, JmodOptions and JpackageOptions
This commit is contained in:
parent
22add235e3
commit
b8a63dd79c
3 changed files with 140 additions and 104 deletions
|
@ -173,8 +173,7 @@ public class JlinkOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JlinkOptions modulePath(File path) {
|
public JlinkOptions modulePath(File path) {
|
||||||
put("--module-path", path.getAbsolutePath());
|
return modulePath(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -187,8 +186,7 @@ public class JlinkOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JlinkOptions modulePath(Path path) {
|
public JlinkOptions modulePath(Path path) {
|
||||||
put("--module-path", path.toFile().getAbsolutePath());
|
return modulePath(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -239,8 +237,7 @@ public class JlinkOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JlinkOptions output(File path) {
|
public JlinkOptions output(File path) {
|
||||||
put("--output", path.getAbsolutePath());
|
return output(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -250,8 +247,7 @@ public class JlinkOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JlinkOptions output(Path path) {
|
public JlinkOptions output(Path path) {
|
||||||
put("--output", path.toFile().getAbsolutePath());
|
return output(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,8 +49,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JmodOptions cmds(File path) {
|
public JmodOptions cmds(File path) {
|
||||||
put("--cmds", path.getAbsolutePath());
|
return cmds(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,8 +59,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions cmds(Path path) {
|
public JmodOptions cmds(Path path) {
|
||||||
put("--cmds", path.toFile().getAbsolutePath());
|
return cmds(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,8 +99,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions config(File path) {
|
public JmodOptions config(File path) {
|
||||||
put("--config", path.getAbsolutePath());
|
return config(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,8 +109,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions config(Path path) {
|
public JmodOptions config(Path path) {
|
||||||
put("--config", path.toFile().getAbsolutePath());
|
return config(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,8 +141,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions dir(File path) {
|
public JmodOptions dir(File path) {
|
||||||
put("--dir", path.getAbsolutePath());
|
return dir(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -156,8 +151,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions dir(Path path) {
|
public JmodOptions dir(Path path) {
|
||||||
put("--dir", path.toFile().getAbsolutePath());
|
return dir(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -241,8 +235,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JmodOptions headerFiles(File path) {
|
public JmodOptions headerFiles(File path) {
|
||||||
put("--header-files", path.getAbsolutePath());
|
return headerFiles(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -252,8 +245,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions headerFiles(Path path) {
|
public JmodOptions headerFiles(Path path) {
|
||||||
put("--header-files", path.toFile().getAbsolutePath());
|
return headerFiles(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -275,8 +267,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JmodOptions legalNotices(File path) {
|
public JmodOptions legalNotices(File path) {
|
||||||
put("--legal-notices", path.getAbsolutePath());
|
return legalNotices(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -286,8 +277,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions legalNotices(Path path) {
|
public JmodOptions legalNotices(Path path) {
|
||||||
put("--legal-notices", path.toFile().getAbsolutePath());
|
return legalNotices(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -309,8 +299,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JmodOptions libs(File path) {
|
public JmodOptions libs(File path) {
|
||||||
put("--libs", path.getAbsolutePath());
|
return libs(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -320,8 +309,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions libs(Path path) {
|
public JmodOptions libs(Path path) {
|
||||||
put("--libs", path.toFile().getAbsolutePath());
|
return libs(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -354,8 +342,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JmodOptions manPages(File path) {
|
public JmodOptions manPages(File path) {
|
||||||
put("--man-pages", path.getAbsolutePath());
|
return manPages(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -365,8 +352,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions manPages(Path path) {
|
public JmodOptions manPages(Path path) {
|
||||||
put("--man-pages", path.toFile().getAbsolutePath());
|
return manPages(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -387,8 +373,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions modulePath(File path) {
|
public JmodOptions modulePath(File path) {
|
||||||
put("--module-path", path.getAbsolutePath());
|
return modulePath(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -398,8 +383,7 @@ public class JmodOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JmodOptions modulePath(Path path) {
|
public JmodOptions modulePath(Path path) {
|
||||||
put("--module-path", path.toFile().getAbsolutePath());
|
return modulePath(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.io.File;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options for jpackage tool.
|
* Options for jpackage tool.
|
||||||
|
@ -74,8 +75,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions appImage(File path) {
|
public JpackageOptions appImage(File path) {
|
||||||
put("--app-image", path.getAbsolutePath());
|
return appImage(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,8 +86,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions appImage(Path path) {
|
public JpackageOptions appImage(Path path) {
|
||||||
put("--app-image", path.toFile().getAbsolutePath());
|
return appImage(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -157,8 +156,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions dest(File path) {
|
public JpackageOptions dest(File path) {
|
||||||
put("--dest", path.getAbsolutePath());
|
return dest(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,8 +168,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions dest(Path path) {
|
public JpackageOptions dest(Path path) {
|
||||||
put("--dest", path.toFile().getAbsolutePath());
|
return dest(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,11 +177,24 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
* association.
|
* association.
|
||||||
*
|
*
|
||||||
* @param path absolute path or relative to the current directory
|
* @param paths absolute paths or relative to the current directory
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions fileAssociations(String... path) {
|
public JpackageOptions fileAssociations(String... paths) {
|
||||||
put("--file-associations", String.join(",", path));
|
return fileAssociationsStrings(List.of(paths));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to a Properties file that contains list of key, value pairs.
|
||||||
|
* <p>
|
||||||
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
|
* association.
|
||||||
|
*
|
||||||
|
* @param paths absolute paths or relative to the current directory
|
||||||
|
* @return this map of options
|
||||||
|
*/
|
||||||
|
public JpackageOptions fileAssociationsStrings(List<String> paths) {
|
||||||
|
put("--file-associations", String.join(",", paths));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,13 +204,12 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
* association.
|
* association.
|
||||||
*
|
*
|
||||||
* @param path absolute path or relative to the current directory
|
* @param paths absolute path or relative to the current directory
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions fileAssociations(File... path) {
|
public JpackageOptions fileAssociations(File... paths) {
|
||||||
put("--file-associations", String.join(",", Arrays.stream(path).map(File::getAbsolutePath).toList()));
|
return fileAssociations(List.of(paths));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,13 +218,37 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
* association.
|
* association.
|
||||||
*
|
*
|
||||||
* @param path absolute path or relative to the current directory
|
* @param paths absolute path or relative to the current directory
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions fileAssociations(Path... path) {
|
public JpackageOptions fileAssociations(List<File> paths) {
|
||||||
put("--file-associations", String.join(",",
|
return fileAssociationsStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||||
Arrays.stream(path).map(Path::toFile).map(File::getAbsolutePath).toList()));
|
}
|
||||||
return this;
|
|
||||||
|
/**
|
||||||
|
* Path to a Properties file that contains list of key, value pairs.
|
||||||
|
* <p>
|
||||||
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
|
* association.
|
||||||
|
*
|
||||||
|
* @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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to a Properties file that contains list of key, value pairs.
|
||||||
|
* <p>
|
||||||
|
* The keys {@code extension}, {@code mime-type}, {@code icon}, and {@code description} can be used to describe the
|
||||||
|
* association.
|
||||||
|
*
|
||||||
|
* @param paths absolute paths or relative to the current directory
|
||||||
|
* @return this map of options
|
||||||
|
*/
|
||||||
|
public JpackageOptions fileAssociationsPaths(List<Path> paths) {
|
||||||
|
return fileAssociations(paths.stream().map(Path::toFile).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -237,8 +270,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions icon(File path) {
|
public JpackageOptions icon(File path) {
|
||||||
put("--icon", path.getAbsolutePath());
|
return icon(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -248,8 +280,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions icon(Path path) {
|
public JpackageOptions icon(Path path) {
|
||||||
put("--icon", path.toFile().getAbsolutePath());
|
return icon(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -274,8 +305,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions input(File path) {
|
public JpackageOptions input(File path) {
|
||||||
put("--input", path.getAbsolutePath());
|
return input(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -287,8 +317,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions input(Path path) {
|
public JpackageOptions input(Path path) {
|
||||||
put("--input", path.toFile().getAbsolutePath());
|
return input(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -310,8 +339,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions installDir(File path) {
|
public JpackageOptions installDir(File path) {
|
||||||
put("--install-dir", path.getAbsolutePath());
|
return installDir(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -321,8 +349,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions installDir(Path path) {
|
public JpackageOptions installDir(Path path) {
|
||||||
put("--install-dir", path.toFile().getAbsolutePath());
|
return installDir(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -388,8 +415,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions licenseFile(File path) {
|
public JpackageOptions licenseFile(File path) {
|
||||||
put("--license-file", path.getAbsolutePath());
|
return licenseFile(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -399,8 +425,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions licenseFile(Path path) {
|
public JpackageOptions licenseFile(Path path) {
|
||||||
put("--license-file", path.toFile().getAbsolutePath());
|
return licenseFile(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -598,8 +623,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions macEntitlements(File path) {
|
public JpackageOptions macEntitlements(File path) {
|
||||||
put("--mac-entitlements", path.getAbsolutePath());
|
return macEntitlements(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -609,8 +633,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions macEntitlements(Path path) {
|
public JpackageOptions macEntitlements(Path path) {
|
||||||
put("--mac-entitlements", path.toFile().getAbsolutePath());
|
return macEntitlements(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -792,11 +815,25 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* <p>
|
* <p>
|
||||||
* Each path is absolute or relative to the current directory.
|
* Each path is absolute or relative to the current directory.
|
||||||
*
|
*
|
||||||
* @param path one or more path
|
* @param paths one or more path
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions modulePath(String... path) {
|
public JpackageOptions modulePath(String... paths) {
|
||||||
put("--module-path", String.join(":", path));
|
return modulePathStrings(List.of(paths));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of module paths.
|
||||||
|
* <p>
|
||||||
|
* Each path is either a directory of modules or the path to a modular jar.
|
||||||
|
* <p>
|
||||||
|
* Each path is absolute or relative to the current directory.
|
||||||
|
*
|
||||||
|
* @param paths one or more path
|
||||||
|
* @return this map of options
|
||||||
|
*/
|
||||||
|
public JpackageOptions modulePathStrings(List<String> paths) {
|
||||||
|
put("--module-path", String.join(":", paths));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -807,12 +844,11 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* <p>
|
* <p>
|
||||||
* Each path is absolute or relative to the current directory.
|
* Each path is absolute or relative to the current directory.
|
||||||
*
|
*
|
||||||
* @param path one or more path
|
* @param paths one or more path
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions modulePath(File... path) {
|
public JpackageOptions modulePath(File... paths) {
|
||||||
put("--module-path", String.join(":", Arrays.stream(path).map(File::getAbsolutePath).toList()));
|
return modulePath(List.of(paths));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -822,13 +858,39 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* <p>
|
* <p>
|
||||||
* Each path is absolute or relative to the current directory.
|
* Each path is absolute or relative to the current directory.
|
||||||
*
|
*
|
||||||
* @param path one or more path
|
* @param paths one or more path
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions modulePath(Path... path) {
|
public JpackageOptions modulePath(List<File> paths) {
|
||||||
put("--module-path", String.join(":",
|
return modulePathStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||||
Arrays.stream(path).map(Path::toFile).map(File::getAbsolutePath).toList()));
|
}
|
||||||
return this;
|
|
||||||
|
/**
|
||||||
|
* List of module paths.
|
||||||
|
* <p>
|
||||||
|
* Each path is either a directory of modules or the path to a modular jar.
|
||||||
|
* <p>
|
||||||
|
* Each path is absolute or relative to the current directory.
|
||||||
|
*
|
||||||
|
* @param paths one or more path
|
||||||
|
* @return this map of options
|
||||||
|
*/
|
||||||
|
public JpackageOptions modulePath(Path... paths) {
|
||||||
|
return modulePathPaths(List.of(paths));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of module paths.
|
||||||
|
* <p>
|
||||||
|
* Each path is either a directory of modules or the path to a modular jar.
|
||||||
|
* <p>
|
||||||
|
* Each path is absolute or relative to the current directory.
|
||||||
|
*
|
||||||
|
* @param paths one or more path
|
||||||
|
* @return this map of options
|
||||||
|
*/
|
||||||
|
public JpackageOptions modulePathPaths(List<Path> paths) {
|
||||||
|
return modulePath(paths.stream().map(Path::toFile).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -877,8 +939,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions resourceDir(File path) {
|
public JpackageOptions resourceDir(File path) {
|
||||||
put("--resource-dir", path.getAbsolutePath());
|
return resourceDir(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -891,8 +952,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions resourceDir(Path path) {
|
public JpackageOptions resourceDir(Path path) {
|
||||||
put("--resource-dir", path.toFile().getAbsolutePath());
|
return resourceDir(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -928,8 +988,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions runtimeImage(File path) {
|
public JpackageOptions runtimeImage(File path) {
|
||||||
put("--runtime-image", path.getAbsolutePath());
|
return runtimeImage(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -946,8 +1005,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions runtimeImage(Path path) {
|
public JpackageOptions runtimeImage(Path path) {
|
||||||
put("--runtime-image", path.toFile().getAbsolutePath());
|
return runtimeImage(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -992,8 +1050,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
public JpackageOptions temp(File path) {
|
public JpackageOptions temp(File path) {
|
||||||
put("--temp", path.getAbsolutePath());
|
return temp(path.getAbsolutePath());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1007,8 +1064,7 @@ public class JpackageOptions extends HashMap<String, String> {
|
||||||
* @return this map of options
|
* @return this map of options
|
||||||
*/
|
*/
|
||||||
public JpackageOptions temp(Path path) {
|
public JpackageOptions temp(Path path) {
|
||||||
put("--temp", path.toFile().getAbsolutePath());
|
return temp(path.toFile());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue