Package io.quarkus.deployment
Class CodeGenContext
java.lang.Object
io.quarkus.deployment.CodeGenContext
Code generation context
-
Constructor Summary
ConstructorsConstructorDescriptionCodeGenContext(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 TypeMethodDescriptionio.quarkus.bootstrap.model.ApplicationModelApplication modelorg.eclipse.microprofile.config.Configconfig()Application build time configurationinputDir()Directory containing input content for a code generator.outDir()Target directory for the generated output.booleanWhether any new processes spawned by a givenCodeGenProvidershould inherit the launching process' output streams or redirect its output and error streams usingProcessBuilder.Redirect.PIPE.booleantest()Indicates whether the code generation is being triggered for testsworkDir()Working directory, typically the main build directory of the project.
-
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 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 Details
-
applicationModel
public io.quarkus.bootstrap.model.ApplicationModel applicationModel()Application model- Returns:
- application model
-
outDir
Target directory for the generated output. The directory would typically be resolved as<project.build.directory>/generated-sources/<codegen-provider-id>, where invalid input: '{@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
Working directory, typically the main build directory of the project. For a typical Maven project it would be thetargetdirectory.- Returns:
- working directory, typically the main build directory of the project
-
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-idwould match the value ofCodeGenProvider.providerId().- Returns:
- directory containing input content a code generator
-
shouldRedirectIO
public boolean shouldRedirectIO()Whether any new processes spawned by a givenCodeGenProvidershould inherit the launching process' output streams or redirect its output and error streams usingProcessBuilder.Redirect.PIPE. In the current implementation this is typically set totrueby 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
-