diff --git a/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts b/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts index 6f0f1da3b..54644f865 100644 --- a/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts +++ b/extension/src/views/gradleDaemons/services/GradleLocalInstallation.ts @@ -1,11 +1,11 @@ import { GradleExecution } from "./GradleExecution"; import { execAsync } from "../../../util/execAsync"; import { getConfigJavaImportGradleJavaHome } from "../../../util/config"; -import * as vscode from "vscode"; +import { logger } from "../../../logger"; export class GradleLocalInstallation implements GradleExecution { private gradleHomePath: string; - private outputChannel: vscode.OutputChannel; + constructor(gradleHomePath: string) { this.gradleHomePath = gradleHomePath; } @@ -23,8 +23,7 @@ export class GradleLocalInstallation implements GradleExecution { const { stdout, stderr } = await execAsync(command, { env }); if (stderr) { - this.outputChannel.appendLine(`${stderr}`); - this.outputChannel.show(); + logger.warn(stderr); } return stdout; } catch (error) { diff --git a/extension/src/views/gradleDaemons/services/GradleWrapper.ts b/extension/src/views/gradleDaemons/services/GradleWrapper.ts index 7a9b8d0ef..074d1beaa 100644 --- a/extension/src/views/gradleDaemons/services/GradleWrapper.ts +++ b/extension/src/views/gradleDaemons/services/GradleWrapper.ts @@ -3,16 +3,13 @@ import { execAsync } from "../../../util/execAsync"; import { GradleExecution } from "./GradleExecution"; import * as path from "path"; import { getConfigJavaImportGradleJavaHome } from "../../../util/config"; -import * as vscode from "vscode"; - +import { logger } from "../../../logger"; export class GradleWrapper implements GradleExecution { private gradleWrapperPath: string; - private outputChannel: vscode.OutputChannel; constructor(private projectRoot: string) { const wrapperName = process.platform === "win32" ? "gradlew.bat" : "gradlew"; this.gradleWrapperPath = path.join(projectRoot, wrapperName); - this.outputChannel = vscode.window.createOutputChannel("Gradle Wrapper"); } public async exec(args: string[]): Promise { @@ -24,11 +21,9 @@ export class GradleWrapper implements GradleExecution { try { const jdkPath = getConfigJavaImportGradleJavaHome(); const env = jdkPath ? { ...process.env, JAVA_HOME: jdkPath } : process.env; - const { stdout, stderr } = await execAsync(command, { cwd: this.projectRoot, env }); if (stderr) { - this.outputChannel.appendLine(`${stderr}`); - this.outputChannel.show(); + logger.warn(stderr); } return stdout; } catch (error) {