Skip to content

Commit

Permalink
Revert "Deprecate old version identification method"
Browse files Browse the repository at this point in the history
This reverts commit d7fddca
  • Loading branch information
MirisWisdom committed Jul 13, 2019
1 parent dcbfe92 commit e4ef151
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/AmaiSosu.GUI/AmaiSosu.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,14 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Messages.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>git describe --tags &gt; "$(ProjectDir)\Resources\Version.txt"</PreBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Fody.4.2.1\build\Fody.targets" Condition="Exists('..\packages\Fody.4.2.1\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
13 changes: 12 additions & 1 deletion src/AmaiSosu.GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ public sealed class Main : INotifyPropertyChanged
/// <summary>
/// Git version.
/// </summary>
public string Version => "build-0000";
public string Version
{
get
{
using (var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(FileNames.AmaiSosuVersion))
using (var reader = new StreamReader(stream ?? throw new FileNotFoundException()))
{
return reader.ReadToEnd().Trim();
}
}
}

/// <summary>
/// Installation path.
Expand Down
3 changes: 3 additions & 0 deletions src/AmaiSosu/AmaiSosu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>FileNames.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
1 change: 1 addition & 0 deletions src/AmaiSosu/Resources/Version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.3.1-7-gd4cfe3a

0 comments on commit e4ef151

Please sign in to comment.