Skip to content

Commit

Permalink
Moving the git version attribute for NuGet
Browse files Browse the repository at this point in the history
  • Loading branch information
blackspherefollower authored and qdot committed Sep 4, 2017
1 parent b3c5e4b commit dd6b6f5
Show file tree
Hide file tree
Showing 33 changed files with 139 additions and 46 deletions.
@@ -1,4 +1,5 @@
using System.Reflection;
using Buttplug.Core;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -54,3 +55,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
Expand Up @@ -43,5 +43,11 @@
<Compile Include="ButtplugGameVibrationRouterInterface.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Buttplug.Core\Buttplug.Core.csproj">
<Project>{FC4AF8FE-8C21-4E07-8D24-7FB7791149D0}</Project>
<Name>Buttplug.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,4 +1,5 @@
using System.Reflection;
using Buttplug.Core;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -35,3 +36,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
Expand Up @@ -54,6 +54,10 @@
<Project>{0d0dc1a1-bfb6-4b97-88c6-7fb7a31533dc}</Project>
<Name>Buttplug.Apps.GameVibrationRouter.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\Buttplug.Core\Buttplug.Core.csproj">
<Project>{FC4AF8FE-8C21-4E07-8D24-7FB7791149D0}</Project>
<Name>Buttplug.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="EasyHook32.dll">
Expand Down
@@ -1,4 +1,5 @@
using System.Reflection;
using Buttplug.Core;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -35,3 +36,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
Expand Up @@ -72,6 +72,10 @@
<Project>{76e03b47-dca6-49d1-99c2-2ea28d3a8e78}</Project>
<Name>Buttplug.Apps.KiirooEmulatorGUI</Name>
</ProjectReference>
<ProjectReference Include="..\Buttplug.Core\Buttplug.Core.csproj">
<Project>{FC4AF8FE-8C21-4E07-8D24-7FB7791149D0}</Project>
<Name>Buttplug.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
Expand Down
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -33,4 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
12 changes: 6 additions & 6 deletions Buttplug.Apps.KiirooEmulatorGUI/MainWindow.xaml.cs
@@ -1,15 +1,15 @@
using Buttplug.Components.Controls;
using Buttplug.Components.KiirooPlatformEmulator;
using Buttplug.Core.Messages;
using Buttplug.Server;
using JetBrains.Annotations;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Threading;
using Buttplug.Components.Controls;
using Buttplug.Components.KiirooPlatformEmulator;
using Buttplug.Core.Messages;
using Buttplug.Server;
using JetBrains.Annotations;

namespace Buttplug.Apps.KiirooEmulatorGUI
{
Expand Down
5 changes: 3 additions & 2 deletions Buttplug.Apps.KiirooEmulatorGUI/Properties/AssemblyInfo.cs
@@ -1,4 +1,5 @@
// <auto-generated />
// <auto-generated />
using Buttplug.Core;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
Expand Down Expand Up @@ -50,5 +51,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[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-dev")]
[assembly: AssemblyGitVersion("")]
Expand Up @@ -72,6 +72,10 @@
<Project>{f1dee23b-7608-4ad6-b894-ed5e1eda65d1}</Project>
<Name>Buttplug.Apps.WebsocketServerGUI</Name>
</ProjectReference>
<ProjectReference Include="..\Buttplug.Core\Buttplug.Core.csproj">
<Project>{FC4AF8FE-8C21-4E07-8D24-7FB7791149D0}</Project>
<Name>Buttplug.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
Expand Down
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -33,4 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
6 changes: 4 additions & 2 deletions Buttplug.Apps.WebsocketServerGUI/Properties/AssemblyInfo.cs
@@ -1,4 +1,5 @@
// <auto-generated />
// <auto-generated />
using Buttplug.Core;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
Expand Down Expand Up @@ -52,4 +53,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
4 changes: 3 additions & 1 deletion Buttplug.Client.Test/Properties/AssemblyInfo.cs
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -33,4 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
4 changes: 3 additions & 1 deletion Buttplug.Client/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -35,7 +36,8 @@
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]

// Let test project see internals
[assembly: InternalsVisibleTo("Buttplug.Client.Test")]
[assembly: InternalsVisibleTo("Buttplug.Server.Test")]
[assembly: InternalsVisibleTo("Buttplug.Server.Test")]
3 changes: 2 additions & 1 deletion Buttplug.Components.Controls/ButtplugAboutControl.xaml
Expand Up @@ -8,7 +8,8 @@
<Grid Background="#FFE5E5E5">
<Image Name="IconImage" Source="pack://application:,,,/Buttplug.Components.Controls;component/Resources/buttplug-logo-1.png" HorizontalAlignment="Left" Height="128" Margin="10,10,0,0" VerticalAlignment="Top" Width="128" MouseDown="IconImage_Click"/>
<TextBlock HorizontalAlignment="Left" Margin="143,10,0,0" VerticalAlignment="Top" Height="128" Width="360">
<Span FontSize="19" FontWeight="Bold">Buttplug <Run Name="AboutVersionNumber">1.0.0.0-ffffffff</Run> (C# Edition)</Span><LineBreak />
<Span FontSize="19" FontWeight="Bold">Buttplug <Run Name="AboutVersionNumber">1.0.0.0-branch</Run> (C# Edition)</Span><LineBreak />
<Span FontSize="19"><Run Name="AboutGitVersion">0123456789abcdef0123456789abcdef01234567</Run></Span><LineBreak />
By <Hyperlink NavigateUri="https://metafetish.com" RequestNavigate="Hyperlink_RequestNavigate">Metafetish</Hyperlink><LineBreak />
<LineBreak/>
Software updates at <Hyperlink NavigateUri="https://github.com/metafetish" RequestNavigate="Hyperlink_RequestNavigate">https://buttplug.io/</Hyperlink><LineBreak/>
Expand Down
19 changes: 11 additions & 8 deletions Buttplug.Components.Controls/ButtplugAboutControl.xaml.cs
Expand Up @@ -2,6 +2,7 @@
using System.Reflection;
using System.Windows;
using System.Windows.Input;
using Buttplug.Core;

namespace Buttplug.Components.Controls
{
Expand Down Expand Up @@ -32,24 +33,26 @@ public void InitializeVersion()
}

// 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;
}
}

AboutGitVersion.Text = string.Empty;
var attribute = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyGitVersion), false)[0];
if (attribute != null && ((AssemblyGitVersion)attribute).Value.Length > 0)
{
_gitHash = ((AssemblyGitVersion)attribute).Value;
AboutGitVersion.Text = _gitHash;
AboutGitVersion.MouseDown += GithubRequestNavigate;
}
}

