Skip to content

Commit

Permalink
fix(init): remove automatic JSII Roslyn analyzer dependency (#4835)
Browse files Browse the repository at this point in the history
We want to automatically add a dependency on JSII's Roslyn analyzers
(in the "Amazon.JSII.Analyzers" package) for .NET users that run `cdk
init`.

However, right now the "JSII.Analyzers" package depends on
"JSII.Runtime", and so in order to end up with the right version of
"Runtime" in the set of dependencies, users must have the same version
of "Analyzers" in their project.

This means a couple of things:

- First off, when generating a project template, it's hard for the CDK
  CLI to know the JSII version libraries have been generated with. It needs
  to map a version number like `1.15.0` (CDK) to 0.19.0 (JSII).

- Right now we're using a "*" which causes issues as soon as a new JSII
  version is released.

- Even if we took a shot at the right JSII version (by recording the
  "current JSII" version at CLI build time), there is a window of
  inconsistency (between merging a new JSII and releasing CDK) where for
  'cdk init' for .NET is going to fail on developer workstations.

- If customers migrate to a newer CDK version, they must figure out the
  version of JSII and then manually update their Analyzers dependency
  to match.

Until we've figured out how to deal with this issue, we're taking out
the dependency.
  • Loading branch information
rix0rrr authored and mergify[bot] committed Nov 4, 2019
1 parent 957f047 commit 5029f0e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<PackageReference Include="Amazon.CDK.AWS.SNS" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SNS.Subscriptions" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SQS" Version="%cdk-version%-devpreview" />

<!-- Roslyn Analyzers for JSII libraries will provide compile-time errors about un-set required fields -->
<PackageReference Include="Amazon.JSII.Analyzers" Version="*" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<PackageReference Include="Amazon.CDK.AWS.SNS" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SNS.Subscriptions" Version="%cdk-version%-devpreview" />
<PackageReference Include="Amazon.CDK.AWS.SQS" Version="%cdk-version%-devpreview" />

<!-- Roslyn Analyzers for JSII libraries will provide compile-time errors about un-set required fields -->
<PackageReference Include="Amazon.JSII.Analyzers" Version="*" PrivateAssets="All" />
</ItemGroup>

</Project>

0 comments on commit 5029f0e

Please sign in to comment.