refactor: Use parser-backed annotation discovery across JuLC#36
Merged
Conversation
Introduce JavaSourceIntrospector for AST-based validator, library, and test annotation discovery instead of raw substring/regex classification. Wire Gradle, CLI, testkit, blueprint, playground, and compiler paths through parser-backed source metadata, including role-conflict detection and explicit parse failure handling. Remove deprecated @validator and @MintingPolicy annotations, migrate fixtures/docs/examples to the current validator annotations, and expand tests for discovery, bundling, scanning, and generated resource wiring.
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
This PR replaces raw substring/regex-based source annotation detection with parser-backed Java AST inspection.
Key changes:
JavaSourceIntrospectoras the shared parser-based source classification utility.@OnchainLibrary.@Validatorand@MintingPolicyannotations and migrates tests/docs/examples to current annotations.sourceSets.main.resources.Why
The previous discovery logic used checks like
source.contains("@OnchainLibrary")or regex matching. That caused false positives when annotation names appeared in comments or Javadocs, including cases where normal validator files were misclassified as nested on-chain libraries.Parser-backed discovery keeps source classification aligned with the compiler’s actual view of Java annotations and avoids silent drift across Gradle, CLI, testkit, and playground paths.