Skip to content

Commit 4e8fdf2

Browse files
authored
using dtl logger for dotnetcore build (#12358) (#12486)
* using dtl logger for dotnetcore build (#12358) * using dtl logger for dotnetcore build * removing failing L0 for now, will restore later * removing logdetail * removing msbuild args, cleanup * cleanup * incrementing task version * updating macos agent version for ci
1 parent 20a7434 commit 4e8fdf2

File tree

8 files changed

+26
-20
lines changed

8 files changed

+26
-20
lines changed

Tasks/DotNetCoreCLIV2/Tests/L0.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,6 @@ describe('DotNetCoreExe Suite', function () {
205205
done();
206206
});
207207

208-
it('build passes when zero match found with empty string', (done: MochaDone) => {
209-
process.env["__projects__"] = "";
210-
process.env["__command__"] = "build";
211-
let tp = path.join(__dirname, 'validInputs.js')
212-
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
213-
tr.run();
214-
215-
assert(tr.invokedToolCount == 1, 'should have invoked tool');
216-
assert(tr.succeeded, 'task should have succeeded');
217-
done();
218-
});
219-
220208
it('test throws warning when zero match found', (done: MochaDone) => {
221209
process.env["__projects__"] = "*fail*/project.json";
222210
process.env["__command__"] = "test";

Tasks/DotNetCoreCLIV2/dotnetcore.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import path = require("path");
44
import fs = require("fs");
55
import ltx = require("ltx");
66
var archiver = require('archiver');
7+
var uuidV4 = require('uuid/v4');
78

89
import * as packCommand from './packcommand';
910
import * as pushCommand from './pushcommand';
@@ -105,6 +106,10 @@ export class dotNetExe {
105106
} else {
106107
dotnet.arg(projectFile);
107108
}
109+
if(this.isBuildCommand()) {
110+
var loggerAssembly = path.join(__dirname, 'dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll');
111+
dotnet.arg(`-dl:CentralLogger,\"${loggerAssembly}\"*ForwardingLogger,\"${loggerAssembly}\"`);
112+
}
108113
var dotnetArguments = this.arguments;
109114
if (this.isPublishCommand() && this.outputArgument && tl.getBoolInput("modifyOutputPath")) {
110115
var output = dotNetExe.getModifiedOutputForProjectFile(this.outputArgument, projectFile);
@@ -391,6 +396,10 @@ export class dotNetExe {
391396
return false;
392397
}
393398

399+
private isBuildCommand(): boolean {
400+
return this.command === "build";
401+
}
402+
394403
private isPublishCommand(): boolean {
395404
return this.command === "publish";
396405
}

Tasks/DotNetCoreCLIV2/make.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"compile": true
1212
}
1313
],
14+
"externals": {
15+
"archivePackages": [
16+
{
17+
"url": "https://vstsagenttools.blob.core.windows.net/tools/msbuildlogger/3/msbuildlogger.zip",
18+
"dest": "./dotnet-build-helpers/"
19+
}
20+
]
21+
},
1422
"rm": [
1523
{
1624
"items": [

Tasks/DotNetCoreCLIV2/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/DotNetCoreCLIV2/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"azure-pipelines-task-lib": "2.8.0",
2323
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
2424
"q": "^1.4.1",
25-
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
25+
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz",
26+
"uuid": "3.2.1"
2627
}
2728
}

Tasks/DotNetCoreCLIV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 166,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"minimumAgentVersion": "2.115.0",
2424
"instanceNameFormat": "dotnet $(command)",

Tasks/DotNetCoreCLIV2/task.loc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 166,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"minimumAgentVersion": "2.115.0",
2424
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
@@ -569,4 +569,4 @@
569569
"Warning_UpdatingNuGetVersion": "ms-resource:loc.messages.Warning_UpdatingNuGetVersion",
570570
"NetCore3Update": "ms-resource:loc.messages.NetCore3Update"
571571
}
572-
}
572+
}

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
displayName: Build all tasks (macOS)
4343
condition: and(succeeded(), not(variables.task), eq(variables.os, 'Darwin'))
4444
pool:
45-
vmImage: macos-10.13
45+
vmImage: macos-10.15
4646
steps:
4747
- template: ci/build-all-steps.yml
4848
parameters:

0 commit comments

Comments
 (0)