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 TypeMethodDescriptionAdditional arguments to pass toprotoc.Collection<? extends MavenProtocPlugin> Binaryprotocplugins that should be resolved from Maven repositories.Collection<? extends PathProtocPlugin> Binaryprotocplugins that should be resolved from the system$PATH.Collection<? extends UriProtocPlugin> Binaryprotocplugins 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*.protofiles.The collection of supported langagues to enable inprotoc.Additional environment variables to set when callingprotoc.The collection of*.protopath patterns to exclude from being passed toprotoc.Collection<? extends MavenArtifact> Additional user-defined Maven dependencies to include in theprotocimport path.Additional user-defined paths relative to the project root to include in theprotocimport path.The collection of*.protopath patterns to include to be passed toprotoc.Collection<? extends MavenProtocPlugin> Java executable projects that satisfy theprotocplugin interface to wrap in bootstrapping scripts and pass toprotoc.@Nullable StringThe Maven artifact classifier to use when attaching theprotobindescriptor file to the Maven project.The registrar strategy to use to notify Maven of attached artifacts.@Nullable StringThe Maven artifact type to use when attaching theprotobindescriptor file to the Maven project.@Nullable PathThe outputprotobindescriptor file to create, ornullif no descriptor file should be created.The path to write all output files to.@Nullable DigestThe digest of theprotocbinary to verify, ornullif no verification should take place.The version ofprotocto use.@Nullable PathSanctioned path to place executables in.Collection<? extends MavenArtifact> Additional user-defined Maven dependencies to include in theprotocimport path, and to compile.Collection<? extends MavenArtifact> Additional user-defined Maven dependencies pointing at protobuf descriptor files to compile.Paths relative to the project root that are protobuf descriptor files to compile from.Paths relative to the project root that contain*.protosources to compile.The registrar strategy to use to notify Maven of generated sources.booleanWhether to delete all output directories at the start of the build.booleanWhether to include inputprotosources in the output class directory.booleanWhether to treat non-existent source roots as a build error.booleanWhether to treat builds with no enabled languages, plugins, or descriptor file outputs as a build error.booleanWhether to treatprotocbuild warnings as errors.booleanWhether to skip discovering*.protofiles to import from the Maven project<dependencies/>block.booleanWhether to enable incrementally compiling sources.booleanWhether to request the generation of "lite" sources.booleanWhether to attach outputprotobindescriptor file to Maven project.booleanWhether to include imports in the outputprotobindescriptor.booleanWhether to include source information in the outputprotobindescriptor.booleanWhether to retain build option metadata in the outputprotobindescriptor.booleanWhether to mark generated sources as candidates for compilation with themaven-compiler-pluginand similar plugins.
-
Method Details
-
getArguments
-
getBinaryMavenPlugins
Collection<? extends MavenProtocPlugin> getBinaryMavenPlugins()Binaryprotocplugins that should be resolved from Maven repositories.- Returns:
- the collection of plugins.
-
getBinaryPathPlugins
Collection<? extends PathProtocPlugin> getBinaryPathPlugins()Binaryprotocplugins that should be resolved from the system$PATH.- Returns:
- the collection of plugins.
-
getBinaryUrlPlugins
Collection<? extends UriProtocPlugin> getBinaryUrlPlugins()Binaryprotocplugins 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
-
getEnvironmentVariables
-
getImportDependencies
Collection<? extends MavenArtifact> getImportDependencies()Additional user-defined Maven dependencies to include in theprotocimport path.- Returns:
- the collection of dependencies.
-
getImportPaths
Collection<Path> getImportPaths()Additional user-defined paths relative to the project root to include in theprotocimport path.- Returns:
- the collection of paths.
-
getIncludes
-
getJvmMavenPlugins
Collection<? extends MavenProtocPlugin> getJvmMavenPlugins()Java executable projects that satisfy theprotocplugin interface to wrap in bootstrapping scripts and pass toprotoc.- Returns:
- the collection of plugins.
-
getOutputDirectory
-
getOutputDescriptorFile
@Nullable Path getOutputDescriptorFile()The outputprotobindescriptor file to create, ornullif no descriptor file should be created.- Returns:
- the path to the descriptor file to output, or
null.
-
isOutputDescriptorAttached
boolean isOutputDescriptorAttached()Whether to attach outputprotobindescriptor file to Maven project.- Returns:
- flag indicating if descriptor file should be attached.
-
getOutputDescriptorAttachmentType
@Nullable String getOutputDescriptorAttachmentType()The Maven artifact type to use when attaching theprotobindescriptor file to the Maven project.- Returns:
- the artifact type, or
null.
-
getOutputDescriptorAttachmentClassifier
@Nullable String getOutputDescriptorAttachmentClassifier()The Maven artifact classifier to use when attaching theprotobindescriptor file to the Maven project.- Returns:
- the artifact classifier, or
null.
-
getProtocDigest
@Nullable Digest getProtocDigest()The digest of theprotocbinary to verify, ornullif no verification should take place.This does not affect any verification performed by Aether.
- Returns:
- the digest.
- Since:
- 3.5.0
-
getProtocVersion
String getProtocVersion()The version ofprotocto 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 theprotocbinary on the system$PATH; - A URL to a binary to execute.
- Returns:
- the version indicator.
- A Maven version string (such as
-
getSanctionedExecutablePath
@Nullable Path getSanctionedExecutablePath()Sanctioned path to place executables in.Used for corporate environments with overly locked-down policies on where native executables can be placed.
- Returns:
- the sanctioned path, or
nullif no movement of resources is desired.
-
getSourceDependencies
Collection<? extends MavenArtifact> getSourceDependencies()Additional user-defined Maven dependencies to include in theprotocimport path, and to compile.- Returns:
- the collection of dependencies.
-
getSourceDescriptorDependencies
Collection<? extends MavenArtifact> getSourceDescriptorDependencies()Additional user-defined Maven dependencies pointing at protobuf descriptor files to compile.- Returns:
- the collection of dependencies pointing to protobuf descriptor files.
- Since:
- 3.1.0
-
getSourceDescriptorPaths
Collection<Path> getSourceDescriptorPaths()Paths relative to the project root that are protobuf descriptor files to compile from.- Returns:
- the source descriptor file paths.
-
getSourceDirectories
Collection<Path> getSourceDirectories()Paths relative to the project root that contain*.protosources to compile.- Returns:
- the source directory paths.
-
getSourceRootRegistrar
SourceRootRegistrar getSourceRootRegistrar()The registrar strategy to use to notify Maven of generated sources.- Returns:
- the registrar strategy.
-
getOutputDescriptorAttachmentRegistrar
OutputDescriptorAttachmentRegistrar getOutputDescriptorAttachmentRegistrar()The registrar strategy to use to notify Maven of attached artifacts.- Returns:
- the registrar strategy.
-
isCleanOutputDirectories
boolean isCleanOutputDirectories()Whether to delete all output directories at the start of the build.Ignored if using incremental compilation.
- Returns:
- the boolean preference.
-
isEmbedSourcesInClassOutputs
boolean isEmbedSourcesInClassOutputs()Whether to include inputprotosources in the output class directory.- 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 treatprotocbuild warnings as errors.- Returns:
- the boolean preference.
-
isIgnoreProjectDependencies
boolean isIgnoreProjectDependencies()Whether to skip discovering*.protofiles 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 outputprotobindescriptor.- Returns:
- the boolean preference.
-
isOutputDescriptorIncludeSourceInfo
boolean isOutputDescriptorIncludeSourceInfo()Whether to include source information in the outputprotobindescriptor.- Returns:
- the boolean preference.
-
isOutputDescriptorRetainOptions
boolean isOutputDescriptorRetainOptions()Whether to retain build option metadata in the outputprotobindescriptor.- Returns:
- the boolean preference.
-
isRegisterAsCompilationRoot
boolean isRegisterAsCompilationRoot()Whether to mark generated sources as candidates for compilation with themaven-compiler-pluginand similar plugins.- Returns:
- the boolean preference.
-