From 0d18b4db82ba839fd18b74446b3736b27b9a8672 Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Mon, 30 Sep 2019 12:27:48 +0200 Subject: [PATCH] fix(dotnet): use snupkg format for dotnet symbol packages (#830) The legacy format is not supported by NuGet's own symbols server, and the SymbolSource server is currently experiencing a certificate expiration event, which seems to be a somewhat recurring issue (NuGet/Home#6082). More info: https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg --- packages/jsii-build-tools/bin/package-dotnet | 4 +--- packages/jsii-dotnet-analyzers/.gitignore | 1 + packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js | 1 + packages/jsii-dotnet-analyzers/build.sh | 2 +- packages/jsii-dotnet-jsonmodel/.gitignore | 3 ++- packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js | 1 + packages/jsii-dotnet-jsonmodel/build.sh | 2 +- packages/jsii-dotnet-runtime/.gitignore | 1 + packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js | 1 + packages/jsii-dotnet-runtime/build.sh | 2 +- packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts | 1 + ...Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj | 1 + .../Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj | 1 + .../Amazon.JSII.Tests.CalculatorPackageId.csproj | 1 + 14 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/jsii-build-tools/bin/package-dotnet b/packages/jsii-build-tools/bin/package-dotnet index bfbb9ef3c9..139a3acebe 100755 --- a/packages/jsii-build-tools/bin/package-dotnet +++ b/packages/jsii-build-tools/bin/package-dotnet @@ -2,6 +2,4 @@ set -euo pipefail rm -fr dist/dotnet mkdir -p dist/dotnet -cp *.nupkg dist/dotnet - - +cp *.nupkg *.snupkg dist/dotnet diff --git a/packages/jsii-dotnet-analyzers/.gitignore b/packages/jsii-dotnet-analyzers/.gitignore index 65d6c8ce34..a472773f2c 100644 --- a/packages/jsii-dotnet-analyzers/.gitignore +++ b/packages/jsii-dotnet-analyzers/.gitignore @@ -11,6 +11,7 @@ coverage/ *.nupkg +*.snupkg bin/ cli/ obj/ diff --git a/packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js index e0c50b6ad4..474fa54246 100644 --- a/packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js @@ -4,6 +4,7 @@ process.stdout.write(` True True + snupkg True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) diff --git a/packages/jsii-dotnet-analyzers/build.sh b/packages/jsii-dotnet-analyzers/build.sh index 93d1136aa6..45720cd405 100644 --- a/packages/jsii-dotnet-analyzers/build.sh +++ b/packages/jsii-dotnet-analyzers/build.sh @@ -3,4 +3,4 @@ set -euo pipefail dotnet build --force -c Release ./src/Amazon.JSII.Analyzers -cp -f ./bin/Release/NuGet/*.nupkg . +cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/jsii-dotnet-jsonmodel/.gitignore b/packages/jsii-dotnet-jsonmodel/.gitignore index 50d4f258db..05816ba633 100644 --- a/packages/jsii-dotnet-jsonmodel/.gitignore +++ b/packages/jsii-dotnet-jsonmodel/.gitignore @@ -10,6 +10,7 @@ node_modules/ coverage/ *.nupkg +*.snupkg bin/ cli/ -obj/ \ No newline at end of file +obj/ diff --git a/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js index e0c50b6ad4..474fa54246 100644 --- a/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js @@ -4,6 +4,7 @@ process.stdout.write(` True True + snupkg True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) diff --git a/packages/jsii-dotnet-jsonmodel/build.sh b/packages/jsii-dotnet-jsonmodel/build.sh index 4e8b5b105b..c8720f3c39 100644 --- a/packages/jsii-dotnet-jsonmodel/build.sh +++ b/packages/jsii-dotnet-jsonmodel/build.sh @@ -5,4 +5,4 @@ npm run gen dotnet build --force -c Release ./src/Amazon.JSII.JsonModel.sln -cp -f ./bin/Release/NuGet/*.nupkg . +cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/jsii-dotnet-runtime/.gitignore b/packages/jsii-dotnet-runtime/.gitignore index 4ea90d1e30..f9ae73407a 100644 --- a/packages/jsii-dotnet-runtime/.gitignore +++ b/packages/jsii-dotnet-runtime/.gitignore @@ -20,6 +20,7 @@ coverage/ *.nupkg +*.snupkg bin/ cli/ obj/ diff --git a/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js index e0c50b6ad4..474fa54246 100644 --- a/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js @@ -4,6 +4,7 @@ process.stdout.write(` True True + snupkg True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) diff --git a/packages/jsii-dotnet-runtime/build.sh b/packages/jsii-dotnet-runtime/build.sh index 4e873f1104..769aeb3822 100644 --- a/packages/jsii-dotnet-runtime/build.sh +++ b/packages/jsii-dotnet-runtime/build.sh @@ -11,4 +11,4 @@ rsync -av node_modules/jsii-runtime/webpack/ ${bundle_dir} # built before the calc packages are generated. dotnet build --force -c Release ./src/Amazon.JSII.Runtime -cp -f ./bin/Release/NuGet/*.nupkg . +cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 29db6a1f1e..233df6727d 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -54,6 +54,7 @@ export class FileGenerator { propertyGroup.ele('GeneratePackageOnBuild', 'true'); propertyGroup.ele('GenerateDocumentationFile', 'true'); propertyGroup.ele('IncludeSymbols', 'true'); + propertyGroup.ele('SymbolPackageFormat', 'snupkg'); propertyGroup.ele('IncludeSource', 'true'); propertyGroup.ele('PackageVersion', this.getDecoratedVersion(assembly)); propertyGroup.ele('PackageId', packageId); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj index c14c4f9c2f..5ff506964c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj @@ -4,6 +4,7 @@ true true true + snupkg true 0.17.0 Amazon.JSII.Tests.CalculatorPackageId.BasePackageId diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj index 611b57124d..cb6381bd53 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj @@ -4,6 +4,7 @@ true true true + snupkg true 0.17.0-devpreview Amazon.JSII.Tests.CalculatorPackageId.LibPackageId diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj index a862956f0c..51ff301a20 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj @@ -4,6 +4,7 @@ true true true + snupkg true 0.17.0 Amazon.JSII.Tests.CalculatorPackageId