-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom AppX assets and asset resolutions. #1657
Add support for custom AppX assets and asset resolutions. #1657
Conversation
Just run |
|
||
const customAssetsFolder = this.options.assetsFolder | ||
if (customAssetsFolder) { | ||
const customAssetsPath = path.resolve(this.packager.projectDir, customAssetsFolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom dir must be relative to build resources directory by default. If doesn't exist, relative to project dir. Hint — use method statOrNull.
yarn lint ;) |
const destination = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, "appx", arch)) | ||
const args = ["pack", "/o", "/d", preAppx, "/p", destination] | ||
use(this.options.makeappxArgs, (it: Array<string>) => args.push(...it)) | ||
this.writeManifest(templatePath, preAppx, safeName, arch, publisher, this.options.assetNames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If custom dir specified, we should populate missed values in the asset names. Right? Otherwise strange — why we require explicit configuration of names.
/** | ||
* Specify a custom assets folder to use for the assets. | ||
*/ | ||
readonly assetsFolder?: string | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dir should be equals by default to some convenient location, e.g. appxAssets. So, user can simply put files without explicit conf.
resources folder and supporting additional AppX assets.
381f5e5
to
aec1fd1
Compare
@develar I've updated the PR based on our conversations and linted the changes. Let me know if there's any other improvements you would like. I have also included readme/documentation changes below on how this works - let me know if you have any doubts or questions. README ChangesAppX Assets SupportAppX assets need to be placed in the The assets should follow these naming conventions:
All official AppX asset types are supported by the build process. These assets can include scaled assets by using Default assets will be used for
|
+500 interwebs for you, looking forward to having this in |
Merge in process. I will change "appx_assets" to "appx" since this folder in build resources and it is clear that it is appx assets.
In general it violates our rules — should be at least one major release before final drop, but
|
@surajreddy Hi, I need your help. To avoid intermediate file copying, now file mappings is used. Problem is that not clear for me what should be used as |
This PR includes custom the ability to add a custom
assets
folder forAppX
builds, along with support to specify the names for theAppX
assets. This is based on #987 (comment)It leaves the default behavior untouched.
Should I add option notes for the builds in this issue, or should I be updating the wiki directly?
Note: this doesn't add support for the
BadgeLogo
visual asset option.Related: electron-userland/electron-builder-binaries#3
Some Reference Docs:
https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/how-to-create-a-basic-package-manifest
https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/what-s-changed-in-windows-10
cc @feens