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 HelpOptionprotected OutputOptionMixin(package private) ToggleRegistryClientMixinprotected RunModeOptionprotected picocli.CommandLine.Model.CommandSpec(package private) String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(BuildTool buildTool, 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(BuildTool buildTool, QuarkusCommandInvocation invocation, OutputOptionMixin output) getExtensionVersions(BuildTool buildTool, 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(SourceType sourceType, String javaVersion) Set Java source levelvoidsetSingleProjectGAV(TargetGAVGroup targetGav) voidsetSourceTypeExtensions(Set<String> extensions, 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
-
output
-
registryClient
ToggleRegistryClientMixin registryClient -
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
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 QuarkusCommandInvocation build(BuildTool buildTool, 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 QuarkusProject getExtensionVersions(BuildTool buildTool, 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(BuildTool buildTool, QuarkusCommandInvocation invocation, OutputOptionMixin output) -
prettyName
-