GROOVY-12025: Provide a JavaShell compileAllTo method#2548
Open
paulk-asert wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new JavaShell.compileAllTo API to compile Java source in-memory and additionally emit the resulting .class files into a standard package directory layout on disk, with accompanying JUnit tests to validate output paths and behavior.
Changes:
- Introduce
JavaShell#compileAllTo(String, Iterable<String>, String, Path)plus a no-options overload to write compiled class bytes under an output directory. - Expand
JavaShellclass-level documentation to clarify binary-name expectations and compiler option formatting. - Add extensive
JavaShellTestcoverage for writing packaged/default-package classes, nested/auxiliary classes, directory creation, overwrite behavior, classloader availability, and compiler options.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/org/apache/groovy/util/JavaShell.java | Adds compileAllTo API, writes compiled class bytes to disk, and updates JavaDoc describing usage and options. |
| src/test/groovy/org/apache/groovy/util/JavaShellTest.groovy | Adds JUnit tests validating compileAllTo output locations, overwrite behavior, and option handling. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2548 +/- ##
==================================================
+ Coverage 68.1886% 68.1890% +0.0004%
- Complexity 32960 32961 +1
==================================================
Files 1504 1504
Lines 125785 125796 +11
Branches 22760 22762 +2
==================================================
+ Hits 85771 85779 +8
- Misses 32453 32455 +2
- Partials 7561 7562 +1
🚀 New features to boost your workflow:
|
✅ All tests passed ✅Test Summary
🏷️ Commit: b5ee383 Learn more about TestLens at testlens.app. |
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.
No description provided.