1.7.0
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:
- AWS.Lambda.Powertools.Logging - 1.3.0
- AWS.Lambda.Powertools.Tracing - 1.3.0
- AWS.Lambda.Powertools.Metrics - 1.4.0
- AWS.Lambda.Powertools.Parameters - 1.1.0
- AWS.Lambda.Powertools.Idempotency - 0.2.0-preview
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
andDirectory.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:
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" />
- Copy/Link
- This transformation only happens in Release configuration
Once in Release
configuration or when running dotnet build -c Release
the Common folder is added to the project
Part 3 Central Package Management
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
In the csproj files of the projects the referenced packages will not have a version
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:
New:
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.
Changes
🌟New features and non-breaking changes
🔧 Maintenance
- chore: Disable dependabot.yml (#475) by @hjgraca
- chore: Update version release 1.7.0 (#464) by @hjgraca
- chore(deps): bump gitpython from 3.1.30 to 3.1.35 (#451) by @dependabot
- chore: update changelog with latest changes (#437) by @hjgraca
- chore: bump examples NuGet versions (#435) by @amirkaws