Skip to content

1.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 14 Sep 10:16
· 255 commits to refs/heads/develop since this release
fbecd23

Summary

In this release we are please to announce the removal of the Common dependency and Nuget package 馃帀 and introducing NuGet Central Package Management (i.e. with Directory.Packages.props).

All utilities updated:

Utilities have a dependency on the AWS.Lambda.Powertools.Common project.
When the utility is compiled and packaged into a nuget package the AWS.Lambda.Powertools.Common is a dependency.
This behaviour is causing Diamond dependency issues in the project.
To address this we copy the required files to each utility and make them completely isolated. This allows the client to not have to worry about dependencies between utilities and AWS.Lambda.Powertools.Common.
There is no need to delete the AWS.Lambda.Powertools.Common project but link the files in other projects, this will make it more readable in the solution explorer and makes maintenance easier because it's all in a single project.

TLDR

  • Add Directory.Build.props and Directory.Build.targets more info
    • These two files allows us to modify all csproj files in the solution or where the files are placed in the folder structure
    • Those files were added to the src folder. They modify all csproj in that folder where all utilities are. Search scope
  • Add Central Package Management more info
    • Dependency management is a core feature of NuGet. Managing dependencies for a single project can be easy. Managing dependencies for multi-project solutions can prove to be difficult as they start to scale in size and complexity. In situations where you manage common dependencies for many different projects, you can leverage NuGet's central package management (CPM) features to do all of this from the ease of a single location.
    • Add a file Directory.Packages.props to the src and test folders. This allows us to manage nuget package versions for all projects in a central location. I separated src and tests because tests have many dependencies and can cause confusion. Search scope info

Implementation

Part 1 Directory.Build.props

  • Use MSbuild to:
    • Manage all common properties across all projects
    • These properties can be overridden by the project if it wishes to do so
      image

Part 2 Directory.Build.targets (changes only happen in Release configuration)

  • Use MSbuild to:
    • Copy/Link AWS.Lambda.Powertools.Common *.cs files to the destination project
    • Remove depdendency of Common project by removing <ProjectReference Remove="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" />
    • Add PackageReference <PackageReference Include="AspectInjector" />
  • This transformation only happens in Release configuration

image

Once in Release configuration or when running dotnet build -c Release the Common folder is added to the project

image

Part 3 Central Package Management

Docs

Starting with NuGet 6.2, you can centrally manage your dependencies in your projects with the addition of a Directory.Packages.props file and an MSBuild property.

This means that the versions of the referenced packages will be defined in the central Directory.Packages.props file

File contents:
image

In the csproj files of the projects the referenced packages will not have a version

image

If needed individual projects can override the version

Part 4 Nuget package contents

The resulting Release package will have no AWS.Lambda.Powertools.Common reference and will include AspectInjector nuget package. This will make the utility completely independent from AWS.Lambda.Powertools.Common Nuget package at runtime

Old:

image

New:

image

Removed AWS.Lambda.Powertools.Common project reference from test projects.
This reference now comes from Directory.Build.props. This file was added to test folder.

Contents:
carbon (1)

Changes

馃専New features and non-breaking changes

  • chore: Remove dependency of AWS.Lambda.Powertools.Common on all Utilities (#340) by @hjgraca

馃敡 Maintenance

This release was made possible by the following contributors:

@hjgraca and @amirkaws