<Project>
  <PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory)version.json')">
    <_YMhutVersionJson>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.json'))</_YMhutVersionJson>
    <YMhutVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(_YMhutVersionJson)', '(?s).*&quot;version&quot;\s*:\s*&quot;([^&quot;]+)&quot;.*', '$1'))</YMhutVersion>
    <YMhutBuild>$([System.Text.RegularExpressions.Regex]::Replace('$(_YMhutVersionJson)', '(?s).*&quot;build&quot;\s*:\s*&quot;?([0-9]+)&quot;?.*', '$1'))</YMhutBuild>
    <YMhutPackageVersion>$(YMhutVersion).$(YMhutBuild)</YMhutPackageVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(YMhutVersion)' != '' and '$(YMhutBuild)' != ''">
    <Version>$(YMhutVersion)</Version>
    <PackageVersion>$(YMhutPackageVersion)</PackageVersion>
    <AssemblyVersion>$(YMhutPackageVersion)</AssemblyVersion>
    <FileVersion>$(YMhutPackageVersion)</FileVersion>
    <InformationalVersion>$(YMhutPackageVersion)</InformationalVersion>
  </PropertyGroup>
</Project>
