Package io.quarkus.cli.create
Class BaseCreateCommand
java.lang.Object
io.quarkus.cli.create.BaseCreateCommand
- Direct Known Subclasses:
CreateApp,CreateCli,CreateExtension
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.quarkus.cli.common.HelpOptionprotected io.quarkus.cli.common.OutputOptionMixin(package private) io.quarkus.cli.common.registry.ToggleRegistryClientMixinprotected io.quarkus.cli.common.RunModeOptionprotected picocli.CommandLine.Model.CommandSpec(package private) String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.quarkus.devtools.commands.data.QuarkusCommandInvocationbuild(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.cli.common.TargetQuarkusPlatformGroup targetVersion, Map<String, String> properties, Collection<String> extensions) Create a new single-module project.call()booleancheckProjectRootAlreadyExists(boolean dryRun) Resolve and remember the configured project directory.voiddryRun(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.devtools.commands.data.QuarkusCommandInvocation invocation, io.quarkus.cli.common.OutputOptionMixin output) io.quarkus.devtools.project.QuarkusProjectgetExtensionVersions(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.cli.common.TargetQuarkusPlatformGroup targetVersion) Resolve (and create, if necessary) the target output directory.prettyName(String key) Resolve the target output directory.voidsetCodegenOptions(CodeGenerationGroup codeGeneration) Process code generation options (save values)voidsetExtensionId(String extensionId) voidsetJavaVersion(io.quarkus.devtools.project.SourceType sourceType, String javaVersion) Set Java source levelvoidsetSingleProjectGAV(TargetGAVGroup targetGav) voidsetSourceTypeExtensions(Set<String> extensions, io.quarkus.devtools.project.SourceType sourceType) Add explicitly specified and sourceType-implied extensionsvoidsetTestOutputDirectory(Path testOutputDirectory) If a targetDirectory parameter was not specified, and this was, set this as output path.protected voidtoString()
-
Field Details
-
runMode
protected io.quarkus.cli.common.RunModeOption runMode -
output
protected io.quarkus.cli.common.OutputOptionMixin output -
registryClient
io.quarkus.cli.common.registry.ToggleRegistryClientMixin registryClient -
helpOption
protected io.quarkus.cli.common.HelpOption helpOption -
spec
protected picocli.CommandLine.Model.CommandSpec spec -
targetDirectory
String targetDirectory
-
-
Constructor Details
-
BaseCreateCommand
public BaseCreateCommand()
-
-
Method Details
-
setTestOutputDirectory
If a targetDirectory parameter was not specified, and this was, set this as output path.- Parameters:
testOutputDirectory- The path to use as the output directory if the target directory was not specified, or null
-
outputDirectory
Resolve (and create, if necessary) the target output directory.- Returns:
- the output directory path
-
setSingleProjectGAV
- Parameters:
targetGav- Group, Artifact, and Version for the single-module project. The artifactId is used as the directory name.
-
setExtensionId
- Parameters:
extensionId- Extension id to be used as project directory name
-
checkProjectRootAlreadyExists
public boolean checkProjectRootAlreadyExists(boolean dryRun) Resolve and remember the configured project directory.- Parameters:
dryRun- If true, warn that the directory already exists; otherwise, print an error message.- Returns:
- true IFF configured project root directory already exists and this is not a dry run; in other words, return true if caller should exit with an error.
-
projectRoot
Resolve the target output directory. Will throw if the target directory exists- Returns:
- the project root path
-
setSourceTypeExtensions
public void setSourceTypeExtensions(Set<String> extensions, io.quarkus.devtools.project.SourceType sourceType) Add explicitly specified and sourceType-implied extensions- Parameters:
extensions- Explicitly specified extensionssourceType- Type of source (Kotlin, Java, Scala)
-
setJavaVersion
Set Java source level -
setCodegenOptions
Process code generation options (save values)- Parameters:
codeGeneration-
-
setValue
-
build
public io.quarkus.devtools.commands.data.QuarkusCommandInvocation build(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.cli.common.TargetQuarkusPlatformGroup targetVersion, Map<String, String> properties, Collection<String> extensions) throws io.quarkus.registry.RegistryResolutionExceptionCreate a new single-module project.- Parameters:
buildTool- The build tool the project should use (maven, gradle, jbang)targetVersion- The target quarkus versionproperties- Additional properties that should be used while creating the propertiesextensions- requested extensions- Returns:
- Quarkus command invocation that can be printed (dry-run) or run to create the project
- Throws:
io.quarkus.registry.RegistryResolutionException
-
getExtensionVersions
public io.quarkus.devtools.project.QuarkusProject getExtensionVersions(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.cli.common.TargetQuarkusPlatformGroup targetVersion) throws io.quarkus.registry.RegistryResolutionException - Parameters:
buildTool- The build tool the project should use (maven, gradle, jbang)targetVersion- The target quarkus version- Returns:
- Resolved QuarkusProject for the given build tool and target quarkus version
- Throws:
io.quarkus.registry.RegistryResolutionException
-
call
-
toString
-
dryRun
public void dryRun(io.quarkus.devtools.project.BuildTool buildTool, io.quarkus.devtools.commands.data.QuarkusCommandInvocation invocation, io.quarkus.cli.common.OutputOptionMixin output) -
prettyName
-