From 105fe3e90cd56ffdbe391b46686c4567fa00e60b Mon Sep 17 00:00:00 2001 From: Talen Fisher Date: Thu, 18 Aug 2022 13:57:10 -0500 Subject: [PATCH] LAMBJ-152 Package Version Attribute (#554) Adds a package version attribute to assemblies called LambdajectionVersion --- .github/releases/v0.10.0-beta2.md | 3 +++ Directory.Build.props | 10 ++++++++ src/Encryption/Encryption.csproj | 2 +- .../LambdajectionVersionAttribute.cs | 25 +++++++++++++++++++ src/Generator/Generator.csproj | 1 + src/Runtime/Runtime.csproj | 1 + src/Templates/Templates.csproj | 1 + src/Tracing/Tracing.csproj | 1 + 8 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/Framework/LambdajectionVersionAttribute.cs diff --git a/.github/releases/v0.10.0-beta2.md b/.github/releases/v0.10.0-beta2.md index e69de29b..212662b6 100644 --- a/.github/releases/v0.10.0-beta2.md +++ b/.github/releases/v0.10.0-beta2.md @@ -0,0 +1,3 @@ +## Enhancements + +- Adds an attribute to each Lambdajection assembly called `LambdajectionVersion` which can be used to retrieve the NuGet Package Version of Lambdajection being used. \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index e70bcfd4..963ee595 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -48,4 +48,14 @@ + + + + + + + <_Parameter1>$(NuGetPackageVersion) + + + \ No newline at end of file diff --git a/src/Encryption/Encryption.csproj b/src/Encryption/Encryption.csproj index 765fa23b..b3e9d812 100644 --- a/src/Encryption/Encryption.csproj +++ b/src/Encryption/Encryption.csproj @@ -21,4 +21,4 @@ - + \ No newline at end of file diff --git a/src/Framework/LambdajectionVersionAttribute.cs b/src/Framework/LambdajectionVersionAttribute.cs new file mode 100644 index 00000000..7655988f --- /dev/null +++ b/src/Framework/LambdajectionVersionAttribute.cs @@ -0,0 +1,25 @@ +using System; + +namespace Lambdajection.Framework +{ + /// + /// Attribute for annotating assemblies with the lambdajection package version. + /// + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] + public class LambdajectionVersionAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// Version of the lambdajection package. + public LambdajectionVersionAttribute(string version) + { + Version = version; + } + + /// + /// Gets the version of the Lambdajection package. + /// + public string Version { get; } + } +} diff --git a/src/Generator/Generator.csproj b/src/Generator/Generator.csproj index c5703334..9316036f 100644 --- a/src/Generator/Generator.csproj +++ b/src/Generator/Generator.csproj @@ -11,6 +11,7 @@ NU5118;CS8618;NU5128;CS1591;CA1062 analyzers/dotnet/cs true + true Includes the compile-time generator used to generate code needed for Dependency Injection-enabled AWS Lambdas. IncludeExtraPackItems diff --git a/src/Runtime/Runtime.csproj b/src/Runtime/Runtime.csproj index 82a3acbe..c22f70c9 100644 --- a/src/Runtime/Runtime.csproj +++ b/src/Runtime/Runtime.csproj @@ -5,6 +5,7 @@ Lambdajection.Runtime $(PackageId) NU5128 + true Sets Lambdajection projects up to support custom runtimes. diff --git a/src/Templates/Templates.csproj b/src/Templates/Templates.csproj index 5efb9e84..8b551f61 100644 --- a/src/Templates/Templates.csproj +++ b/src/Templates/Templates.csproj @@ -10,6 +10,7 @@ true Includes templates for creating Lambdajection projects and components. CopyTemplates;PrepareTemplates + true diff --git a/src/Tracing/Tracing.csproj b/src/Tracing/Tracing.csproj index da2f989b..2fd3429f 100644 --- a/src/Tracing/Tracing.csproj +++ b/src/Tracing/Tracing.csproj @@ -5,6 +5,7 @@ $(PackageId) NU5128 false + true Adds X-Ray Tracing Support to Lambdajection.