Package io.quarkus.builder
Class BuildChainBuilder
- java.lang.Object
-
- io.quarkus.builder.BuildChainBuilder
-
public final class BuildChainBuilder extends Object
A build chain builder.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static booleanLOG_CONFLICT_CAUSING
-
Constructor Summary
Constructors Constructor Description BuildChainBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildStepBuilderaddBuildStep()Add a build step to the chain.BuildStepBuilderaddBuildStep(BuildStep buildStep)Add a build step to the chain.BuildChainBuilderaddFinal(Class<? extends BuildItem> type)Declare a final item that will be consumable after the build step chain completes.BuildChainBuilderaddInitial(Class<? extends BuildItem> type)Declare an initial item that will be provided to build steps in the chain.(package private) voidaddProvider(BuildProvider provider)(package private) voidaddStep(BuildStepBuilder stepBuilder, StackTraceElement[] stackTrace)BuildChainbuild()Build the build step chain from the current builder configuration.(package private) ClassLoadergetClassLoader()(package private) Set<ItemId>getFinalIds()(package private) BuildStepBuildergetFinalStep()(package private) Set<ItemId>getInitialIds()(package private) List<BuildProvider>getProviders()(package private) Map<BuildStepBuilder,StackTraceElement[]>getSteps()BuildChainBuilderloadProviders(ClassLoader classLoader)voidsetClassLoader(ClassLoader classLoader)Sets the ClassLoader for the build.
-
-
-
Method Detail
-
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
- 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
- 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 benull)- Returns:
- this builder
- Throws:
IllegalArgumentException- if the item type isnull
-
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 benull)- Returns:
- this builder
- Throws:
IllegalArgumentException- if the item type isnull
-
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)
-
getFinalStep
BuildStepBuilder getFinalStep()
-
getProviders
List<BuildProvider> getProviders()
-
getSteps
Map<BuildStepBuilder,StackTraceElement[]> getSteps()
-
-