Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DotNetCoreCLIV2]adding option in case packageFile is .nuspec #13712

Merged
merged 7 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLIV2/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe('DotNetCoreExe Suite', function () {

tr.run();
assert(tr.invokedToolCount == 1, 'should have run dotnet once');
assert(tr.ran('c:\\path\\dotnet.exe pack c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=x.y.z-CI-YYYYMMDD-HHMMSS'), 'it should have run dotnet');
assert(tr.ran('c:\\path\\dotnet.exe pack -p:NugetConfig=c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=x.y.z-CI-YYYYMMDD-HHMMSS'), 'it should have run dotnet');
assert(tr.stdOutContained('dotnet output'), "should have dotnet output");
assert(tr.succeeded, 'should have succeeded');
assert.equal(tr.errorIssues.length, 0, "should have no errors");
Expand All @@ -369,7 +369,7 @@ describe('DotNetCoreExe Suite', function () {

tr.run();
assert(tr.invokedToolCount == 1, 'should have run dotnet once');
assert(tr.ran('c:\\path\\dotnet.exe pack c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=XX.YY.ZZ'), 'it should have run dotnet');
assert(tr.ran('c:\\path\\dotnet.exe pack -p:NugetConfig=c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=XX.YY.ZZ'), 'it should have run dotnet');
assert(tr.stdOutContained('dotnet output'), "should have dotnet output");
assert(tr.succeeded, 'should have succeeded');
assert.equal(tr.errorIssues.length, 0, "should have no errors");
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreCLIV2/Tests/PackTests/packEnvVar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
"dotnet": "c:\\path\\dotnet.exe"
},
"exec": {
"c:\\path\\dotnet.exe pack c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=XX.YY.ZZ": {
"c:\\path\\dotnet.exe pack -p:NugetConfig=c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=XX.YY.ZZ": {
"code": 0,
"stdout": "dotnet output",
"stderr": ""
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreCLIV2/Tests/PackTests/packPrerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
"dotnet": "c:\\path\\dotnet.exe"
},
"exec": {
"c:\\path\\dotnet.exe pack c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=x.y.z-CI-YYYYMMDD-HHMMSS": {
"c:\\path\\dotnet.exe pack -p:NugetConfig=c:\\agent\\home\\directory\\foo.nuspec --output C:\\out\\dir /p:PackageVersion=x.y.z-CI-YYYYMMDD-HHMMSS": {
"code": 0,
"stdout": "dotnet output",
"stderr": ""
Expand Down
7 changes: 6 additions & 1 deletion Tasks/DotNetCoreCLIV2/packcommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ function dotnetPackAsync(dotnetPath: string, packageFile: string, outputDir: str
let dotnet = tl.tool(dotnetPath);

dotnet.arg("pack");
dotnet.arg(packageFile);

if(packageFile.endsWith(".nuspec"))
{
NinadKavimandan marked this conversation as resolved.
Show resolved Hide resolved
dotnet.arg("-p:NugetConfig="+packageFile);
NinadKavimandan marked this conversation as resolved.
Show resolved Hide resolved
}
else dotnet.arg(packageFile);

if (outputDir) {
dotnet.arg("--output");
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreCLIV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 175,
"Minor": 176,
"Patch": 0
},
"minimumAgentVersion": "2.115.0",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLIV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"demands": [],
"version": {
"Major": 2,
"Minor": 175,
"Minor": 176,
"Patch": 0
},
"minimumAgentVersion": "2.115.0",
Expand Down Expand Up @@ -571,4 +571,4 @@
"NetCore3Update": "ms-resource:loc.messages.NetCore3Update",
"DeprecatedDotnet2_2_And_3_0": "ms-resource:loc.messages.DeprecatedDotnet2_2_And_3_0"
}
}
}