Skip to content

Commit

Permalink
TNT-40905 Retrieve SDK version directly from assembly (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
XDex authored May 7, 2021
1 parent 213753f commit a99e09c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Source/Adobe.Target.Client/Util/TargetConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
*/
namespace Adobe.Target.Client.Util
{
using System.Reflection;

/// <summary>
/// Target Constants
/// </summary>
public static class TargetConstants
{
/// <summary>
/// SDK Version
/// </summary>
public const string SdkVersion = "1.0.2";

/// <summary>
/// Mbox cookie name
/// </summary>
Expand Down Expand Up @@ -60,9 +57,19 @@ public static class TargetConstants
/// </summary>
public const string DefaultSdidConsumerId = "target-global-mbox";

/// <summary>
/// SDK Version
/// </summary>
public static readonly string SdkVersion = Assembly.GetEntryAssembly()
!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
!.InformationalVersion;

internal const string SdkNameHeader = "X-EXC-SDK";

internal const string SdkNameValue = "AdobeTargetNet";

internal const string SdkVersionHeader = "X-EXC-SDK-Version";

internal static readonly string SdkUserAgent = $"{SdkNameValue}/{SdkVersion}";
}
}

0 comments on commit a99e09c

Please sign in to comment.