From bc004a8764b2426af2b85223370c3f18af90c3f4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 5 Mar 2020 16:49:03 -0700 Subject: [PATCH] Updates AssemblyInfo.cs files to include AssemblyInformationalVersion and resets default versions to 0.0.0.*. Updates assembly version script to accomodate changes --- PepperDashEssentials/ControlSystem.cs | 8 +++++--- .../Properties/AssemblyInfo.cs | 14 ++++++++------ .../Properties/UpdateAssemblyVersion.ps1 | 19 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 13 ++++++++----- .../Essentials_DM/Essentials_DM.csproj | 4 ++++ .../Essentials_DM/Properties/AssemblyInfo.cs | 13 ++++++++----- .../Properties/AssemblyInfo.cs | 13 ++++++++----- 7 files changed, 56 insertions(+), 28 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 62aee267..a88d932b 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -96,10 +96,12 @@ namespace PepperDash.Essentials string directoryPrefix; directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); - - var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build)); + var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false); + + AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute; + + Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion); if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS { diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index 83beada4..36e6828b 100644 --- a/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -1,8 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("PepperDashEssentials")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("PepperDashEssentials")] -[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] -[assembly: AssemblyVersion("1.4.0.*")] - +[assembly: System.Reflection.AssemblyTitle("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] diff --git a/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 b/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 index 46392b31..396b5cf0 100644 --- a/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 +++ b/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 @@ -1,13 +1,23 @@ function Update-SourceVersion { Param ([string]$Version) - $NewVersion = ‘AssemblyVersion("‘ + $Version + ‘.*")’; + $fullVersion = $Version + $baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value + $NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’ + echo "AssemblyVersion = $NewAssemblyVersion" + $NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’ + echo "AssemblyInformationalVersion = $NewAssemblyInformationalVersion" + foreach ($o in $input) - { + { Write-output $o.FullName $TmpFile = $o.FullName + “.tmp” get-content $o.FullName | - %{$_ -replace ‘AssemblyVersion\("(\d+\.\d+\.\d+)\.\*"\)’, $NewVersion } > $TmpFile + %{ + $_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion} | + %{ + $_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion + } > $TmpFile move-item $TmpFile $o.FullName -force } } @@ -21,9 +31,10 @@ function Update-AllAssemblyInfoFiles ( $version ) } # validate arguments -$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "^\d+\.\d+\.\d+$"); +$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*"); if ($r.Success) { + echo "Updating Assembly Version to $args ..."; Update-AllAssemblyInfoFiles $args[0]; } else diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs index f9464b7d..fc3f61d8 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("PepperDashEssentialsBase")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("PepperDashEssentialsBase")] -[assembly: AssemblyCopyright("Copyright © Ppperdash 2019")] -[assembly: AssemblyVersion("1.4.0.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("PepperDashEssentialsBase")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj index 6f31634d..f40cb869 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -82,6 +82,10 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe False + + False + ..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll + diff --git a/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs b/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs index d11fa984..1f506f3a 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("Essentials_DM")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("Essentials_DM")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyVersion("1.3.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("Essentials_DM")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs index 95a08a40..ccea4891 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using Crestron.SimplSharp.Reflection; -[assembly: AssemblyTitle("Essentials_Devices_Common")] -[assembly: AssemblyCompany("PepperDash Technology Corp")] -[assembly: AssemblyProduct("Essentials_Devices_Common")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyVersion("1.4.*")] \ No newline at end of file +[assembly: System.Reflection.AssemblyTitle("Essentials_Devices_Common")] +[assembly: System.Reflection.AssemblyCompany("PepperDash Technology Corp")] +[assembly: System.Reflection.AssemblyProduct("PepperDashEssentials")] +[assembly: System.Reflection.AssemblyCopyright("Copyright © PepperDash Technology Corp 2020")] +[assembly: System.Reflection.AssemblyVersion("0.0.0.*")] +[assembly: System.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] +[assembly: Crestron.SimplSharp.Reflection.AssemblyInformationalVersion("0.0.0-buildType-buildNumber")] \ No newline at end of file