Skip to content

Commit

Permalink
feat: update Dockerfile to .NET SDK 3.1, improve NuGet metadata (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller authored Oct 16, 2019
1 parent f5f18c4 commit 5e076cf
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ the standard [`nuget push`][nuget-push] command.

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

### `tsc`

Expand Down
19 changes: 13 additions & 6 deletions packages/jsii-dotnet-analyzers/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ const package = require('./package.json');

process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
<ProjectUrl>${package.homepage}</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
<Authors>${package.author.name}</Authors>
<Company>${package.author.name}</Company>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Title>.NET Roslyn Analyzers for JSII</Title>
<TargetFramework>netcoreapp2.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,5 +18,6 @@
<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="tools" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
</ItemGroup>
</Project>
19 changes: 13 additions & 6 deletions packages/jsii-dotnet-jsonmodel/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ const package = require('./package.json');

process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
<ProjectUrl>${package.homepage}</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
<Authors>${package.author.name}</Authors>
<Company>${package.author.name}</Company>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<PackageId>Amazon.JSII.JsonModel</PackageId>
<Title>.NET JsonModel for JSII</Title>
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>

<ItemGroup>
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
</ItemGroup>
</Project>
19 changes: 13 additions & 6 deletions packages/jsii-dotnet-runtime/NuGet.Metadata.props.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ const package = require('./package.json');

process.stdout.write(`<Project>
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<PackageVersion>$(JsiiVersion)</PackageVersion>
<Description>${package.description}</Description>
<PackageLicenseExpression>${package.license}</PackageLicenseExpression>
<ProjectUrl>${package.homepage}</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/${package.license}.html</LicenseUrl>
<RepositoryUrl>${package.repository.url}</RepositoryUrl>
<RepositoryType>${package.repository.type || 'git'}</RepositoryType>
<Authors>${package.author.name}</Authors>
<Company>${package.author.name}</Company>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSource>True</IncludeSource>
<PackageOutputPath>..\\..\\bin\\$(Configuration)\\NuGet\\</PackageOutputPath>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<SignAssembly Condition="Exists('$(AssemblyOriginatorKeyFile)')">True</SignAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<PackageId>Amazon.JSII.Runtime</PackageId>
<Title>.NET Runtime for JSII</Title>
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,5 +20,6 @@
<EmbeddedResource Include="jsii-runtime\jsii-runtime.js" />
<EmbeddedResource Include="jsii-runtime\jsii-runtime.js.map" />
<EmbeddedResource Include="jsii-runtime\mappings.wasm" />
<None Include="../../../../logo/png/128x128.png" Pack="true" PackagePath="icon.png" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
var runtimePath = Environment.GetEnvironmentVariable(JsiiRuntime);
if (string.IsNullOrWhiteSpace(runtimePath))
runtimePath = jsiiRuntimeProvider.JsiiRuntimePath;

_process = new Process
{
StartInfo = new ProcessStartInfo
Expand All @@ -38,9 +38,9 @@ public NodeProcess(IJsiiRuntimeProvider jsiiRuntimeProvider, ILoggerFactory logg
};

var assemblyVersion = GetAssemblyFileVersion();
_process.StartInfo.EnvironmentVariables.Add(JsiiAgent,
_process.StartInfo.EnvironmentVariables.Add(JsiiAgent,
string.Format(JsiiAgentVersionString, Environment.Version, assemblyVersion.Item1, assemblyVersion.Item2));

var debug = Environment.GetEnvironmentVariable(JsiiDebug);
if (!string.IsNullOrWhiteSpace(debug) && !_process.StartInfo.EnvironmentVariables.ContainsKey(JsiiDebug))
_process.StartInfo.EnvironmentVariables.Add(JsiiDebug, debug);
Expand All @@ -64,13 +64,13 @@ void IDisposable.Dispose()
StandardError.Dispose();
_process.Dispose();
}

/// <summary>
/// Gets the target framework attribute value and
/// the assembly file version for the current .NET assembly
/// </summary>
/// <returns>A tuple where Item1 is the target framework
/// ie .NETStandard,Version=v2.0
/// ie .NETCoreApp,Version=v2.1
/// and item2 is the assembly file version (ie 1.0.0.0)</returns>
private Tuple<string, string> GetAssemblyFileVersion()
{
Expand All @@ -83,4 +83,4 @@ private Tuple<string, string> GetAssemblyFileVersion()
);
}
}
}
}
4 changes: 3 additions & 1 deletion packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export class FileGenerator {
propertyGroup.ele('PackageId', packageId);
propertyGroup.ele('Description', this.getDescription());
propertyGroup.ele('ProjectUrl', assembly.homepage);
propertyGroup.ele('LicenseUrl', `https://spdx.org/licenses/${assembly.license}.html`);
propertyGroup.ele('RepositoryUrl', assembly.repository.url);
propertyGroup.ele('RepositoryType', assembly.repository.type);
propertyGroup.ele('PackageLicenseExpression', assembly.license);
propertyGroup.ele('Authors', assembly.author.name);
propertyGroup.ele('Language', 'en-US');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<PackageId>Amazon.JSII.Tests.CalculatorPackageId.BasePackageId</PackageId>
<Description>An example direct dependency for jsii-calc.</Description>
<ProjectUrl>https://github.com/aws/jsii</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/Apache-2.0.html</LicenseUrl>
<RepositoryUrl>https://github.com/aws/jsii.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Authors>Amazon Web Services</Authors>
<Language>en-US</Language>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<PackageId>Amazon.JSII.Tests.CalculatorPackageId.LibPackageId</PackageId>
<Description>A simple calcuator library built on JSII. (Stability: Deprecated)</Description>
<ProjectUrl>https://github.com/aws/jsii</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/Apache-2.0.html</LicenseUrl>
<RepositoryUrl>https://github.com/aws/jsii.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Authors>Amazon Web Services</Authors>
<Language>en-US</Language>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<PackageId>Amazon.JSII.Tests.CalculatorPackageId</PackageId>
<Description>A simple calcuator built on JSII. (Stability: Experimental)</Description>
<ProjectUrl>https://github.com/aws/jsii</ProjectUrl>
<LicenseUrl>https://spdx.org/licenses/Apache-2.0.html</LicenseUrl>
<RepositoryUrl>https://github.com/aws/jsii.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Authors>Amazon Web Services</Authors>
<Language>en-US</Language>
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-ruby-runtime/project/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
jsii_runtime (0.18.0)
jsii_runtime (0.19.0)

GEM
remote: https://rubygems.org/
Expand Down
29 changes: 21 additions & 8 deletions superchain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
FROM amazonlinux:2

# Install deltarpm as it can speed up the upgrade processes
RUN yum -y install deltarpm

# Install .NET Core, mono & PowerShell
ENV DOTNET_CLI_TELEMETRY_OPTOUT=true \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
DOTNET_RUNNING_IN_CONTAINER=true \
DOTNET_USE_POLLING_FILE_WATCHER=true \
NUGET_XMLDOC_MODE=skip
COPY gpg/mono.asc /tmp/mono.asc
RUN rpm --import "https://packages.microsoft.com/keys/microsoft.asc" \
&& rpm -Uvh "https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm" \
&& rpm --import /tmp/mono.asc && rm -f /tmp/mono.asc \
&& curl "https://download.mono-project.com/repo/centos6-stable.repo" | tee /etc/yum.repos.d/mono-centos6-stable.repo \
&& yum -y install dotnet-sdk-2.2 mono-devel powershell \
&& yum clean all && rm -rf /var/cache/yum
&& yum -y install dotnet-sdk-3.0 dotnet-sdk-2.2 mono-devel powershell \
&& yum clean all && rm -rf /var/cache/yum \
&& dotnet help

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

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

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

# Install NVM and Node 8+
ARG NODE_VERSION=8.16.0
ARG NPM_VERSION=6.8.0
ARG NODE_VERSION=12.12.0
ARG NPM_VERSION=6.12.0
ENV NVM_DIR=/usr/local/nvm
RUN curl -sSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh -o /tmp/install-nvm.sh \
&& echo "ef7ad1db40c92f348c0461f24983b71ba0ea7d45d4007a36e484270fa7f81fcf /tmp/install-nvm.sh" | sha256sum -c \
Expand Down Expand Up @@ -71,7 +84,7 @@ ARG BUILD_TIMESTAMP
ARG COMMIT_ID
LABEL org.opencontainers.image.created=${BUILD_TIMESTAMP} \
org.opencontainers.image.title="jsii/superchain" \
org.opencontainers.image.description="An image to build cross-language artifacts with AWS JSII" \
org.opencontainers.image.description="An image to build cross-language artifacts with AWS jsii" \
org.opencontainers.image.url="https://github.com/aws/jsii/tree/master/superchain" \
org.opencontainers.image.source="https://github.com/aws/jsii.git" \
org.opencontainers.image.revision=$COMMIT_ID
Expand Down
5 changes: 3 additions & 2 deletions superchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ required in order to package [jsii] projects in all supported languages.
SDK | Version
----------------|-------------------------------------------
`OpenJDK 8` | Amazon Corretto `>= 8.222.10.2`
`.NET Core` | `>= 2.2.301` and `mono >= 6.0.0.319`
`Javascript` | `node >= 8.16.0` with `npm >= 6.8.0`
`.NET SDK` | `>= 3.0.100` and `>= 2.2.402`
`mono` | `>= 6.0.0.319`
`Javascript` | `node >= 12.12.0` with `npm >= 6.12.0`
`PowerShell` | `pwsh >= 6.2.2`
`Python 3` | `python3 >= 3.7.3` with `pip3 >= 19.1.1`
`Ruby` | `ruby >= 2.4.4p296`
Expand Down

0 comments on commit 5e076cf

Please sign in to comment.