From 07018816c2e1a6317937fc04a40c902a16d9c597 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Tue, 25 Sep 2018 21:09:03 +0200 Subject: [PATCH] Warnings indicated a build failure --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/SwiftTools.ts | 13 +++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 125daa2..a079496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.5.2 + +- Warnings indicated a build failure + ## 2.5.1 - Resolve `~` to the home dir #30 diff --git a/package.json b/package.json index 6c27386..16826e1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/vknabel" }, "license": "Apache-2.0", - "version": "2.5.1", + "version": "2.5.2", "publisher": "vknabel", "icon": "icons/icon.png", "galleryBanner": { diff --git a/src/SwiftTools.ts b/src/SwiftTools.ts index 4d05805..a542c0c 100644 --- a/src/SwiftTools.ts +++ b/src/SwiftTools.ts @@ -17,8 +17,8 @@ export function buildPackage( pkgPath: string, params: string[] ) { - stdout = null; - stderr = null; + stdout = ""; + stderr = ""; error = null; const sb = cp.spawn(swiftBinPath, params, { cwd: pkgPath }); sb.stdout.on("data", data => { @@ -45,9 +45,10 @@ export function buildPackage( trace(`***swift build command exited*** code: ${code}, signal: ${signal}`); dumpInConsole("\n"); diagnosticCollection.clear(); - if (stderr && stdout) { + if (stderr) { dumpDiagnostics(); - } else if (stderr) { + } + if (code != 0) { makeBuildStatusFailed(); } else { makeBuildStatusSuccessful(); @@ -123,10 +124,6 @@ function dumpDiagnostics() { diagnosticMap.forEach((diags, file) => { diagnosticCollection.set(Uri.parse(file), diags); }); - - // trace(stderr) - // trace("build failed") - makeBuildStatusFailed(); } function toVSCodeSeverity(sev: string) {