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

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

The newest version!
package dev.jbang.cli;

import java.io.IOException;

import dev.jbang.source.BuildContext;
import dev.jbang.source.Project;
import dev.jbang.source.ProjectBuilder;

import picocli.CommandLine.Command;

@Command(name = "build", description = "Compiles and stores script in the cache.")
public class Build extends BaseBuildCommand {

	@Override
	public Integer doCall() throws IOException {
		scriptMixin.validate();
		jdkProvidersMixin.initJdkProviders();

		ProjectBuilder pb = createProjectBuilderForBuild();
		Project prj = pb.build(scriptMixin.scriptOrFile);
		Project.codeBuilder(BuildContext.forProject(prj, buildDir)).build();

		return EXIT_OK;
	}

	ProjectBuilder createProjectBuilderForBuild() {
		return createBaseProjectBuilder()
											.mainClass(buildMixin.main);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy