Skip to content

Commit b0ccbbc

Browse files
authored
Merge pull request #168 from dotnet-campus/t/lindexi/Configuration
默认只取 AppVersion 配置,现在可以在 AppVersion 取不到时,取 Version 配置
2 parents 6c0fb4e + 0b4d2e8 commit b0ccbbc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

DotNETBuild/Context/CompileConfiguration.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public string AssemblyVersion
242242
public string AppVersion
243243
{
244244
set => SetValue(value);
245-
get => GetString();
245+
get => GetString() ?? GetString("Version");
246246
}
247247

248248
/// <summary>
@@ -251,7 +251,7 @@ public string AppVersion
251251
/// <remarks>
252252
/// 值如 linux-x64 或 win-x64 或 linux-loongarch64 等
253253
/// </remarks>
254-
public string RuntimeIdentifier
254+
public ConfigurationString? RuntimeIdentifier
255255
{
256256
set => SetValue(value);
257257
get => GetString();

DotNETBuild/Utils/CommandLineArgsToConfiguration.cs

+9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33

44
namespace dotnetCampus.DotNETBuild.Utils
55
{
6+
/// <summary>
7+
/// 命令行参数到配置的扩展
8+
/// </summary>
69
public static class CommandLineArgsToConfiguration
710
{
11+
/// <summary>
12+
/// 添加命令行参数到配置
13+
/// </summary>
14+
/// <param name="appConfigurator"></param>
15+
/// <param name="args"></param>
16+
/// <param name="switchMapping">命令行参数到配置的映射表</param>
817
public static void AddCommandLine(this IAppConfigurator appConfigurator, string[] args,
918
Dictionary<string, string> switchMapping)
1019
{

0 commit comments

Comments
 (0)