-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating L0 for DotNetCoreCLIV2 task (#10773)
* Updating L0 * Removing unnecessary imports * Review comments
- Loading branch information
1 parent
dfe5b1a
commit ce203ff
Showing
4 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Controllers/ValuesController.fs" /> | ||
<Compile Include="Startup.fs" /> | ||
<Compile Include="Program.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import ma = require('azure-pipelines-task-lib/mock-answer'); | ||
import tmrm = require('azure-pipelines-task-lib/mock-run'); | ||
import path = require('path'); | ||
|
||
let taskPath = path.join(__dirname, '..', 'dotnetcore.js'); | ||
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
tmr.setInput('command', "publish"); | ||
tmr.setInput('projects', process.env["__projects__"]); | ||
tmr.setInput('publishWebProjects', process.env["__publishWebProjects__"] && process.env["__publishWebProjects__"] == "true" ? "true" : "false"); | ||
tmr.setInput('arguments', process.env["__arguments__"] ? process.env["__arguments__"] : ""); | ||
tmr.setInput('modifyOutputPath', process.env["modifyOutput"] == "false" ? "false" : "true"); | ||
tmr.setInput('zipAfterPublish', process.env["zipAfterPublish"] ? process.env["zipAfterPublish"] : "false"); | ||
tmr.setInput('workingDirectory', process.env["workingDirectory"] ? process.env["workingDirectory"] : ""); | ||
|
||
process.env['TASK_TEST_TRACE'] = "true"; | ||
|
||
var projectFile = path.join(__dirname, process.env["__projects__"]); | ||
var execCommand = "dotnet publish " + projectFile | ||
|
||
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{ | ||
"which": { | ||
"dotnet": "dotnet", | ||
}, | ||
"checkPath": { "dotnet": true }, | ||
"exec": {}, | ||
"findMatch": { | ||
"**/*.csproj\n**/*.vbproj\n**/*.fsproj": [projectFile] | ||
} | ||
} | ||
|
||
a['exec'][execCommand] = { | ||
"code": 0, | ||
"stdout": "published", | ||
"stderr": "" | ||
} | ||
|
||
process.env["MOCK_NORMALIZE_SLASHES"] = "true"; | ||
tmr.setAnswers(a) | ||
tmr.registerMock('azure-pipelines-task-lib/toolrunner', require('azure-pipelines-task-lib/mock-toolrunner')); | ||
|
||
tmr.run(); |