OpenKh
OpenKh copied to clipboard
About Dialog and contributors page
Basics of the proposal to remove my name from the tools and to build a proper contributor page to recognise people's work. This would respect the main concept behind OpenKH project.
The "About" dialog has been duplicated to OpenKh.Tools.Common
in order to be customised with brand and colours of OpenKH:
I also added a draft of docs/contributors/index.md
, which can give a vague idea on how that page would be structured.
This pull request is a draft. I think that every one of us should give their touch to it and reach something we all agree to.
Some ideas:
git describe
This technique is taken from pcsx2: https://github.com/PCSX2/pcsx2/search?q=git+describe
Git - Inspection and Comparison
git describe
to generate version number.
H:\Proj\OpenKh>git describe --tags
release-49-2-g83e82af
msbuild and assembly attributes
This technique is taken from https://stackoverflow.com/a/56940926
Sample impl: https://github.com/kenjiuno/OpenKh/commit/25b0da8f06b78881e0199f4d3e77e3f9c44d74e3
OpenKh.Tools.Common.csproj
Define property $(OpenKhAuthor)
and $(OpenKhPoweredBy)
.
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<OpenKhAuthor>All OpenKh developers</OpenKhAuthor>
<OpenKhPoweredBy>All OpenKh contributors</OpenKhPoweredBy>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenKh.Engine\OpenKh.Engine.csproj" />
<ProjectReference Include="..\OpenKh.Imaging\OpenKh.Imaging.csproj" />
<ProjectReference Include="..\OpenKh.Kh2\OpenKh.Kh2.csproj" />
<ProjectReference Include="..\XeEngine.Tools.Public\Xe.Tools.Wpf\Xe.Tools.Wpf.csproj" />
<ProjectReference Include="..\OpenKh.Kh2\OpenKh.Kh2.csproj" />
</ItemGroup>
<Import Project="OpenKh.VersioningHelper.targets" />
</Project>
$(OpenKhAuthor)
and $(OpenKhPoweredBy)
are written in OpenKh.Tools.Common\obj\Debug\netcoreapp3.1\SolutionInfo.cs
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: OpenKh.Tools.Common.Attributes.AuthorAttribute("All OpenKh developers")]
[assembly: OpenKh.Tools.Common.Attributes.PoweredByAttribute("All OpenKh contributors")]
[assembly: OpenKh.Tools.Common.Attributes.BuildVersionAttribute("release-49-2-g83e82af")]
// Generated by the MSBuild WriteCodeFragment class.
OpenKh.VersioningHelper.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SolutionInfoGenerator" BeforeTargets="CoreCompile" DependsOnTargets="PrepareForBuild">
<Exec Command="git describe --tags"
ConsoleToMSBuild="true"
IgnoreExitCode="true"
>
<Output TaskParameter="ConsoleOutput" PropertyName="GitDescribeOutput" />
</Exec>
<ItemGroup>
<AssemblyAttributes Include="OpenKh.Tools.Common.Attributes.AuthorAttribute">
<_Parameter1>$(OpenKhAuthor)</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="OpenKh.Tools.Common.Attributes.PoweredByAttribute">
<_Parameter1>$(OpenKhPoweredBy)</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="OpenKh.Tools.Common.Attributes.BuildVersionAttribute">
<_Parameter1>$(GitDescribeOutput)</_Parameter1>
</AssemblyAttributes>
</ItemGroup>
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttributes)" Language="C#" OutputDirectory="$(IntermediateOutputPath)" OutputFile="SolutionInfo.cs">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
</Project>
git describe
is used in msbuild Exec task: https://docs.microsoft.com/en-us/visualstudio/msbuild/exec-task?view=vs-2019
version = GetType().Assembly.GetCustomAttribute<BuildVersionAttribute>().BuildVersion;
author = GetType().Assembly.GetCustomAttribute<AuthorAttribute>().Author;
powered = GetType().Assembly.GetCustomAttribute<PoweredByAttribute>().PoweredBy;
Sorry I have noticed it has already implemented
Correct: the script pre-build.ps1
is the one that sets the date as build number (although the compile date is still wrong)
This pull request basically aims to remove "Developed by Luciano Ciccariello" as it is not the case anymore.
Before trying changes to this, need to fix build error of .\build.ps1
Closing as I don't believe this is relevant any longer.