Skip to content

Commit 8ff093f

Browse files
committed
Cleanup
1 parent 87a8622 commit 8ff093f

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ public string Id
160160
{
161161
get;
162162
set;
163-
} = string.Empty; // Set to empty to satisfy the nullability contract.
163+
} = string.Empty; // Set to empty to enforce a stricter nullability contract.
164+
// This would get validate in the Save() method before writing the manifest
164165

165166
public NuGetVersion? Version
166167
{
@@ -432,7 +433,7 @@ public void Save(Stream stream)
432433
throw new PackagingException(NuGetLogCode.NU5017, NuGetResources.CannotCreateEmptyPackage);
433434
}
434435

435-
ValidateDependencies(Version!, DependencyGroups);
436+
ValidateDependencies(Version, DependencyGroups);
436437
ValidateFilesUnique(Files);
437438
ValidateReferenceAssemblies(Files, PackageAssemblyReferences);
438439
ValidateFrameworkAssemblies(FrameworkReferences, FrameworkReferenceGroups);
@@ -595,7 +596,7 @@ private static bool HasXdtTransformFile(ICollection<IPackageFile> contentFiles)
595596
file.Path.EndsWith(".uninstall.xdt", StringComparison.OrdinalIgnoreCase)));
596597
}
597598

598-
private static void ValidateDependencies(SemanticVersion version,
599+
private static void ValidateDependencies(SemanticVersion? version,
599600
IEnumerable<PackageDependencyGroup> dependencies)
600601
{
601602
var frameworksMissingPlatformVersion = new HashSet<string>(dependencies
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
#nullable enable
2+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, string basePath, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, NuGet.Common.ILogger logger, string versionOverride) -> void
3+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, string basePath, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, string versionOverride) -> void
4+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, NuGet.Common.ILogger logger, string versionOverride) -> void
5+
~NuGet.Packaging.PackageBuilder.PackageBuilder(System.IO.Stream stream, string basePath, System.Func<string, string> propertyProvider, string versionOverride) -> void
6+
~static NuGet.Packaging.Manifest.ReadFrom(System.IO.Stream stream, System.Func<string, string> propertyProvider, bool validateSchema, NuGet.Versioning.NuGetVersion overrideVersion) -> NuGet.Packaging.Manifest
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
#nullable enable
2+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, string basePath, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, NuGet.Common.ILogger logger, string versionOverride) -> void
3+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, string basePath, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, string versionOverride) -> void
4+
~NuGet.Packaging.PackageBuilder.PackageBuilder(string path, System.Func<string, string> propertyProvider, bool includeEmptyDirectories, bool deterministic, NuGet.Common.ILogger logger, string versionOverride) -> void
5+
~NuGet.Packaging.PackageBuilder.PackageBuilder(System.IO.Stream stream, string basePath, System.Func<string, string> propertyProvider, string versionOverride) -> void
6+
~static NuGet.Packaging.Manifest.ReadFrom(System.IO.Stream stream, System.Func<string, string> propertyProvider, bool validateSchema, NuGet.Versioning.NuGetVersion overrideVersion) -> NuGet.Packaging.Manifest

test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetPackCommandTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4626,7 +4626,7 @@ public void PackCommand_PackLicense_ComplexExpression_WithNonStandardLicense()
46264626
<requireLicenseAcceptance>{requireLicenseAcceptance.ToString().ToLowerInvariant()}</requireLicenseAcceptance>
46274627
<description>Description</description>
46284628
<copyright>Copyright © 2013</copyright>
4629-
<license>{licenseExpr}</license>
4629+
<license type=""expression"">{licenseExpr}</license>
46304630
<dependencies>
46314631
<dependency id='p1' version='1.5.11' />
46324632
</dependencies>

0 commit comments

Comments
 (0)