Skip to content

Commit

Permalink
GH-438: Rename attributes within SourceListing to remove attachment t…
Browse files Browse the repository at this point in the history
…o file type
  • Loading branch information
ascopes committed Nov 9, 2024
1 parent b5eef47 commit 9cc3fe6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public boolean generate(GenerationRequest request) throws ResolutionException, I
.fatalWarnings(request.isFatalWarnings())
.importPaths(
importPaths.stream()
.map(SourceListing::getProtoFilesRoot)
.map(SourceListing::getSourceRoot)
.collect(Collectors.toCollection(LinkedHashSet::new))
);

Expand All @@ -136,7 +136,7 @@ public boolean generate(GenerationRequest request) throws ResolutionException, I

var sourceFiles = sourcePaths
.stream()
.map(SourceListing::getProtoFiles)
.map(SourceListing::getSourceProtoFiles)
.flatMap(Collection::stream)
.collect(Collectors.toCollection(LinkedHashSet::new));

Expand Down Expand Up @@ -236,7 +236,7 @@ private Collection<SourceListing> discoverCompilableSources(
var sourcePaths = concat(sourcePathsListings, sourceDependencyListings);

var sourceFileCount = sourcePaths.stream()
.mapToInt(sourcePath -> sourcePath.getProtoFiles().size())
.mapToInt(sourcePath -> sourcePath.getSourceProtoFiles().size())
.sum();

log.info(
Expand Down Expand Up @@ -294,7 +294,7 @@ private void embedSourcesInClassOutputs(
registrar.embedListing(mavenSession, listing);
} catch (IOException ex) {
throw new ResolutionException(
"Failed to embed " + listing.getProtoFilesRoot()
"Failed to embed " + listing.getSourceRoot()
+ " into the class outputs directory",
ex
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public void registerSourceRoot(MavenSession session, Path path) {
}

public void embedListing(MavenSession session, SourceListing listing) throws IOException {
log.info("Embedding sources from {} in {} class outputs", listing.getProtoFilesRoot(), this);
log.info("Embedding sources from {} in {} class outputs", listing.getSourceRoot(), this);
var targetDirectory = classOutputDirectoryGetter.andThen(Path::of)
.apply(session.getCurrentProject().getBuild());

FileUtils.rebaseFileTree(
listing.getProtoFilesRoot(),
listing.getSourceRoot(),
targetDirectory,
listing.getProtoFiles().stream()
listing.getSourceProtoFiles().stream()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Immutable
public interface SourceListing {

Path getProtoFilesRoot();
Path getSourceRoot();

Set<Path> getProtoFiles();
Set<Path> getSourceProtoFiles();
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private Optional<SourceListing> createProtoFileListingForArchive(
var targetFiles = FileUtils.rebaseFileTree(
vfsRoot,
extractionRoot,
sourceFiles.get().getProtoFiles().stream()
sourceFiles.get().getSourceProtoFiles().stream()
);

var listing = ImmutableSourceListing
Expand Down

0 comments on commit 9cc3fe6

Please sign in to comment.