Class BaseCreateCommand

java.lang.Object
io.quarkus.cli.create.BaseCreateCommand
All Implemented Interfaces:
Callable<Integer>
Direct Known Subclasses:
CreateApp, CreateCli, CreateExtension

public class BaseCreateCommand extends Object implements Callable<Integer>
  • Field Details

  • Constructor Details

    • BaseCreateCommand

      public BaseCreateCommand()
  • Method Details

    • setTestOutputDirectory

      public void setTestOutputDirectory(Path testOutputDirectory)
      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

      public Path outputDirectory()
      Resolve (and create, if necessary) the target output directory.
      Returns:
      the output directory path
    • setSingleProjectGAV

      public void setSingleProjectGAV(TargetGAVGroup targetGav)
      Parameters:
      targetGav - Group, Artifact, and Version for the single-module project. The artifactId is used as the directory name.
    • setExtensionId

      public void setExtensionId(String extensionId)
      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

      public Path 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, SourceType sourceType)
      Add explicitly specified and sourceType-implied extensions
      Parameters:
      extensions - Explicitly specified extensions
      sourceType - Type of source (Kotlin, Java, Scala)
    • setJavaVersion

      public void setJavaVersion(SourceType sourceType, String javaVersion)
      Set Java source level
    • setCodegenOptions

      public void setCodegenOptions(CodeGenerationGroup codeGeneration)
      Process code generation options (save values)
      Parameters:
      codeGeneration -
    • setValue

      protected void setValue(String name, Object value)
    • build

      public QuarkusCommandInvocation build(BuildTool buildTool, TargetQuarkusPlatformGroup targetVersion, Map<String,String> properties, Collection<String> extensions) throws io.quarkus.registry.RegistryResolutionException
      Create a new single-module project.
      Parameters:
      buildTool - The build tool the project should use (maven, gradle, jbang)
      targetVersion - The target quarkus version
      properties - Additional properties that should be used while creating the properties
      extensions - 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

      public Integer call() throws Exception
      Specified by:
      call in interface Callable<Integer>
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • dryRun

      public void dryRun(BuildTool buildTool, QuarkusCommandInvocation invocation, OutputOptionMixin output)
    • prettyName

      public String prettyName(String key)