Class CodeGenerator

java.lang.Object
io.quarkus.deployment.CodeGenerator

public class CodeGenerator extends Object
A set of methods to initialize and execute CodeGenProviders.
  • 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 classloader
      data - code gen
      appModel - app model
      config - config instance
      test - 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 as previouslyRecordedProperties to a file.
      Parameters:
      appModel - application model
      launchMode - launch mode
      buildSystemProps - build system (or project) properties
      deploymentClassLoader - build classloader
      previouslyRecordedProperties - properties to read from the initialized configuration
      outputFile - 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