Skip to content

GROOVY-12025: Provide a JavaShell compileAllTo method#2548

Open
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12025
Open

GROOVY-12025: Provide a JavaShell compileAllTo method#2548
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:groovy12025

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JavaShell class-level documentation to clarify binary-name expectations and compiler option formatting.
  • Add extensive JavaShellTest coverage 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.

Comment thread src/main/java/org/apache/groovy/util/JavaShell.java Outdated
Comment thread src/main/java/org/apache/groovy/util/JavaShell.java Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.1890%. Comparing base (7865789) to head (b5ee383).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...rc/main/java/org/apache/groovy/util/JavaShell.java 91.6667% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                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     
Files with missing lines Coverage Δ
...rc/main/java/org/apache/groovy/util/JavaShell.java 86.2500% <91.6667%> (+0.7428%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 21, 2026

✅ All tests passed ✅

⚠️ TestLens detected flakiness ⚠️

Test Summary

Check Project/Task Test Runs
Build and test / lts (25, ubuntu-latest) :groovy-groovysh:test HelpCommandTest > helpListsKnownCommands() ❌ ✅

🏷️ Commit: b5ee383
▶️ Tests: 19954 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants