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

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

The newest version!
package dev.jbang.cli;

import java.util.ArrayList;
import java.util.List;

import dev.jbang.net.JdkManager;

import picocli.CommandLine;

public class JdkProvidersMixin {

	@CommandLine.Option(names = {
			"--jdk-providers" }, description = "Use the given providers to check for installed JDKs", split = ",", hidden = true)
	List jdkProviders;

	protected void initJdkProviders() {
		if (jdkProviders != null && !jdkProviders.isEmpty()) {
			JdkManager.initProvidersByName(jdkProviders);
		}
	}

	public List opts() {
		List opts = new ArrayList<>();
		if (jdkProviders != null) {
			for (String p : jdkProviders) {
				opts.add("--jdk-providers");
				opts.add(p);
			}
		}
		return opts;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy