Skip to content

Commit b1d6e24

Browse files
authored
feat: add support for dmgbuild's badge-icon configuration (#9513)
1 parent 666d85a commit b1d6e24

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

.changeset/full-places-agree.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"app-builder-lib": minor
3+
"dmg-builder": minor
4+
---
5+
6+
feat: add support for dmgbuild's badge-icon configuration

packages/app-builder-lib/scheme.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,13 @@
870870
"string"
871871
]
872872
},
873+
"badgeIcon": {
874+
"description": "The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\nDefaults to the application icon (`build/icon.icns`).",
875+
"type": [
876+
"null",
877+
"string"
878+
]
879+
},
873880
"contents": {
874881
"description": "The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.",
875882
"items": {

packages/app-builder-lib/src/options/macOptions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ export interface DmgOptions extends TargetSpecificOptions {
251251
*/
252252
backgroundColor?: string | null
253253

254+
/**
255+
* The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.
256+
* Defaults to the application icon (`build/icon.icns`).
257+
*/
258+
badgeIcon?: string | null
259+
254260
/**
255261
* The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.
256262
* Defaults to the application icon (`build/icon.icns`).

packages/dmg-builder/src/dmgUtil.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export async function customizeDmg({ appPath, artifactPath, volumeName, specific
110110
const settings: DmgBuildConfig = {
111111
title: path.basename(volumePath),
112112
icon: await packager.getResource(specification.icon),
113+
"badge-icon": await packager.getResource(specification.badgeIcon),
113114
"icon-size": specification.iconSize,
114115
"text-size": iconTextSize,
115116

0 commit comments

Comments
 (0)