ADFA-3224: ensure java is available in PATH when invoking D8#1052
ADFA-3224: ensure java is available in PATH when invoking D8#1052itsaky-adfa wants to merge 4 commits intostagefrom
Conversation
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe build configuration file is modified to ensure D8 can locate Java by prepending Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/build.gradle.kts (1)
506-515: Comment says "prepend" but code appends.The comment on line 507 states "Prepend JAVA_HOME/bin to PATH", but the implementation appends
java.home/binto the end of the existing PATH:<existing_PATH>:<java.home>/binFor the stated goal of making
javaresolvable, this works fine. However, if the intent were to override a potentially incompatible systemjava, prepending would be necessary.🔧 Proposed fix to actually prepend (if that's the intent)
environment( "PATH", - (System.getenv("PATH")?.let { it + File.pathSeparator } ?: "") + - System.getProperty( - "java.home", - ) + File.separator + "bin", + System.getProperty("java.home") + File.separator + "bin" + + (System.getenv("PATH")?.let { File.pathSeparator + it } ?: ""), )Alternatively, just fix the comment to say "append" if the current behavior is intentional.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/build.gradle.kts` around lines 506 - 515, The comment claims we "Prepend JAVA_HOME/bin to PATH" but the environment(...) call currently appends java.home/bin; either update the comment to "Append JAVA_HOME/bin to PATH" or change the PATH expression to actually prepend: construct PATH as java.home + File.separator + "bin" + (File.pathSeparator + existing PATH if present) inside the environment("PATH", ...) call so that java.home/bin comes before the existing System.getenv("PATH"); refer to the environment(...) invocation and the "PATH" / System.getProperty("java.home") usages when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/build.gradle.kts`:
- Around line 506-515: The comment claims we "Prepend JAVA_HOME/bin to PATH" but
the environment(...) call currently appends java.home/bin; either update the
comment to "Append JAVA_HOME/bin to PATH" or change the PATH expression to
actually prepend: construct PATH as java.home + File.separator + "bin" +
(File.pathSeparator + existing PATH if present) inside the environment("PATH",
...) call so that java.home/bin comes before the existing System.getenv("PATH");
refer to the environment(...) invocation and the "PATH" /
System.getProperty("java.home") usages when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d0ceceae-e64d-46b3-bb44-bf5cebaa9de5
📒 Files selected for processing (1)
app/build.gradle.kts
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
See ADFA-3224 for more details.