Package io.quarkus.deployment
Class CodeGenerator
java.lang.Object
io.quarkus.deployment.CodeGenerator
A set of methods to initialize and execute
CodeGenProvider
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dumpCurrentConfigValues
(io.quarkus.bootstrap.model.ApplicationModel appModel, String launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader, Properties previouslyRecordedProperties, Path outputFile) Initializes an application build time configuration and dumps current values of properties passed in aspreviouslyRecordedProperties
to a file.static org.eclipse.microprofile.config.Config
getConfig
(io.quarkus.bootstrap.model.ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader) static List<CodeGenData>
init
(io.quarkus.bootstrap.model.ApplicationModel model, Map<String, String> properties, ClassLoader deploymentClassLoader, Collection<DevModeContext.ModuleInfo> modules) static void
initAndRun
(QuarkusClassLoader classLoader, io.quarkus.paths.PathCollection sourceParentDirs, Path generatedSourcesDir, Path buildDir, Consumer<Path> sourceRegistrar, io.quarkus.bootstrap.model.ApplicationModel appModel, Properties properties, String launchMode, boolean test) static <T> T
readConfig
(io.quarkus.bootstrap.model.ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader, Function<BuildTimeConfigurationReader, T> function) static boolean
trigger
(ClassLoader deploymentClassLoader, CodeGenData data, io.quarkus.bootstrap.model.ApplicationModel appModel, org.eclipse.microprofile.config.Config config, boolean test) generate sources for given code gen
-
Constructor Details
-
CodeGenerator
public CodeGenerator()
-
-
Method Details
-
initAndRun
public static void initAndRun(QuarkusClassLoader classLoader, io.quarkus.paths.PathCollection sourceParentDirs, Path generatedSourcesDir, Path buildDir, Consumer<Path> sourceRegistrar, io.quarkus.bootstrap.model.ApplicationModel appModel, Properties properties, String launchMode, boolean test) throws CodeGenException - Throws:
CodeGenException
-
init
public static List<CodeGenData> init(io.quarkus.bootstrap.model.ApplicationModel model, Map<String, String> properties, ClassLoader deploymentClassLoader, Collection<DevModeContext.ModuleInfo> modules) throws CodeGenException- Throws:
CodeGenException
-
trigger
public static boolean trigger(ClassLoader deploymentClassLoader, CodeGenData data, io.quarkus.bootstrap.model.ApplicationModel appModel, org.eclipse.microprofile.config.Config config, boolean test) throws CodeGenException generate sources for given code gen- Parameters:
deploymentClassLoader
- deployment classloaderdata
- code genappModel
- app modelconfig
- config instancetest
- whether the sources are generated for production code or tests- Returns:
- true if sources have been created
- Throws:
CodeGenException
- on failure
-
dumpCurrentConfigValues
public static void dumpCurrentConfigValues(io.quarkus.bootstrap.model.ApplicationModel appModel, String launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader, Properties previouslyRecordedProperties, Path outputFile) Initializes an application build time configuration and dumps current values of properties passed in aspreviouslyRecordedProperties
to a file.- Parameters:
appModel
- application modellaunchMode
- launch modebuildSystemProps
- build system (or project) propertiesdeploymentClassLoader
- build classloaderpreviouslyRecordedProperties
- properties to read from the initialized configurationoutputFile
- output file
-
getConfig
public static org.eclipse.microprofile.config.Config getConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader) throws CodeGenException - Throws:
CodeGenException
-
readConfig
public static <T> T readConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader, Function<BuildTimeConfigurationReader, T> function) throws CodeGenException- Throws:
CodeGenException
-