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

io.quarkus.cli.BuildToolContext Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.cli;

import java.nio.file.Path;
import java.util.List;

import io.quarkus.cli.common.BuildOptions;
import io.quarkus.cli.common.PropertiesOptions;
import io.quarkus.cli.common.RunModeOption;
import io.quarkus.devtools.project.BuildTool;
import io.quarkus.devtools.project.QuarkusProjectHelper;

/**
 * Context class that holds all the required info that is passed to {@link BuildToolDelegatingCommand}.
 * In many cases a subcommand delegates to the parent. It's cleaner to keep all the state in a single
 * class to pass along.
 */
public class BuildToolContext {

    private final Path projectRoot;
    private final RunModeOption runModeOption;
    private final BuildOptions buildOptions;
    private final PropertiesOptions propertiesOptions;
    private final List forcedExtensions;
    private final List params;

    public BuildToolContext(Path projectRoot, RunModeOption runModeOption, BuildOptions buildOptions,
            PropertiesOptions propertiesOptions, List forcedExtensions, List params) {
        this.projectRoot = projectRoot;
        this.runModeOption = runModeOption;
        this.buildOptions = buildOptions;
        this.propertiesOptions = propertiesOptions;
        this.forcedExtensions = forcedExtensions;
        this.params = params;
    }

    public Path getProjectRoot() {
        return projectRoot;
    }

    public RunModeOption getRunModeOption() {
        return runModeOption;
    }

    public BuildOptions getBuildOptions() {
        return buildOptions;
    }

    public PropertiesOptions getPropertiesOptions() {
        return propertiesOptions;
    }

    public List getForcedExtensions() {
        return forcedExtensions;
    }

    public List getParams() {
        return params;
    }

    public BuildTool getBuildTool() {
        return QuarkusProjectHelper.detectExistingBuildTool(projectRoot); // nullable
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy