mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 08:37:11 -07:00
More operation options cleanups
This commit is contained in:
parent
91640e68ce
commit
1d615a501c
7 changed files with 73 additions and 105 deletions
|
@ -17,6 +17,7 @@ import java.nio.file.Files;
|
|||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static rife.bld.operations.JlinkOptions.CompressionLevel;
|
||||
|
||||
public class TestJlinkOperation {
|
||||
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
|
||||
|
@ -32,7 +33,7 @@ public class TestJlinkOperation {
|
|||
var args = new HashMap<String, String>();
|
||||
args.put("--add-modules", "module-1,module-2");
|
||||
args.put("--bind-services", null);
|
||||
args.put("--compress", "zip-6");
|
||||
args.put("--compress", "2");
|
||||
args.put("--endian", "big");
|
||||
args.put("--ignore-signing-information", null);
|
||||
args.put("--launcher", "name=module/mainclass");
|
||||
|
@ -49,7 +50,7 @@ public class TestJlinkOperation {
|
|||
var options = new JlinkOptions()
|
||||
.addModules(args.get("--add-modules").split(","))
|
||||
.bindServices(true)
|
||||
.compress(ZipCompression.ZIP_6)
|
||||
.compress(CompressionLevel.ZIP)
|
||||
.endian(JlinkOptions.Endian.BIG)
|
||||
.ignoreSigningInformation(true)
|
||||
.launcher("name", "module", "mainclass")
|
||||
|
@ -80,7 +81,7 @@ public class TestJlinkOperation {
|
|||
var jlink = new JlinkOperation()
|
||||
.disablePlugin("vm")
|
||||
.disablePlugin("system-modules")
|
||||
.listPlugins();
|
||||
.toolArgs("--list-plugins");
|
||||
assertDoesNotThrow(jlink::execute);
|
||||
var out = outputStreamCaptor.toString();
|
||||
assertTrue(out.contains("List of available plugins:"), out);
|
||||
|
@ -96,6 +97,7 @@ public class TestJlinkOperation {
|
|||
.modulePath("src/test/resources/jlink/build/jmod")
|
||||
.addModules("dev.mccue.tree")
|
||||
.launcher("tree", "dev.mccue.tree", "dev.mccue.tree.Tree")
|
||||
.compress(CompressionLevel.NO_COMPRESSION)
|
||||
.output(output.getAbsolutePath());
|
||||
var jlink = new JlinkOperation().jlinkOptions(options);
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ public class TestJmodOperation {
|
|||
var options = new JmodOptions()
|
||||
.classpath(args.get("--class-path"))
|
||||
.cmds(args.get("--cmds"))
|
||||
.compress(ZipCompression.ZIP_5)
|
||||
.config(args.get("--config"))
|
||||
.date(ZonedDateTime.of(1997, 8, 29, 2, 14, 0, 0, ZoneId.of("America/Los_Angeles")))
|
||||
.dir(args.get("--dir"))
|
||||
|
|
|
@ -166,14 +166,17 @@ public class TestJpackageOperation {
|
|||
void testCreatePackage() throws Exception {
|
||||
var tmpdir = Files.createTempDirectory("bld-jpackage-test").toFile();
|
||||
try {
|
||||
var jlinkOptions = new JlinkOptions()
|
||||
.compress(JlinkOptions.CompressionLevel.ZIP)
|
||||
.stripNativeCommands(true);
|
||||
var options = new JpackageOptions()
|
||||
.input("lib/bld")
|
||||
.name("bld")
|
||||
.mainJar("bld-wrapper.jar")
|
||||
.javaOptions("--enable-preview")
|
||||
.dest(tmpdir.getAbsolutePath())
|
||||
.verbose(true);
|
||||
|
||||
.verbose(true)
|
||||
.jlinkOptions(jlinkOptions);
|
||||
var os = System.getProperty("os.version");
|
||||
if (os.endsWith("MANJARO")) {
|
||||
options.type(PackageType.DEB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue