Skip to content

Commit

Permalink
feat: support completely custom AppxManifest.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
iongion committed Oct 17, 2024
1 parent 74d98d8 commit b99a430
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@
"description": "Relative path to custom extensions xml to be included in an `appmanifest.xml`.",
"type": "string"
},
"customManifestPath": {
"description": "Path to custom AppxManifest.xml",
"type": [
"null",
"string"
]
},
"displayName": {
"description": "A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\nDefaults to the application product name.",
"type": [
Expand Down
5 changes: 5 additions & 0 deletions packages/app-builder-lib/src/options/AppXOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export interface AppXOptions extends TargetSpecificOptions {
*/
readonly customExtensionsPath?: string

/**

Check warning on line 54 in packages/app-builder-lib/src/options/AppXOptions.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Delete `··`

Check warning on line 54 in packages/app-builder-lib/src/options/AppXOptions.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Delete `··`
* Path to custom `AppxManifest.xml`.
*/
readonly customManifestPath?: string

/**
* Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.
* @default false
Expand Down
9 changes: 7 additions & 2 deletions packages/app-builder-lib/src/targets/AppxTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ export default class AppXTarget extends Target {
const assetInfo = await AppXTarget.computeUserAssets(vm, vendorPath, userAssetDir)
const userAssets = assetInfo.userAssets

const manifestFile = stageDir.getTempFile("AppxManifest.xml")
await this.writeManifest(manifestFile, arch, await this.computePublisherName(), userAssets)
const manifestFile = this.options.customManifestPath || stageDir.getTempFile("AppxManifest.xml")
if (this.options.customManifestPath) {
log.info({ reason: "Custom manifest path provided" }, "Manifest writing skipped")
} else {
await this.writeManifest(manifestFile, arch, await this.computePublisherName(), userAssets)
}

await packager.info.callAppxManifestCreated(manifestFile)
mappingList.push(assetInfo.mappings)
mappingList.push([`"${vm.toVmFile(manifestFile)}" "AppxManifest.xml"`])
Expand Down

0 comments on commit b99a430

Please sign in to comment.