mirror of
https://github.com/FalloutCollaborationProject/FCP-Mod-Updater.git
synced 2026-07-27 17:04:05 -07:00
73 lines
3.3 KiB
XML
73 lines
3.3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<OutputType>Exe</OutputType>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<Nullable>enable</Nullable>
|
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
|
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
|
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<InternalsVisibleTo Include="FCPModUpdater.Tests" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Compile Remove="FCPModUpdater.Tests/**" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="CliWrap" Version="3.10.1" />
|
|
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4" />
|
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
|
|
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.5" />
|
|
<PackageReference Include="Spectre.Console" Version="0.55.0" />
|
|
<PackageReference Include="Spectre.Console.Cli" Version="0.55.0" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
|
<DebugType>embedded</DebugType>
|
|
<DebugSymbols>true</DebugSymbols>
|
|
</PropertyGroup>
|
|
|
|
<!-- Derive version from git tags at build time -->
|
|
<Target Name="SetVersionFromGit" BeforeTargets="GetAssemblyVersion;GetAssemblyAttributes;GenerateNuGetPackage">
|
|
<Exec Command="git describe --tags --long --always"
|
|
ConsoleToMSBuild="true"
|
|
StandardOutputImportance="low"
|
|
IgnoreExitCode="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="GitDescribe" />
|
|
<Output TaskParameter="ExitCode" PropertyName="GitDescribeExitCode" />
|
|
</Exec>
|
|
|
|
<!-- Parse "v0.1.1-4-g2d7e0c6" into components -->
|
|
<PropertyGroup Condition="'$(GitDescribeExitCode)' == '0' and '$(GitDescribe)' != ''">
|
|
<GitDescribeClean>$([System.Text.RegularExpressions.Regex]::Replace('$(GitDescribe)', '^v', ''))</GitDescribeClean>
|
|
<VersionPrefix>$([System.Text.RegularExpressions.Regex]::Match('$(GitDescribeClean)', '^\d+\.\d+\.\d+').Value)</VersionPrefix>
|
|
<GitCommitsSinceTag>$([System.Text.RegularExpressions.Regex]::Match('$(GitDescribeClean)', '(?<=\d-)\d+(?=-)').Value)</GitCommitsSinceTag>
|
|
<GitShortHash>$([System.Text.RegularExpressions.Regex]::Match('$(GitDescribeClean)', 'g[0-9a-f]+$').Value)</GitShortHash>
|
|
</PropertyGroup>
|
|
|
|
<!-- On a tag exactly (0 commits since tag) -->
|
|
<PropertyGroup Condition="'$(VersionPrefix)' != '' and '$(GitCommitsSinceTag)' == '0'">
|
|
<Version>$(VersionPrefix)</Version>
|
|
<InformationalVersion>$(VersionPrefix)</InformationalVersion>
|
|
</PropertyGroup>
|
|
|
|
<!-- Commits ahead of tag = dev build -->
|
|
<PropertyGroup Condition="'$(VersionPrefix)' != '' and '$(GitCommitsSinceTag)' != '' and '$(GitCommitsSinceTag)' != '0'">
|
|
<Version>$(VersionPrefix)</Version>
|
|
<InformationalVersion>$(VersionPrefix)-dev.$(GitCommitsSinceTag)+$(GitShortHash)</InformationalVersion>
|
|
</PropertyGroup>
|
|
|
|
<!-- Fallback if git describe failed or no tags -->
|
|
<PropertyGroup Condition="'$(VersionPrefix)' == ''">
|
|
<Version>0.0.0</Version>
|
|
<InformationalVersion>0.0.0-unknown</InformationalVersion>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
</Project>
|