From aafd4059af7bcd08d84c110dd241442b84eb51ec Mon Sep 17 00:00:00 2001 From: Christopher Currie Date: Tue, 29 Jan 2019 02:32:28 -0800 Subject: [PATCH] feat: Generate NuGet symbol and source packages (#243) Similar to Java source jars, these packages can be published to NuGet to aid debugging by consumers. --- packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js | 2 ++ .../Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs | 2 ++ .../Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs | 2 ++ .../src/Amazon.JSII.Generator/AssemblyExtensions.cs | 2 ++ packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js | 2 ++ packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js | 2 ++ .../Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj | 2 ++ .../Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj | 2 ++ .../Amazon.JSII.Tests.CalculatorPackageId.csproj | 2 ++ 9 files changed, 18 insertions(+) diff --git a/packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js index 3ad36ae84e..a16129c39c 100644 --- a/packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js @@ -3,6 +3,8 @@ const package = require('./package.json'); process.stdout.write(` True + True + True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) ${package.description} diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs index ded75d6508..2480d6ef2f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs @@ -277,6 +277,8 @@ public void IncludesAllPresentProperties() Assert.Collection(actual, element => Assert.Equal("netstandard2.0", element.ToString()), element => Assert.Equal("true", element.ToString()), + element => Assert.Equal("True", element.ToString()), + element => Assert.Equal("True", element.ToString()), element => Assert.Equal("1.2.3", element.ToString()), element => Assert.Equal("My.PackageId", element.ToString()), element => Assert.Equal("my description", element.ToString()), diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs index 03f80b066c..4b96d299a5 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs @@ -234,6 +234,8 @@ public void CreatesBasicProjectFile() netstandard2.0 true + true + true myAuthors myCompany 1.2.3 diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs index c6e2db96d3..49cf83af1f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs @@ -57,6 +57,8 @@ public static IEnumerable GetMsBuildProperties(this Assembly assembly) { yield return new XElement("TargetFramework", "netstandard2.0"); yield return new XElement("GeneratePackageOnBuild", true); + yield return new XElement("IncludeSymbols", true); + yield return new XElement("IncludeSource", true); yield return new XElement("PackageVersion", assembly.Version); yield return new XElement("PackageId", assembly.Targets.DotNet.PackageId); yield return new XElement("Description", assembly.Description); diff --git a/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js index 31ae79a311..e0c50b6ad4 100644 --- a/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js @@ -3,6 +3,8 @@ const package = require('./package.json'); process.stdout.write(` True + True + True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) ${package.description} diff --git a/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js b/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js index 31ae79a311..e0c50b6ad4 100644 --- a/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js +++ b/packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js @@ -3,6 +3,8 @@ const package = require('./package.json'); process.stdout.write(` True + True + True ..\\..\\bin\\$(Configuration)\\NuGet\\ $(JsiiVersion) ${package.description} 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 c47afa21d6..4412a0b20c 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 @@ -2,6 +2,8 @@ netstandard2.0 true + true + true 0.7.13 Amazon.JSII.Tests.CalculatorPackageId.BasePackageId An example direct dependency for jsii-calc. 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 6323fc63c2..37dbc699b4 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 @@ -2,6 +2,8 @@ netstandard2.0 true + true + true 0.7.13 Amazon.JSII.Tests.CalculatorPackageId.LibPackageId A simple calcuator library built on JSII. 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 e2a252c524..aa691925f0 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 @@ -2,6 +2,8 @@ netstandard2.0 true + true + true 0.7.13 Amazon.JSII.Tests.CalculatorPackageId A simple calcuator built on JSII.