Exclude generated sources in build directory from parsing#433
Merged
Exclude generated sources in build directory from parsing#433
Conversation
Fixes #216. Source directories located inside the build directory (e.g. protobuf-generated Kotlin sources) were being included in recipe results. Filter them out at the directory level before file walking. Type information from generated sources remains available via compiled class files on the classpath. Removes the now-unnecessary hardcoded /protos/build/generated exclusion.
Collaborator
|
Just curious, but should isExcluded be extracted from each individual parse chain and moved toward the end of all parsing to eject any file that happens to be explicitly excluded? |
Move the isExcluded and buildDir checks out of parseJavaFiles(), parseKotlinFiles(), and the inline Groovy/multiplatform blocks into a single filter applied when assembling the source file stream. This removes duplicated exclusion logic and simplifies the parse method signatures in both DefaultProjectParser and AndroidProjectParser.
Member
Author
|
Good suggestion! Extracted the |
shanman190
approved these changes
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/protos/build/generatedexclusion, now covered by the generic build directory filterisExcluded/buildDirfiltering from individual parse methods (parseJavaFiles,parseKotlinFiles, inline Groovy/multiplatform blocks) into a single filter at the stream assembly point, in bothDefaultProjectParserandAndroidProjectParserTest plan
./gradlew :plugin:test)