Interface GenerationRequest
- All Known Implementing Classes:
ImmutableGenerationRequest
@Immutable
public interface GenerationRequest
Base for a generation request with all the details of what to do during generation.
- Author:
- Ashley Scopes
-
Method Summary
Modifier and TypeMethodDescriptionCollection
<? extends MavenProtocPlugin> Binaryprotoc
plugins that should be resolved from Maven repositories.Collection
<? extends PathProtocPlugin> Binaryprotoc
plugins that should be resolved from the system$PATH
.Collection
<? extends UrlProtocPlugin> Binaryprotoc
plugins that should be resolved from URLs.The preference for how to resolve transitive dependencies by default.The dependency scopes to allow when searching the Maven project dependency list for*.proto
files.The collection of supported langagues to enable inprotoc
.The collection of*.proto
path patterns to exclude from being passed toprotoc
.Collection
<? extends MavenDependency> Additional user-defined Maven dependencies to include in theprotoc
import path.Additional user-defined paths relative to the project root to include in theprotoc
import path.The collection of*.proto
path patterns to include to be passed toprotoc
.Collection
<? extends MavenProtocPlugin> Java executable projects that satisfy theprotoc
plugin interface to wrap in bootstrapping scripts and pass toprotoc
.@Nullable Path
The outputprotobin
descriptor file to create, ornull
if no descriptor file should be created.The path to write all output files to.The version ofprotoc
to use.Collection
<? extends MavenDependency> Additional user-defined Maven dependencies to include in theprotoc
import path, and to compile.The registrar strategy to use to notify Maven of generated sources.Paths relative to the project root that contain*.proto
sources to compile.boolean
Whether to include inputproto
sources in the output class directory.boolean
Whether to treat invalid dependencies as a build error.boolean
Whether to treat non-existent source roots as a build error.boolean
Whether to treat builds with no enabled languages, plugins, or descriptor file outputs as a build error.boolean
Whether to treatprotoc
build warnings as errors.boolean
Whether to skip discovering*.proto
files to import from the Maven project<dependencies/>
block.boolean
Whether to enable incrementally compiling sources.boolean
Whether to request the generation of "lite" sources.boolean
Whether to include imports in the outputprotobin
descriptor.boolean
Whether to include source information in the outputprotobin
descriptor.boolean
Whether to retain build option metadata in the outputprotobin
descriptor.boolean
Whether to mark generated sources as candidates for compilation with themaven-compiler-plugin
and similar plugins.
-
Method Details
-
getBinaryMavenPlugins
Collection<? extends MavenProtocPlugin> getBinaryMavenPlugins()Binaryprotoc
plugins that should be resolved from Maven repositories.- Returns:
- the collection of plugins.
-
getBinaryPathPlugins
Collection<? extends PathProtocPlugin> getBinaryPathPlugins()Binaryprotoc
plugins that should be resolved from the system$PATH
.- Returns:
- the collection of plugins.
-
getBinaryUrlPlugins
Collection<? extends UrlProtocPlugin> getBinaryUrlPlugins()Binaryprotoc
plugins that should be resolved from URLs.- Returns:
- the collection of plugins.
-
getDependencyResolutionDepth
DependencyResolutionDepth getDependencyResolutionDepth()The preference for how to resolve transitive dependencies by default.- Returns:
- the dependency resolution depth preference.
-
getDependencyScopes
-
getEnabledLanguages
Collection<Language> getEnabledLanguages()The collection of supported langagues to enable inprotoc
.- Returns:
- the languages.
-
getExcludes
-
getImportDependencies
Collection<? extends MavenDependency> getImportDependencies()Additional user-defined Maven dependencies to include in theprotoc
import path.- Returns:
- the collection of dependencies.
-
getImportPaths
Collection<Path> getImportPaths()Additional user-defined paths relative to the project root to include in theprotoc
import path.- Returns:
- the collection of paths.
-
getIncludes
-
getJvmMavenPlugins
Collection<? extends MavenProtocPlugin> getJvmMavenPlugins()Java executable projects that satisfy theprotoc
plugin interface to wrap in bootstrapping scripts and pass toprotoc
.- Returns:
- the collection of plugins.
-
getOutputDirectory
-
getOutputDescriptorFile
@Nullable Path getOutputDescriptorFile()The outputprotobin
descriptor file to create, ornull
if no descriptor file should be created.- Returns:
- the path to the descriptor file to output, or
null
.
-
getProtocVersion
String getProtocVersion()The version ofprotoc
to use.This will be one of:
- A Maven version string (such as
4.29.3
), to indicate to pull from the Maven repositories; - The literal string
PATH
, to indicate to invoke theprotoc
binary on the system$PATH
; - A URL to a binary to execute.
- Returns:
- the version indicator.
- A Maven version string (such as
-
getSourceDependencies
Collection<? extends MavenDependency> getSourceDependencies()Additional user-defined Maven dependencies to include in theprotoc
import path, and to compile.- Returns:
- the collection of dependencies.
-
getSourceRoots
Collection<Path> getSourceRoots()Paths relative to the project root that contain*.proto
sources to compile.- Returns:
- the source roots.
-
getSourceRootRegistrar
SourceRootRegistrar getSourceRootRegistrar()The registrar strategy to use to notify Maven of generated sources.- Returns:
- the registrar strategy.
-
isEmbedSourcesInClassOutputs
boolean isEmbedSourcesInClassOutputs()Whether to include inputproto
sources in the output class directory.- Returns:
- the boolean preference.
-
isFailOnInvalidDependencies
boolean isFailOnInvalidDependencies()Whether to treat invalid dependencies as a build error.- Returns:
- the boolean preference.
-
isFailOnMissingSources
boolean isFailOnMissingSources()Whether to treat non-existent source roots as a build error.- Returns:
- the boolean preference.
-
isFailOnMissingTargets
boolean isFailOnMissingTargets()Whether to treat builds with no enabled languages, plugins, or descriptor file outputs as a build error.- Returns:
- the boolean preference.
-
isFatalWarnings
boolean isFatalWarnings()Whether to treatprotoc
build warnings as errors.- Returns:
- the boolean preference.
-
isIgnoreProjectDependencies
boolean isIgnoreProjectDependencies()Whether to skip discovering*.proto
files to import from the Maven project<dependencies/>
block.- Returns:
- the boolean preference.
-
isIncrementalCompilationEnabled
boolean isIncrementalCompilationEnabled()Whether to enable incrementally compiling sources.- Returns:
- the boolean preference.
-
isLiteEnabled
boolean isLiteEnabled()Whether to request the generation of "lite" sources.- Returns:
- the boolean preference.
-
isOutputDescriptorIncludeImports
boolean isOutputDescriptorIncludeImports()Whether to include imports in the outputprotobin
descriptor.- Returns:
- the boolean preference.
-
isOutputDescriptorIncludeSourceInfo
boolean isOutputDescriptorIncludeSourceInfo()Whether to include source information in the outputprotobin
descriptor.- Returns:
- the boolean preference.
-
isOutputDescriptorRetainOptions
boolean isOutputDescriptorRetainOptions()Whether to retain build option metadata in the outputprotobin
descriptor.- Returns:
- the boolean preference.
-
isRegisterAsCompilationRoot
boolean isRegisterAsCompilationRoot()Whether to mark generated sources as candidates for compilation with themaven-compiler-plugin
and similar plugins.- Returns:
- the boolean preference.
-