Skip to content

Commit

Permalink
control 文件支持添加自定义的 X-Package-System 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
Handsome08 committed Nov 12, 2024
1 parent 19c3ed9 commit fb430cc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DebUOS/Packaging.DebUOS.NuGet/Build/package.targets
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
<DebUOSPackingWriteArgLine Include="$([MSBuild]::Escape($(DebControlDepends)))"/>
<DebUOSPackingWriteArgLine Include=">"/>

<DebUOSPackingWriteArgLine Include=">"/>
<DebUOSPackingWriteArgLine Include="DebControlXPackageSystem" Condition="$(DebControlXPackageSystem)!=''"/>
<DebUOSPackingWriteArgLine Include="$([MSBuild]::Escape($(DebControlXPackageSystem)))"/>
<DebUOSPackingWriteArgLine Include=">"/>

<DebUOSPackingWriteArgLine Include=">"/>
<DebUOSPackingWriteArgLine Include="AppName" Condition="$(AppName)!=''"/>
<DebUOSPackingWriteArgLine Include="$(AppName)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,15 @@ public string? DebControlDepends
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 此字段若配置了,则会在 control 文件中写入 X-Package-System 属性,值为此字段的值
/// </summary>
public string? DebControlXPackageSystem
{
set => SetValue(value);
get => GetString();
}

/// <summary>
/// 应用名,英文名。将作为 opt\apps\${AppId}\entries\applications\${AppId}.desktop 和 opt\apps\${AppId}\info 的 Name 属性的值,不写默认和 AssemblyName 属性相同
Expand Down
5 changes: 5 additions & 0 deletions DebUOS/Packaging.DebUOS/DebUOSPackageFileStructCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ public void CreatePackagingFolder(DebUOSConfiguration configuration)
stringBuilder.Append($"Depends: {configuration.DebControlDepends}\n");
}

if (!string.IsNullOrEmpty(configuration.DebControlXPackageSystem))
{
stringBuilder.Append($"X-Package-System: {configuration.DebControlXPackageSystem}\n");
}

File.WriteAllText(controlFile, stringBuilder.ToString(), encoding);
}

Expand Down

0 comments on commit fb430cc

Please sign in to comment.