Skip to content

Commit

Permalink
chore(release): 1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Elad Ben-Israel authored Mar 3, 2021
2 parents 5dc9a0b + aa0da6f commit b722f66
Show file tree
Hide file tree
Showing 121 changed files with 7,275 additions and 3,560 deletions.
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ updates:
- dependencies
- language/python

- package-ecosystem: gomod
directory: '/packages/@jsii/go-runtime'
schedule:
interval: daily
labels:
- dependencies
- language/go
ignore:
- dependency-name: github.com/aws/jsii-runtime-go
- dependency-name: github.com/aws/jsii-runtime-go/*
- dependency-name: github.com/aws/jsii/jsii-calc/go/*

- package-ecosystem: gomod
directory: '/packages/@jsii/go-runtime/jsii-runtime-go'
schedule:
interval: daily
labels:
- dependencies
- language/go
ignore:
- dependency-name: github.com/aws/jsii-runtime-go
- dependency-name: github.com/aws/jsii-runtime-go/*
- dependency-name: github.com/aws/jsii/jsii-calc/go/*

- package-ecosystem: github-actions
directory: '/'
schedule:
Expand Down
3 changes: 0 additions & 3 deletions .mergify/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pull_request_rules:
- '#approved-reviews-by>=1'
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success~=AWS CodeBuild us-east-1
- status-success=Semantic Pull Request
# Docker image validation
- status-success=jsii/superchain
Expand Down Expand Up @@ -80,7 +79,6 @@ pull_request_rules:
- '#approved-reviews-by>=1'
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success~=AWS CodeBuild us-east-1
- status-success=Semantic Pull Request
# Docker image validation
- status-success=jsii/superchain
Expand Down Expand Up @@ -132,7 +130,6 @@ pull_request_rules:
- '#approved-reviews-by>=1'
- '#review-requested=0'
- '#changes-requested-reviews-by=0'
- status-success~=AWS CodeBuild us-east-1
- status-success=Semantic Pull Request
# Docker image validation
- status-success=jsii/superchain
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.24.0](https://github.com/aws/jsii/compare/v1.23.0...v1.24.0) (2021-03-03)


### Features

* **go:** support direct implementation of jsii interfaces ([#2614](https://github.com/aws/jsii/issues/2614)) ([9da3282](https://github.com/aws/jsii/commit/9da32821676a9ed7ea6cd4744c06df4fb3551bc7)), closes [#2048](https://github.com/aws/jsii/issues/2048)


### Bug Fixes

* **go:** enums inside structs are not properly serialized ([#2636](https://github.com/aws/jsii/issues/2636)) ([19cbd25](https://github.com/aws/jsii/commit/19cbd2532e6210f034e12299c5c1b00807a91b90))
* **go:** invalid generated code for classes a keyword name ([#2641](https://github.com/aws/jsii/issues/2641)) ([8668f13](https://github.com/aws/jsii/commit/8668f13d7b74b3f2fecc0b02d241a1a6f9e2f648)), closes [#2637](https://github.com/aws/jsii/issues/2637)
* **go:** malformed multiline docstrings in constructors ([#2639](https://github.com/aws/jsii/issues/2639)) ([72f25af](https://github.com/aws/jsii/commit/72f25af24c47075d6faa3b624236dd0375e3acdb)), closes [#2638](https://github.com/aws/jsii/issues/2638)

## [1.23.0](https://github.com/aws/jsii/compare/v1.22.0...v1.23.0) (2021-03-01)

### Features
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdocs~=1.1.2
mkdocs-awesome-pages-plugin~=2.5.0
mkdocs-material~=6.2.8
mkdocs-material~=7.0.3
mkdocs-git-revision-date-plugin~=0.3.1
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"rejectCycles": true
}
},
"version": "1.23.0"
"version": "1.24.0"
}
2 changes: 1 addition & 1 deletion packages/@jsii/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" />
<PackageReference Update="Microsoft.CodeQuality.Analyzers" Version="3.3.2" />

<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Update="NSubstitute" Version="4.2.2" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<IsPackable>false</IsPackable>

<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>

<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System;

[assembly:CLSCompliant(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public bool Equals(DiagnosticResultLocation other)

public override int GetHashCode()
{
return Path.GetHashCode()
return Path.GetHashCode(StringComparison.InvariantCulture)
^ Line.GetHashCode()
^ Column.GetHashCode();
}
Expand All @@ -70,13 +70,13 @@ public override int GetHashCode()
/// </summary>
public struct DiagnosticResult : IEquatable<DiagnosticResult>
{
private IReadOnlyList<DiagnosticResultLocation> _locations;
private IReadOnlyList<DiagnosticResultLocation>? _locations;

public IReadOnlyList<DiagnosticResultLocation> Locations
{
get
{
_locations ??= new DiagnosticResultLocation[] { };
_locations ??= Array.Empty<DiagnosticResultLocation>();
return _locations;
}

Expand Down Expand Up @@ -108,10 +108,10 @@ public override bool Equals(object? obj)
public override int GetHashCode()
{
return Locations.GetHashCode()
^ Id.GetHashCode()
^ Id.GetHashCode(StringComparison.InvariantCulture)
^ Severity.GetHashCode()
^ Message.GetHashCode()
^ Path.GetHashCode()
^ Message.GetHashCode(StringComparison.InvariantCulture)
^ Path.GetHashCode(StringComparison.InvariantCulture)
^ Line.GetHashCode()
^ Column.GetHashCode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,28 @@ private static Project CreateProject(string[] sources, string language = Languag

var projectId = ProjectId.CreateNewId(debugName: TestProjectName);

var solution = new AdhocWorkspace()
using var workspace = new AdhocWorkspace();
var solution = workspace
.CurrentSolution
.AddProject(projectId, TestProjectName, TestProjectName, language)
.AddMetadataReference(projectId, CorlibReference)
.AddMetadataReference(projectId, SystemCoreReference)
.AddMetadataReference(projectId, CSharpSymbolsReference)
.AddMetadataReference(projectId, CodeAnalysisReference);

int count = 0;
foreach (var source in sources)
{
var newFileName = fileNamePrefix + count + "." + fileExt;
var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
solution = solution.AddDocument(documentId, newFileName, SourceText.From(source));
count++;
int count = 0;
foreach (var source in sources)
{
var newFileName = fileNamePrefix + count + "." + fileExt;
var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
solution = solution.AddDocument(documentId, newFileName, SourceText.From(source));
count++;
}

return solution.GetProject(projectId)!;
}
return solution.GetProject(projectId)!;
}

#endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using System.Linq;
Expand Down Expand Up @@ -87,7 +88,7 @@ private static void VerifyDiagnosticResults(Diagnostic[] actualResults, Diagnost
}
else
{
VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First());
VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations[0]);
var additionalLocations = actual.AdditionalLocations.ToArray();

if (additionalLocations.Length != expected.Locations.Count - 1)
Expand Down Expand Up @@ -133,7 +134,7 @@ private static void VerifyDiagnosticLocation(DiagnosticAnalyzer? analyzer, Diagn
{
var actualSpan = actual.GetLineSpan();

Assert.True(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.") && expected.Path.Contains("Test.")),
Assert.True(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.", StringComparison.InvariantCulture) && expected.Path.Contains("Test.", StringComparison.InvariantCulture)),
$"Expected diagnostic to be in file \"{expected.Path}\" was actually in file \"{actualSpan.Path}\"\r\n\r\nDiagnostic:\r\n {FormatDiagnostics(analyzer, diagnostic)}\r\n");

var actualLinePosition = actualSpan.StartLinePosition;
Expand Down Expand Up @@ -187,18 +188,18 @@ private static string FormatDiagnostics(DiagnosticAnalyzer? analyzer, params Dia
var location = diagnostics[i].Location;
if (location == Location.None)
{
builder.AppendFormat("GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id);
builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id);
}
else
{
Assert.True(location.IsInSource,
$"Test base does not currently handle diagnostics in metadata locations. Diagnostic in metadata: {diagnostics[i]}\r\n");

var fileIsCSharp = diagnostics[i].Location.SourceTree?.FilePath.EndsWith(".cs") ?? false;
var fileIsCSharp = diagnostics[i].Location.SourceTree?.FilePath.EndsWith(".cs", StringComparison.InvariantCulture) ?? false;
var resultMethodName = fileIsCSharp ? "GetCSharpResultAt" : "GetBasicResultAt";
var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition;

builder.AppendFormat("{0}({1}, {2}, {3}.{4})",
builder.AppendFormat(CultureInfo.InvariantCulture, "{0}({1}, {2}, {3}.{4})",
resultMethodName,
linePosition.Line + 1,
linePosition.Character + 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System;

[assembly:CLSCompliant(true)]
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.Runtime.CompilerServices;

[assembly:CLSCompliant(true)]

// All the types were folded into Amazon.JSII.Runtime now, so here's a bunch of type
// forwarders to maintain backwards compatibility with previous versions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<RollForward>Major</RollForward>

<NoWarn>
CA1034, <!-- Nested types should not be visible -->
CA1711, <!-- Identifiers should not have incorrect suffix -->
CA1724, <!-- Type names should not match namespaces -->
</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System.Runtime.CompilerServices;
using System;
using System.Runtime.CompilerServices;
using Castle.Core.Internal;
using Xunit;

[assembly:CLSCompliant(false)]

// Each test in this assembly overrides the the global service provider, so they can't be run in parallel.
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Amazon.JSII.JsonModel.Api;
using System;
using Amazon.JSII.JsonModel.Api;
using Amazon.JSII.JsonModel.Api.Request;
using Amazon.JSII.JsonModel.Api.Response;
using Amazon.JSII.JsonModel.FileSystem;
Expand Down Expand Up @@ -45,8 +46,8 @@ protected ClientTestBase()
_fileSystem.Directory.Returns(directory);
}

internal string GetOkResponse<TResponse>(TResponse response)
where TResponse : IKernelResponse
internal static string GetOkResponse<TResponse>(TResponse response)
where TResponse : class, IKernelResponse
{
IDictionary<string, object> okResponse = new Dictionary<string, object>
{
Expand All @@ -69,7 +70,7 @@ internal IClient CreateClient()
);
}

internal bool PlatformIndependentEqual(string expected, string actual)
internal static bool PlatformIndependentEqual(string expected, string actual)
{
try
{
Expand Down Expand Up @@ -99,7 +100,7 @@ public void LoadsBasicPackage()
description: "",
homepage: "",
repository: new Assembly.AssemblyRepository(type: "", url: ""),
author: new Person(name: "", roles: new string[]{ }),
author: new Person(name: "", roles: Array.Empty<string>()),
fingerprint: "",
license: "",
targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget(
Expand Down Expand Up @@ -132,7 +133,7 @@ public void DoesNotLoadPackageMultipleTimes()
description: "",
homepage: "",
repository: new Assembly.AssemblyRepository(type: "", url: ""),
author: new Person(name: "", roles: new string[] { }),
author: new Person(name: "", roles: Array.Empty<string>()),
fingerprint: "",
license: "",
targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget(
Expand Down Expand Up @@ -185,7 +186,7 @@ public void SendsAndReceives()
description: "",
homepage: "",
repository: new Assembly.AssemblyRepository(type: "", url: ""),
author: new Person(name: "", roles: new string[] { }),
author: new Person(name: "", roles: Array.Empty<string>()),
fingerprint: "",
license: "",
targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NSubstitute;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Newtonsoft.Json.Converters;
using Xunit;
Expand Down Expand Up @@ -122,7 +123,7 @@ public void ConvertsDateValues()

var expected = new JObject
{
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz"))
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture))
};

Assert.Equal(expected, actual);
Expand All @@ -144,7 +145,7 @@ public void ConvertsOptionalDateValues()
Assert.IsType<JObject>(actual);
var expected = new JObject
{
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz"))
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture))
};
Assert.Equal(expected, actual);

Expand Down Expand Up @@ -652,7 +653,7 @@ public void ConvertsDate()

var expected = new JObject
{
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz"))
new JProperty("$jsii.date", now.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz", CultureInfo.InvariantCulture))
};
Assert.Equal(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class TestBase
internal readonly IReferenceMap _referenceMap;
internal readonly JsiiToFrameworkConverter _converter;

public TestBase()
protected TestBase()
{
_typeCache = Substitute.For<ITypeCache>();
_referenceMap = Substitute.For<IReferenceMap>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public DeputyBaseTests()
.BuildServiceProvider();
}

void IDisposable.Dispose()
public void Dispose()
{
ServiceContainer.ServiceProviderOverride = null;
_serviceProvider.Dispose();
}

[Fact(DisplayName = Prefix + nameof(CanCastToAnyInterface))]
Expand Down
Loading

0 comments on commit b722f66

Please sign in to comment.