All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.jbang.cli.NativeMixin Maven / Gradle / Ivy

The newest version!
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy