Class CodeGenContext

java.lang.Object
io.quarkus.deployment.CodeGenContext

public class CodeGenContext extends Object
Code generation context
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodeGenContext(io.quarkus.bootstrap.model.ApplicationModel model, Path outDir, Path workDir, Path inputDir, boolean redirectIO, org.eclipse.microprofile.config.Config config, boolean test)
    Creates a code generation context
  • Method Summary

    Modifier and Type
    Method
    Description
    io.quarkus.bootstrap.model.ApplicationModel
    Application model
    org.eclipse.microprofile.config.Config
    Application build time configuration
    Directory containing input content for a code generator.
    Target directory for the generated output.
    boolean
    Whether any new processes spawned by a given CodeGenProvider should inherit the launching process' output streams or redirect its output and error streams using ProcessBuilder.Redirect.PIPE.
    boolean
    Indicates whether the code generation is being triggered for tests
    Working directory, typically the main build directory of the project.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CodeGenContext

      public CodeGenContext(io.quarkus.bootstrap.model.ApplicationModel model, Path outDir, Path workDir, Path inputDir, boolean redirectIO, org.eclipse.microprofile.config.Config config, boolean test)
      Creates a code generation context
      Parameters:
      model - application model
      outDir - target directory for the generated output
      workDir - working directory, typically the main build directory of the project
      inputDir - directory containing input content for a code generator
      redirectIO - whether the code generating process should redirect its IO
      config - application build time configuration
      test - indicates whether the code generation is being triggered for tests
  • Method Details

    • applicationModel

      public io.quarkus.bootstrap.model.ApplicationModel applicationModel()
      Application model
      Returns:
      application model
    • outDir

      public Path outDir()
      Target directory for the generated output. The directory would typically be resolved as <project.build.directory>/generated-sources/<codegen-provider-id>, where {@code <codegen-provider-id> would match the value of {@link CodeGenProvider#providerId()}. For example, for a code gen provider {@code foo}, the output directory in a typical Maven project would be {@code target/generated-sources/foo}. @return target directory for the generated output
    • workDir

      public Path workDir()
      Working directory, typically the main build directory of the project. For a typical Maven project it would be the target directory.
      Returns:
      working directory, typically the main build directory of the project
    • inputDir

      public Path inputDir()
      Directory containing input content for a code generator. For the main application build of a typical Maven project the input sources directory would be <project.basedir>/src/main/<codegen-provider-id>, while for the tests it would be <project.basedir>/src/test/<codegen-provider-id>, where <codegen-provider-id would match the value of CodeGenProvider.providerId().
      Returns:
      directory containing input content a code generator
    • shouldRedirectIO

      public boolean shouldRedirectIO()
      Whether any new processes spawned by a given CodeGenProvider should inherit the launching process' output streams or redirect its output and error streams using ProcessBuilder.Redirect.PIPE. In the current implementation this is typically set to true by the framework.
      Returns:
      whether the code generation process should redirect its error and output streams
    • config

      public org.eclipse.microprofile.config.Config config()
      Application build time configuration
      Returns:
      application build time configuration
    • test

      public boolean test()
      Indicates whether the code generation is being triggered for tests
      Returns:
      indicates whether the code generation is being triggered for tests