Skip to content

Commit

Permalink
feat: handle spawn error on gradle command (#295)
Browse files Browse the repository at this point in the history
* feat: handle spawn error on gradle command

* feat: set java path in ci
  • Loading branch information
DOlufemi authored Nov 29, 2024
1 parent 3c5e683 commit 37316ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ jobs:
<<: *windows_defaults
environment:
JDK: << parameters.jdk_version >>
# JAVA_HOME: << parameters.jdk_path >>
JAVA_HOME: << parameters.jdk_path >>
npm_config_loglevel: silent
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.daemon.idletimeout=180000 -Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dkotlin.compiler.execution.strategy=in-process'
JAVA_OPTS: ' -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8'
Expand Down
1 change: 0 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ async function getAllDeps(
if (gradleVersion.match(/Gradle 1/)) {
throw new Error('Gradle 1.x is not supported');
}

try {
const extractedJSON = await getAllDepsWithPlugin(
root,
Expand Down
4 changes: 4 additions & 0 deletions lib/sub-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export function execute(
stderr = stderr + data;
});

proc.on('error', (error) => {
stderr = stderr + error;
});

proc.on('close', (code: number) => {
if (code !== 0) {
const fullCommand = command + ' ' + args.join(' ');
Expand Down
1 change: 0 additions & 1 deletion test/system/failure-states.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as path from 'path';
import { fixtureDir } from '../common';
import { inspect } from '../../lib';

const rootNoWrapper = fixtureDir('no wrapper');

test('malformed build.gradle', async () => {
Expand Down

0 comments on commit 37316ad

Please sign in to comment.