Class BuildChainBuilder

java.lang.Object
io.quarkus.builder.BuildChainBuilder

public final class BuildChainBuilder extends Object
A build chain builder.
Author:
David M. Lloyd
  • Field Details

    • LOG_CONFLICT_CAUSING

      static final boolean LOG_CONFLICT_CAUSING
  • Constructor Details

    • BuildChainBuilder

      BuildChainBuilder()
  • Method Details

    • addBuildStep

      public BuildStepBuilder addBuildStep(BuildStep buildStep)
      Add a build step to the chain. The configuration in the build step builder at the time that the chain is built is the configuration that will apply to the build step in the final chain. Any subsequent changes will be ignored.

      A given build step is included in the chain when one or more of the following criteria are met:

      • It includes a pre-produce step for a item which is produced by one or more build steps that is included in the chain
      • It includes a produce step for a item which is consumed by a build step that is included in the chain or is a final item
      • It includes a consume step for a item which is produced by a build step that is included in the chain or is an initial item
      • It includes a destroy step for a item which is produced by a build step that is included in the chain or is an initial item
      In addition, the declaration of producers and consumers can cause corresponding consumers and producers to be included if they exist.
      Parameters:
      buildStep - the build step instance
      Returns:
      the builder for the build step
    • addBuildStep

      public BuildStepBuilder addBuildStep()
      Add a build step to the chain. The configuration in the build step builder at the time that the chain is built is the configuration that will apply to the build step in the final chain. Any subsequent changes will be ignored.

      A given build step is included in the chain when one or more of the following criteria are met:

      • It includes a pre-produce step for a item which is produced by one or more build steps that is included in the chain
      • It includes a produce step for a item which is consumed by a build step that is included in the chain or is a final item
      • It includes a consume step for a item which is produced by a build step that is included in the chain or is an initial item
      • It includes a destroy step for a item which is produced by a build step that is included in the chain or is an initial item
      In addition, the declaration of producers and consumers can cause corresponding consumers and producers to be included if they exist.
      Returns:
      the builder for the build step
    • addInitial

      public BuildChainBuilder addInitial(Class<? extends BuildItem> type)
      Declare an initial item that will be provided to build steps in the chain. Note that if this method is called for a simple item, no build steps will be allowed to produce that item.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the item type is null
    • loadProviders

      public BuildChainBuilder loadProviders(ClassLoader classLoader) throws ChainBuildException
      Throws:
      ChainBuildException
    • addFinal

      public BuildChainBuilder addFinal(Class<? extends BuildItem> type)
      Declare a final item that will be consumable after the build step chain completes. This may be any item that is produced in the chain.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the item type is null
    • getClassLoader

      ClassLoader getClassLoader()
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
      Sets the ClassLoader for the build. Every build step will be run with this as the TCCL.
      Parameters:
      classLoader - The ClassLoader
    • build

      public BuildChain build() throws ChainBuildException
      Build the build step chain from the current builder configuration.
      Returns:
      the constructed build chain
      Throws:
      ChainBuildException - if the chain could not be built
    • addProvider

      void addProvider(BuildProvider provider) throws ChainBuildException
      Throws:
      ChainBuildException
    • addStep

      void addStep(BuildStepBuilder stepBuilder, StackTraceElement[] stackTrace)
    • getProviders

      List<BuildProvider> getProviders()
    • getInitialIds

      Set<ItemId> getInitialIds()
    • getFinalIds

      Set<ItemId> getFinalIds()