Package io.quarkus.deployment
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.quarkus.bootstrap.model.ApplicationModel
applicationModel()
Application modelorg.eclipse.microprofile.config.Config
config()
Application build time configurationPath
inputDir()
Directory containing input content for a code generator.Path
outDir()
Target directory for the generated output.boolean
shouldRedirectIO()
Whether any new processes spawned by a givenCodeGenProvider
should inherit the launching process' output streams or redirect its output and error streams usingProcessBuilder.Redirect.PIPE
.boolean
test()
Indicates whether the code generation is being triggered for testsPath
workDir()
Working directory, typically the main build directory of the project.
-
-
-
Constructor Detail
-
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 modeloutDir
- target directory for the generated outputworkDir
- working directory, typically the main build directory of the projectinputDir
- directory containing input content for a code generatorredirectIO
- whether the code generating process should redirect its IOconfig
- application build time configurationtest
- indicates whether the code generation is being triggered for tests
-
-
Method Detail
-
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 {@codewould 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}. - Returns:
- 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 thetarget
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 ofCodeGenProvider.providerId()
.- Returns:
- directory containing input content a code generator
-
shouldRedirectIO
public boolean shouldRedirectIO()
Whether any new processes spawned by a givenCodeGenProvider
should inherit the launching process' output streams or redirect its output and error streams usingProcessBuilder.Redirect.PIPE
. In the current implementation this is typically set totrue
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
-
-