dev.jbang.cli.NativeMixin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbang-cli Show documentation
Show all versions of jbang-cli Show documentation
JBang Command Line Interface
package dev.jbang.cli;
import java.util.ArrayList;
import java.util.List;
import picocli.CommandLine;
public class NativeMixin {
@CommandLine.Option(names = {
"-n", "--native" }, description = "Build using native-image")
Boolean nativeImage;
@CommandLine.Option(names = { "-N", "--native-option" }, description = "Options to pass to the native image tool")
public List nativeOptions;
public List opts() {
List opts = new ArrayList<>();
if (Boolean.TRUE.equals(nativeImage)) {
opts.add("--native");
}
if (nativeOptions != null) {
for (String n : nativeOptions) {
opts.add("-N");
opts.add(n);
}
}
return opts;
}
}