Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gradle): check if java is installed #29572

Merged

Conversation

xiongemi
Copy link
Collaborator

@xiongemi xiongemi commented Jan 9, 2025

Current Behavior

Expected Behavior

throw an error when ./gradlew wrapper or java -version failed to run:
Screenshot 2025-01-09 at 5 33 38 PM
Screenshot 2025-01-09 at 5 32 20 PM

Related Issue(s)

Fixes #

@xiongemi xiongemi requested a review from FrozenPandaz as a code owner January 9, 2025 17:16
Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 7:22pm

@xiongemi xiongemi force-pushed the feature/nxc-1240-handle-when-java-or-gradle-is-not-installed branch from 2a6ddc0 to c93a107 Compare January 9, 2025 18:53
Copy link

nx-cloud bot commented Jan 9, 2025

View your CI Pipeline Execution ↗ for commit 57202fc.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 13m 57s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 16s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx format:check --base=7ef4f... ✅ Succeeded 20s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 19s View ↗
nx documentation --no-dte ✅ Succeeded 45s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-15 19:40:09 UTC

@xiongemi xiongemi force-pushed the feature/nxc-1240-handle-when-java-or-gradle-is-not-installed branch from c93a107 to 63c7ccf Compare January 9, 2025 18:57
@xiongemi xiongemi force-pushed the feature/nxc-1240-handle-when-java-or-gradle-is-not-installed branch 3 times, most recently from 01a42d2 to ab0106a Compare January 10, 2025 01:17
@xiongemi xiongemi requested a review from FrozenPandaz January 13, 2025 19:21
@@ -23,7 +23,7 @@ export function execGradleAsync(
args: ReadonlyArray<string>,
execOptions: ExecFileOptions = {}
): Promise<Buffer> {
return new Promise<Buffer>((res, rej) => {
return new Promise<Buffer>((res, rej: (stdkout: Buffer) => void) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return new Promise<Buffer>((res, rej: (stdkout: Buffer) => void) => {
return new Promise<Buffer>((res, rej: (stdout: Buffer) => void) => {

@xiongemi xiongemi force-pushed the feature/nxc-1240-handle-when-java-or-gradle-is-not-installed branch from ab0106a to 57202fc Compare January 15, 2025 19:19
@xiongemi xiongemi merged commit f9c306a into master Jan 15, 2025
6 checks passed
@xiongemi xiongemi deleted the feature/nxc-1240-handle-when-java-or-gradle-is-not-installed branch January 15, 2025 19:47
FrozenPandaz pushed a commit that referenced this pull request Jan 17, 2025
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
throw an error when `./gradlew wrapper` or `java -version` failed to
run:
<img width="949" alt="Screenshot 2025-01-09 at 5 33 38 PM"
src="https://github.com/user-attachments/assets/f0b99adc-ff80-4962-8dfe-c1ad11944cac"
/>
<img width="933" alt="Screenshot 2025-01-09 at 5 32 20 PM"
src="https://github.com/user-attachments/assets/11d2286a-cc04-48a0-9839-b67cc93d5cfc"
/>

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

(cherry picked from commit f9c306a)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants