Package io.quarkus.deployment
Class CodeGenerator
- java.lang.Object
-
- io.quarkus.deployment.CodeGenerator
-
public class CodeGenerator extends Object
A set of methods to initialize and executeCodeGenProviders.
-
-
Constructor Summary
Constructors Constructor Description CodeGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddumpCurrentConfigValues(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 aspreviouslyRecordedPropertiesto a file.static org.eclipse.microprofile.config.ConfiggetConfig(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 voidinitAndRun(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> TreadConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps, QuarkusClassLoader deploymentClassLoader, Function<BuildTimeConfigurationReader,T> function)static booleantrigger(ClassLoader deploymentClassLoader, CodeGenData data, io.quarkus.bootstrap.model.ApplicationModel appModel, org.eclipse.microprofile.config.Config config, boolean test)generate sources for given code gen
-
-
-
Method Detail
-
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 aspreviouslyRecordedPropertiesto 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
-
-