Class ProtoSourceResolver
java.lang.Object
io.github.ascopes.protobufmavenplugin.sources.ProtoSourceResolver
@Description("Discovers proto sources in various packaging formats on the file system")
@Named
final class ProtoSourceResolver
extends Object
Component that can index and resolve protobuf sources in a file tree.
In addition, it can discover sources within archives recursively. These results will be
extracted to a location within the Maven build directory to enable protoc
and other
plugins to be able to view them without needing access to the Java NIO file system APIs.
- Author:
- Ashley Scopes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentExecutor
private static final org.slf4j.Logger
private final TemporarySpace
-
Constructor Summary
ConstructorsConstructorDescriptionProtoSourceResolver
(ConcurrentExecutor concurrentExecutor, TemporarySpace temporarySpace) -
Method Summary
Modifier and TypeMethodDescriptionprivate SourceListing
createSourceListing
(Collection<Path> sourceFiles, Path rootPath) private String
generateUniqueName
(Path path) private Path
private Optional
<SourceListing> resolveSources
(Path rootPath, SourceGlobFilter filter) (package private) Collection
<SourceListing> resolveSources
(Collection<Path> rootPaths, SourceGlobFilter filter) private Optional
<SourceListing> resolveSourcesWithinArchive
(Path rootPath, SourceGlobFilter filter) private Optional
<SourceListing> resolveSourcesWithinDirectory
(Path rootPath, SourceGlobFilter filter) private Optional
<SourceListing> resolveSourcesWithinFile
(Path rootPath, SourceGlobFilter filter)
-
Field Details
-
POM_FILE_EXTENSIONS
-
ZIP_FILE_EXTENSIONS
-
log
private static final org.slf4j.Logger log -
concurrentExecutor
-
temporarySpace
-
-
Constructor Details
-
ProtoSourceResolver
-
-
Method Details
-
resolveSources
-
resolveSources
private Optional<SourceListing> resolveSources(Path rootPath, SourceGlobFilter filter) throws IOException - Throws:
IOException
-
resolveSourcesWithinFile
private Optional<SourceListing> resolveSourcesWithinFile(Path rootPath, SourceGlobFilter filter) throws IOException - Throws:
IOException
-
resolveSourcesWithinArchive
private Optional<SourceListing> resolveSourcesWithinArchive(Path rootPath, SourceGlobFilter filter) throws IOException - Throws:
IOException
-
resolveSourcesWithinDirectory
private Optional<SourceListing> resolveSourcesWithinDirectory(Path rootPath, SourceGlobFilter filter) throws IOException - Throws:
IOException
-
createSourceListing
-
getArchiveExtractionRoot
-
generateUniqueName
-