public string GetAboutVersion()
{
return AboutVersionNumber.Text;
return AboutVersionNumber.Text + " " + _gitHash;
}

private void GithubRequestNavigate(object aObj, MouseButtonEventArgs aEvent)
Expand Down
6 changes: 3 additions & 3 deletions Buttplug.Components.Controls/ButtplugDeviceControl.xaml.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand All @@ -9,8 +11,6 @@
using Buttplug.Core.Messages;
using Buttplug.Server;
using JetBrains.Annotations;
using System.ComponentModel;
using System.Collections.Specialized;

namespace Buttplug.Components.Controls
{
Expand Down Expand Up @@ -149,4 +149,4 @@ private async void ScanButton_Click(object aSender, RoutedEventArgs aEvent)
ScanButton.Click += ScanButton_Click;
}
}
}
}
4 changes: 3 additions & 1 deletion Buttplug.Components.Controls/Properties/AssemblyInfo.cs
@@ -1,4 +1,5 @@
// <auto-generated />
// <auto-generated />
using Buttplug.Core;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
Expand Down Expand Up @@ -53,3 +54,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
Expand Up @@ -57,5 +57,11 @@
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Buttplug.Core\Buttplug.Core.csproj">
<Project>{FC4AF8FE-8C21-4E07-8D24-7FB7791149D0}</Project>
<Name>Buttplug.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -33,4 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -33,4 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]
24 changes: 24 additions & 0 deletions Buttplug.Core/AssemblyGitVersion.cs
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Buttplug.Core
{
[AttributeUsage(AttributeTargets.Assembly)]
public class AssemblyGitVersion : Attribute
{
public string Value { get; private set; }

public AssemblyGitVersion()
{
Value = string.Empty;
}

public AssemblyGitVersion(string value)
{
Value = value;
}
}
}
1 change: 1 addition & 0 deletions Buttplug.Core/Buttplug.Core.csproj
Expand Up @@ -58,6 +58,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="App_Packages\LibLog.4.2\LibLog.cs" />
<Compile Include="AssemblyGitVersion.cs" />
<Compile Include="ButtplugConsts.cs" />
<Compile Include="ButtplugDeviceMessage.cs" />
<Compile Include="ButtplugJsonMessageParser.cs" />
Expand Down
4 changes: 2 additions & 2 deletions Buttplug.Core/IButtplugLog.cs
@@ -1,6 +1,6 @@
using Buttplug.Core.Messages;
using System;
using Buttplug.Core.Messages;
using JetBrains.Annotations;
using System;
using static Buttplug.Core.Messages.Error;

namespace Buttplug.Core
Expand Down
4 changes: 3 additions & 1 deletion Buttplug.Core/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Buttplug.Core;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -35,6 +36,7 @@
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
[assembly: AssemblyGitVersion("")]

// Let test project see internals
[assembly: InternalsVisibleTo("Buttplug.Client.Test")]
Expand Down

0 comments on commit dd6b6f5

Please sign in to comment.