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

File tree

15 files changed

+91
-43
lines changed

15 files changed

+91
-43
lines changed

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>

packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.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.LibPackageId</PackageId>
1111
<Description>A simple calcuator library built on JSII. (Stability: Deprecated)</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>

packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.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</PackageId>
1111
<Description>A simple calcuator built on JSII. (Stability: Experimental)</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
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>

packages/jsii-ruby-runtime/project/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
jsii_runtime (0.18.0)
4+
jsii_runtime (0.19.0)
55

66
GEM
77
remote: https://rubygems.org/

superchain/Dockerfile

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
FROM amazonlinux:2
22

3+
# Install deltarpm as it can speed up the upgrade processes
4+
RUN yum -y install deltarpm
5+
36
# Install .NET Core, mono & PowerShell
47
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true \
5-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
8+
DOTNET_RUNNING_IN_CONTAINER=true \
9+
DOTNET_USE_POLLING_FILE_WATCHER=true \
10+
NUGET_XMLDOC_MODE=skip
611
COPY gpg/mono.asc /tmp/mono.asc
712
RUN rpm --import "https://packages.microsoft.com/keys/microsoft.asc" \
813
&& rpm -Uvh "https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm" \
914
&& rpm --import /tmp/mono.asc && rm -f /tmp/mono.asc \
1015
&& curl "https://download.mono-project.com/repo/centos6-stable.repo" | tee /etc/yum.repos.d/mono-centos6-stable.repo \
11-
&& yum -y install dotnet-sdk-2.2 mono-devel powershell \
12-
&& yum clean all && rm -rf /var/cache/yum
16+
&& yum -y install dotnet-sdk-3.0 dotnet-sdk-2.2 mono-devel powershell \
17+
&& yum clean all && rm -rf /var/cache/yum \
18+
&& dotnet help
1319

1420
# Install Python 3
1521
RUN yum -y install python3 python3-pip \
1622
&& python3 -m pip install --upgrade pip setuptools wheel twine \
1723
&& yum clean all && rm -rf /var/cache/yum
1824

1925
# Install Ruby 2.4+
26+
ENV GEM_HOME /usr/local/bundle
2027
RUN amazon-linux-extras install ruby2.4 \
2128
&& yum -y install gcc make ruby-devel rubygem-rdoc system-rpm-config \
2229
&& yum clean all && rm -rf /var/cache/yum \
23-
&& echo 'install: --no-document' > ~/.gemrc \
30+
&& echo 'install: --no-document' > /usr/local/etc/gemrc \
31+
&& echo 'update: --no-document' >> /usr/local/etc/gemrc \
32+
&& mkdir -p "$GEM_HOME" \
2433
&& gem install 'bundler:~>1.17.2' 'bundler:~>2.0.2'
34+
ENV BUNDLE_PATH="$GEM_HOME" \
35+
BUNDLE_SILENCE_ROOT_WARNING=1 \
36+
BUNDLE_APP_CONFIG="$GEM_HOME" \
37+
PATH="$GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH"
2538

26-
# Install JDK8 (Corretto)
39+
# Install JDK8 (Corretto)
2740
RUN amazon-linux-extras install corretto8 \
2841
&& yum -y install maven \
2942
&& yum clean all && rm -rf /var/cache/yum
@@ -39,8 +52,8 @@ RUN yum -y install awscli git gzip openssl rsync tar unzip which zip
3952
&& yum clean all && rm -rf /var/cache/yum
4053

4154
# Install NVM and Node 8+
42-
ARG NODE_VERSION=8.16.0
43-
ARG NPM_VERSION=6.8.0
55+
ARG NODE_VERSION=12.12.0
56+
ARG NPM_VERSION=6.12.0
4457
ENV NVM_DIR=/usr/local/nvm
4558
RUN curl -sSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh -o /tmp/install-nvm.sh \
4659
&& echo "ef7ad1db40c92f348c0461f24983b71ba0ea7d45d4007a36e484270fa7f81fcf /tmp/install-nvm.sh" | sha256sum -c \
@@ -71,7 +84,7 @@ ARG BUILD_TIMESTAMP
7184
ARG COMMIT_ID
7285
LABEL org.opencontainers.image.created=${BUILD_TIMESTAMP} \
7386
org.opencontainers.image.title="jsii/superchain" \
74-
org.opencontainers.image.description="An image to build cross-language artifacts with AWS JSII" \
87+
org.opencontainers.image.description="An image to build cross-language artifacts with AWS jsii" \
7588
org.opencontainers.image.url="https://github.com/aws/jsii/tree/master/superchain" \
7689
org.opencontainers.image.source="https://github.com/aws/jsii.git" \
7790
org.opencontainers.image.revision=$COMMIT_ID

superchain/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ required in order to package [jsii] projects in all supported languages.
1010
SDK | Version
1111
----------------|-------------------------------------------
1212
`OpenJDK 8` | Amazon Corretto `>= 8.222.10.2`
13-
`.NET Core` | `>= 2.2.301` and `mono >= 6.0.0.319`
14-
`Javascript` | `node >= 8.16.0` with `npm >= 6.8.0`
13+
`.NET SDK` | `>= 3.0.100` and `>= 2.2.402`
14+
`mono` | `>= 6.0.0.319`
15+
`Javascript` | `node >= 12.12.0` with `npm >= 6.12.0`
1516
`PowerShell` | `pwsh >= 6.2.2`
1617
`Python 3` | `python3 >= 3.7.3` with `pip3 >= 19.1.1`
1718
`Ruby` | `ruby >= 2.4.4p296`

0 commit comments

Comments
 (0)