Skip to content

Commit 463a6db

Browse files
committed
Change property name for nuspec file
1 parent 684f75d commit 463a6db

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/NuGet.Core/NuGet.Build.Tasks.Pack/GetPackOutputItemsTask.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class GetPackOutputItemsTask : Microsoft.Build.Utilities.Task
2929
[Required]
3030
public string NuspecOutputPath { get; set; }
3131

32-
public string NuspecInputFilePath { get; set; }
32+
public string NuspecFile { get; set; }
3333

3434
public string[] NuspecProperties { get; set; }
3535

@@ -52,7 +52,7 @@ public override bool Execute()
5252
var packageId = PackageId;
5353
var packageVersion = PackageVersion;
5454

55-
if (!string.IsNullOrWhiteSpace(NuspecInputFilePath))
55+
if (!string.IsNullOrWhiteSpace(NuspecFile))
5656
{
5757
bool hasVersionInNuspecProperties = false;
5858
if (NuspecProperties != null && NuspecProperties.Length > 0)
@@ -70,7 +70,7 @@ public override bool Execute()
7070
}
7171
}
7272

73-
var nuspecReader = new NuGet.Packaging.NuspecReader(NuspecInputFilePath);
73+
var nuspecReader = new NuGet.Packaging.NuspecReader(NuspecFile);
7474
packageId = nuspecReader.GetId();
7575
if (!hasVersionInNuspecProperties)
7676
{

src/NuGet.Core/NuGet.Build.Tasks/NuGet.Build.Tasks.Pack.targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ Copyright (c) .NET Foundation. All rights reserved.
108108

109109
<!-- 'PackageOutputAbsolutePath' and 'NuspecOutputAbsolutePath' will be provided by '_GetAbsoluteOutputPathsForPack' target -->
110110

111+
<ConvertToAbsolutePath Condition="$(NuspecFile) != ''" Paths="$(NuspecFile)">
112+
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
113+
</ConvertToAbsolutePath>
114+
111115
<GetPackOutputItemsTask
112116
PackageOutputPath="$(PackageOutputAbsolutePath)"
113117
NuspecOutputPath="$(NuspecOutputAbsolutePath)"
114-
NuspecInputFilePath="$(NuspecFile)"
118+
NuspecFile="$(NuspecFileAbsolutePath)"
115119
NuspecProperties="$(NuspecProperties)"
116120
PackageId="$(PackageId)"
117121
PackageVersion="$(PackageVersion)"

test/NuGet.Core.Tests/NuGet.Build.Tasks.Pack.Test/NuGet.Build.Tasks.Pack.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>$(TargetFrameworksUnitTest)</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
45
<Description>Unit tests for NuGet.Build.Tasks.Pack.</Description>
56
</PropertyGroup>
67

test/NuGet.Core.Tests/NuGet.Build.Tasks.Pack.Test/PackageNameTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void GetPackOutputItemsTask_PackageFileName(PackageFileNameTestCase testC
108108
outputItemTask.NuspecOutputPath = testDirectory.Path;
109109
if (testCase.UseNuspecFile)
110110
{
111-
outputItemTask.NuspecInputFilePath = System.IO.Path.Combine(testDirectory.Path, FILENAME_NUSPEC_FILE);
111+
outputItemTask.NuspecFile = System.IO.Path.Combine(testDirectory.Path, FILENAME_NUSPEC_FILE);
112112
}
113113

114114
CreateTestProjectFileAndNuspecFile(testDirectory, FILENAME_PROJECT_FILE, FILENAME_NUSPEC_FILE, testCase);

0 commit comments

Comments
 (0)