Skip to content

Commit

Permalink
feat: Generate NuGet symbol and source packages (#243)
Browse files Browse the repository at this point in the history
Similar to Java source jars, these packages can be published to NuGet to aid debugging by consumers.
  • Loading branch information
christophercurrie authored and RomainMuller committed Jan 29, 2019
1 parent 1fa72f1 commit aafd405
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/jsii-dotnet-generator/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const package = require('./package.json');
process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ public void IncludesAllPresentProperties()
Assert.Collection(actual,
element => Assert.Equal("<TargetFramework>netstandard2.0</TargetFramework>", element.ToString()),
element => Assert.Equal("<GeneratePackageOnBuild>true</GeneratePackageOnBuild>", element.ToString()),
element => Assert.Equal("<IncludeSymbols>True</IncludeSymbols>", element.ToString()),
element => Assert.Equal("<IncludeSource>True</IncludeSource>", element.ToString()),
element => Assert.Equal("<PackageVersion>1.2.3</PackageVersion>", element.ToString()),
element => Assert.Equal("<PackageId>My.PackageId</PackageId>", element.ToString()),
element => Assert.Equal("<Description>my description</Description>", element.ToString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ public void CreatesBasicProjectFile()
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<Authors>myAuthors</Authors>
<Company>myCompany</Company>
<PackageVersion>1.2.3</PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static IEnumerable<XElement> 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);
Expand Down
2 changes: 2 additions & 0 deletions packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const package = require('./package.json');
process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
Expand Down
2 changes: 2 additions & 0 deletions packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const package = require('./package.json');
process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<PackageVersion>0.7.13</PackageVersion>
<PackageId>Amazon.JSII.Tests.CalculatorPackageId.BasePackageId</PackageId>
<Description>An example direct dependency for jsii-calc.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<PackageVersion>0.7.13</PackageVersion>
<PackageId>Amazon.JSII.Tests.CalculatorPackageId.LibPackageId</PackageId>
<Description>A simple calcuator library built on JSII.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<PackageVersion>0.7.13</PackageVersion>
<PackageId>Amazon.JSII.Tests.CalculatorPackageId</PackageId>
<Description>A simple calcuator built on JSII.</Description>
Expand Down

0 comments on commit aafd405

Please sign in to comment.