Skip to content

Commit 5e076cf

Browse files
authored
feat: update Dockerfile to .NET SDK 3.1, improve NuGet metadata (#880)
1 parent f5f18c4 commit 5e076cf

15 files changed

Lines changed: 91 additions & 43 deletions

File tree

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ the standard [`nuget push`][nuget-push] command.
246246

247247
[NuGet]: https://www.nuget.org
248248
[nuget-push]: https://docs.microsoft.com/fr-fr/nuget/nuget-org/publish-a-package
249-
[.NET documentation]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packagelicenseurl
249+
[.NET documentation]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packageiconurl
250250

251251
### `tsc`
252252

packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@ const package = require('./package.json');
22

33
process.stdout.write(`<Project>
44
<PropertyGroup>
5-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<IncludeSymbols>True</IncludeSymbols>
7-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
8-
<IncludeSource>True</IncludeSource>
9-
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
105
<PackageVersion>$(JsiiVersion)</PackageVersion>
116
<Description>${package.description}</Description>
7+
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
8+
129
<ProjectUrl>${package.homepage}</ProjectUrl>
13-
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
10+
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
11+
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
12+
1413
<Authors>${package.author.name}</Authors>
1514
<Company>${package.author.name}</Company>
15+
16+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
17+
<IncludeSymbols>True</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<IncludeSource>True</IncludeSource>
20+
21+
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
22+
1623
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
1724
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
1825
</PropertyGroup>

packages/jsii-dotnet-analyzers/src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Title>.NET Roslyn Analyzers for JSII</Title>
77
<TargetFramework>netcoreapp2.1</TargetFramework>
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
9+
<PackageIcon>icon.png</PackageIcon>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
@@ -18,5 +18,6 @@
1818
<ItemGroup>
1919
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="tools" />
2020
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
21+
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
2122
</ItemGroup>
2223
</Project>

packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@ const package = require('./package.json');
22

33
process.stdout.write(`<Project>
44
<PropertyGroup>
5-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<IncludeSymbols>True</IncludeSymbols>
7-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
8-
<IncludeSource>True</IncludeSource>
9-
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
105
<PackageVersion>$(JsiiVersion)</PackageVersion>
116
<Description>${package.description}</Description>
7+
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
8+
129
<ProjectUrl>${package.homepage}</ProjectUrl>
13-
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
10+
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
11+
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
12+
1413
<Authors>${package.author.name}</Authors>
1514
<Company>${package.author.name}</Company>
15+
16+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
17+
<IncludeSymbols>True</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<IncludeSource>True</IncludeSource>
20+
21+
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
22+
1623
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
1724
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
1825
</PropertyGroup>

packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
<TargetFramework>netcoreapp2.1</TargetFramework>
66
<PackageId>Amazon.JSII.JsonModel</PackageId>
77
<Title>.NET JsonModel for JSII</Title>
8-
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
8+
<PackageIcon>icon.png</PackageIcon>
99
</PropertyGroup>
1010

1111
<ItemGroup>
1212
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
1313
</ItemGroup>
1414

15+
<ItemGroup>
16+
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
17+
</ItemGroup>
1518
</Project>

packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@ const package = require('./package.json');
22

33
process.stdout.write(`<Project>
44
<PropertyGroup>
5-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<IncludeSymbols>True</IncludeSymbols>
7-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
8-
<IncludeSource>True</IncludeSource>
9-
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
105
<PackageVersion>$(JsiiVersion)</PackageVersion>
116
<Description>${package.description}</Description>
7+
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
8+
129
<ProjectUrl>${package.homepage}</ProjectUrl>
13-
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
10+
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
11+
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
12+
1413
<Authors>${package.author.name}</Authors>
1514
<Company>${package.author.name}</Company>
15+
16+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
17+
<IncludeSymbols>True</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<IncludeSource>True</IncludeSource>
20+
21+
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
22+
1623
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
1724
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
1825
</PropertyGroup>

packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>netcoreapp2.1</TargetFramework>
66
<PackageId>Amazon.JSII.Runtime</PackageId>
77
<Title>.NET Runtime for JSII</Title>
8-
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
8+
<PackageIcon>icon.png</PackageIcon>
99
</PropertyGroup>
1010

1111
<ItemGroup>
@@ -20,5 +20,6 @@
2020
<EmbeddedResource Include="jsii-runtime\jsii-runtime.js" />
2121
<EmbeddedResource Include="jsii-runtime\jsii-runtime.js.map" />
2222
<EmbeddedResource Include="jsii-runtime\mappings.wasm" />
23+
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
2324
</ItemGroup>
2425
</Project>

packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/NodeProcess.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
2424
var runtimePath = Environment.GetEnvironmentVariable(JsiiRuntime);
2525
if (string.IsNullOrWhiteSpace(runtimePath))
2626
runtimePath = jsiiRuntimeProvider.JsiiRuntimePath;
27-
27+
2828
_process = new Process
2929
{
3030
StartInfo = new ProcessStartInfo
@@ -38,9 +38,9 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
3838
};
3939

4040
var assemblyVersion = GetAssemblyFileVersion();
41-
_process.StartInfo.EnvironmentVariables.Add(JsiiAgent,
41+
_process.StartInfo.EnvironmentVariables.Add(JsiiAgent,
4242
string.Format(JsiiAgentVersionString, Environment.Version, assemblyVersion.Item1, assemblyVersion.Item2));
43-
43+
4444
var debug = Environment.GetEnvironmentVariable(JsiiDebug);
4545
if (!string.IsNullOrWhiteSpace(debug) && !_process.StartInfo.EnvironmentVariables.ContainsKey(JsiiDebug))
4646
_process.StartInfo.EnvironmentVariables.Add(JsiiDebug, debug);
@@ -64,13 +64,13 @@ void IDisposable.Dispose()
6464
StandardError.Dispose();
6565
_process.Dispose();
6666
}
67-
67+
6868
/// <summary>
6969
/// Gets the target framework attribute value and
7070
/// the assembly file version for the current .NET assembly
7171
/// </summary>
7272
/// <returns>A tuple where Item1 is the target framework
73-
/// ie .NETStandard,Version=v2.0
73+
/// ie .NETCoreApp,Version=v2.1
7474
/// and item2 is the assembly file version (ie 1.0.0.0)</returns>
7575
private Tuple<string, string> GetAssemblyFileVersion()
7676
{
@@ -83,4 +83,4 @@ private Tuple<string, string> GetAssemblyFileVersion()
8383
);
8484
}
8585
}
86-
}
86+
}

packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export class FileGenerator {
6060
propertyGroup.ele('PackageId', packageId);
6161
propertyGroup.ele('Description', this.getDescription());
6262
propertyGroup.ele('ProjectUrl', assembly.homepage);
63-
propertyGroup.ele('LicenseUrl', `https://spdx.org/licenses/${assembly.license}.html`);
63+
propertyGroup.ele('RepositoryUrl', assembly.repository.url);
64+
propertyGroup.ele('RepositoryType', assembly.repository.type);
65+
propertyGroup.ele('PackageLicenseExpression', assembly.license);
6466
propertyGroup.ele('Authors', assembly.author.name);
6567
propertyGroup.ele('Language', 'en-US');
6668

packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<PackageId>Amazon.JSII.Tests.CalculatorPackageId.BasePackageId</PackageId>
1111
<Description>An example direct dependency for jsii-calc.</Description>
1212
<ProjectUrl>https://github.com/aws/jsii</ProjectUrl>
13-
<LicenseUrl>https://spdx.org/licenses/Apache-2.0.html</LicenseUrl>
13+
<RepositoryUrl>https://github.com/aws/jsii.git</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
15+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1416
<Authors>Amazon Web Services</Authors>
1517
<Language>en-US</Language>
1618
</PropertyGroup>

0 commit comments

Comments
 (0)