Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactor and simplify Common dependency. #643

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
<Description>Powertools for AWS Lambda (.NET) - BatchProcessing package.</Description>
<AssemblyName>AWS.Lambda.Powertools.BatchProcessing</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.BatchProcessing</RootNamespace>
<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>
<ItemGroup>
<!-- Package versions are Centrally managed in Directory.Packages.props file -->
<!-- More info https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
<PackageReference Include="Amazon.Lambda.DynamoDBEvents" />
<PackageReference Include="Amazon.Lambda.KinesisEvents" />
<PackageReference Include="Amazon.Lambda.SQSEvents" />
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Powertools for AWS Lambda (.NET) - Idempotency package.</Description>
<AssemblyName>AWS.Lambda.Powertools.Idempotency</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.Idempotency</RootNamespace>
<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>


Expand All @@ -14,13 +15,19 @@
<!-- More info https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
<PackageReference Include="Amazon.Lambda.Core"/>
<PackageReference Include="AWSSDK.DynamoDBv2"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.JMESPath\AWS.Lambda.Powertools.JMESPath.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.JMESPath\AWS.Lambda.Powertools.JMESPath.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>

<!-- Include JMESPath files in projects that reference AWS.Lambda.Powertools.JMESPath -->
<!-- This is needed because of the way nuget expects dependencies to be nuget packages as well which is not what we want -->
<ItemGroup Condition="'$(Configuration)'=='Release'">

<ProjectReference Remove="..\AWS.Lambda.Powertools.JMESPath\AWS.Lambda.Powertools.JMESPath.csproj"/>

<Compile Include="..\AWS.Lambda.Powertools.JMESPath\**\*.cs">
<Link>JMESPath\%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
<Compile Remove="..\AWS.Lambda.Powertools.JMESPath\obj\**"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
<Description>Powertools for AWS Lambda (.NET) - Logging package.</Description>
<AssemblyName>AWS.Lambda.Powertools.Logging</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.Logging</RootNamespace>
<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>

<ItemGroup>
<!-- Package versions are Centrally managed in Directory.Packages.props file -->
<!-- More info https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
<PackageReference Include="Microsoft.Extensions.Logging" />
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<PackageReference Include="Microsoft.Extensions.Logging"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
<Description>Powertools for AWS Lambda (.NET) - Metrics package.</Description>
<AssemblyName>AWS.Lambda.Powertools.Metrics</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.Metrics</RootNamespace>
<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Description>Powertools for AWS Lambda (.NET) - Parameters package.</Description>
<AssemblyName>AWS.Lambda.Powertools.Parameters</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.Parameters</RootNamespace>
<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,10 +20,7 @@
<PackageReference Include="AWSSDK.SecretsManager" />
<PackageReference Include="AWSSDK.SimpleSystemsManagement" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<Description>Powertools for AWS Lambda (.NET) - Tracing package.</Description>
<AssemblyName>AWS.Lambda.Powertools.Tracing</AssemblyName>
<RootNamespace>AWS.Lambda.Powertools.Tracing</RootNamespace>

<IncludeCommonFiles>true</IncludeCommonFiles>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,10 +16,7 @@
<PackageReference Include="AWSSDK.XRay" />
<PackageReference Include="AWSXRayRecorder.Core" />
<PackageReference Include="AWSXRayRecorder.Handlers.AwsSdk" />
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj">
<Private>false</Private>
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj" Condition="'$(Configuration)'=='Debug'"/>
</ItemGroup>


Expand Down
22 changes: 17 additions & 5 deletions libraries/src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,23 @@
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="../../AWSLogo128x128.png" Pack="true" Visible="false" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="../../AWSLogo128x128.png" Pack="true" Visible="false" PackagePath=""/>
</ItemGroup>

<!-- Include Common files in projects that reference AWS.Lambda.Powertools.Common -->
<!-- This is needed because of the way nuget expects dependencies to be nuget packages as well which is not what we want -->
<ItemGroup Condition="'$(IncludeCommonFiles)' == 'true' AND '$(Configuration)'=='Release'">

<ProjectReference Remove="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj"/>
<PackageReference Include="AspectInjector"/>
<Compile Include="..\AWS.Lambda.Powertools.Common\**\*.cs">
<Link>Common\%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
<Compile Remove="..\AWS.Lambda.Powertools.Common\obj\**"/>
</ItemGroup>


</Project>
19 changes: 0 additions & 19 deletions libraries/src/Directory.Build.targets

This file was deleted.

Loading