Class ProtocCompileCsharpMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.xolstice.maven.plugin.protobuf.AbstractProtocMojo
org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo
org.xolstice.maven.plugin.protobuf.ProtocCompileCsharpMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="compile-csharp",
defaultPhase=GENERATE_SOURCES,
requiresDependencyResolution=COMPILE,
threadSafe=true)
public final class ProtocCompileCsharpMojo
extends AbstractProtocCompileMojo
This mojo executes the
protoc compiler for generating main C# sources
from protocol buffer definitions. It also searches dependency artifacts for
.proto files and includes them in the proto_path so that they can be
referenced. Finally, it adds the .proto files to the project as resources so
that they are included in the final artifact.- Since:
- 0.6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileThis is the directory into which the.cswill be created.Fields inherited from class org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo
descriptorSetClassifierFields inherited from class org.xolstice.maven.plugin.protobuf.AbstractProtocMojo
attachDescriptorSet, attachProtoSources, buildContext, descriptorSetFileName, includeDependenciesInDescriptorSet, includeSourceInfoInDescriptorSet, project, projectHelper, session, toolchainManager, useArgumentFile, writeDescriptorSetFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProtocBuilderParameters(Protoc.Builder protocBuilder) Adds mojo-specific parameters to the protoc builder.protected FileReturns the output directory for generated sources.Methods inherited from class org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo
doAttachGeneratedFiles, doAttachProtoSources, getDependencyArtifacts, getDescriptorSetOutputDirectory, getProtoSourceRootMethods inherited from class org.xolstice.maven.plugin.protobuf.AbstractProtocMojo
checkFilesUpToDate, checkParameters, createDependencyArtifact, createDependencyArtifact, createProtocPlugins, detectJavaHome, doAttachFiles, execute, findGeneratedFilesInDirectory, findProtoFilesInDirectories, findProtoFilesInDirectory, getDependencyArtifactFiles, getExcludes, getIncludes, hasDelta, lastModified, makeProtoPathFromJars, resolveBinaryArtifact, skipMojo, toHexString, truncatePathMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputDirectory
@Parameter(required=true, property="csharpOutputDirectory", defaultValue="${project.build.directory}/generated-sources/protobuf/csharp") private File outputDirectoryThis is the directory into which the.cswill be created.
-
-
Constructor Details
-
ProtocCompileCsharpMojo
public ProtocCompileCsharpMojo()
-
-
Method Details
-
addProtocBuilderParameters
Description copied from class:AbstractProtocMojoAdds mojo-specific parameters to the protoc builder.- Overrides:
addProtocBuilderParametersin classAbstractProtocMojo- Parameters:
protocBuilder- the builder to be modified.
-
getOutputDirectory
Description copied from class:AbstractProtocMojoReturns the output directory for generated sources. Depends on build phase so must be defined in concrete implementation.- Specified by:
getOutputDirectoryin classAbstractProtocMojo- Returns:
- output directory for generated sources.
-