Permalink
Browse files

Adding more detail to the version info string

This now contains a reference to the commit the build is based on and the branch it originates from. I'd have prefered to be able to embed a note about whether or not the build was based on a PR, but that doesn't seem trivial.

Fixes #255
  • Loading branch information...
blackspherefollower authored and qdot committed Sep 3, 2017
1 parent cbc67e0 commit b3c5e4b76dd6798417496bc27fba70ef87e5810b
@@ -53,3 +53,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -34,3 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -34,3 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -51,4 +51,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Use informational version to store git hashes
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -52,4 +52,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -34,7 +34,7 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
// Let test project see internals
[assembly: InternalsVisibleTo("Buttplug.Client.Test")]
@@ -11,6 +11,7 @@ namespace Buttplug.Components.Controls
public partial class ButtplugAboutControl
{
private string _gitHash;
private string _buildType;
private uint _clickCounter;
public event EventHandler AboutImageClickedABunch;
@@ -23,12 +24,26 @@ public ButtplugAboutControl()
public void InitializeVersion()
{
AboutVersionNumber.Text = Assembly.GetEntryAssembly().GetName().Version.ToString();
_gitHash = System.Diagnostics.FileVersionInfo.GetVersionInfo(Application.ResourceAssembly.Location)
var longVer = System.Diagnostics.FileVersionInfo.GetVersionInfo(Application.ResourceAssembly.Location)
.ProductVersion;
if (_gitHash.Length > 0)
if (longVer.Length > 0)
{
AboutVersionNumber.Text += $"-{_gitHash.Substring(0, 8)}";
AboutVersionNumber.MouseDown += GithubRequestNavigate;
AboutVersionNumber.Text = longVer;
}
// AssemblyInformationalVersion("1.0.0.0-dev")
// version-type-hash
var pos = longVer.IndexOf('-');
if (pos > 0)
{
_buildType = longVer.Substring(pos);
pos = _buildType.IndexOf('-');
if (pos > 0)
{
_gitHash = _buildType.Substring(pos);
AboutVersionNumber.MouseDown += GithubRequestNavigate;
}
}
}
@@ -52,4 +52,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -34,7 +34,7 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
// Let test project see internals
[assembly: InternalsVisibleTo("Buttplug.Client.Test")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -33,4 +33,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
@@ -34,7 +34,7 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
// Let test project see internals
[assembly: InternalsVisibleTo("Buttplug.Client.Test")]
View
@@ -25,13 +25,13 @@ install:
function gitVersion() {
$env:newhash=git rev-parse HEAD
$env:shorthash=git rev-parse --short HEAD
If ($env:appveyor_repo_tag -eq $TRUE) {
$env:newVersion=$env:appveyor_repo_tag_name
$env:appveyor_info_version=$env:appveyor_repo_tag_name
If ($env:APPVEYOR_REPO_TAG -eq $TRUE) {
$env:newVersion=$env:APPVEYOR_REPO_TAG_NAME
$env:appveyor_info_version="$env:APPVEYOR_REPO_TAG_NAME-release-$env:APPVEYOR_REPO_COMMIT"
} Else {
$gitVersion=git describe --tags --abbrev=0 $env:APPVEYOR_REPO_BRANCH
$env:newVersion="$gitVersion.$env:APPVEYOR_BUILD_NUMBER"
$env:appveyor_info_version="$env:newVersion-alpha"
$env:appveyor_info_version="$env:newVersion-$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_REPO_COMMIT"
}
$env:appveyor_build_version="$env:newVersion"
appveyor UpdateBuild -Version "$env:newVersion"

0 comments on commit b3c5e4b

Please sign in to comment.