-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 extend-info
and extra-resource
arguments for creating the Mac application package.
#253
Conversation
I don't see anything wrong this this PR @erkyrath, thanks for making it and adding tests. However, on a meta note, I really feel like this module is doing too much plist specific stuff that ideally would live externally. If I could do it over again I would defer all plist operations to the user and have them require plist parsing code etc. I'd be interested to hear if anyone has thoughts on a better overall solution to working with plists that doesn't involve implementing lots and lots of code in this module (hence making it hard to maintain) |
Yeah, I can see it's getting messy. But if this logic didn't live here, it would have to live somewhere. If a "user" is an app developer (e.g. me), then the user doesn't want to handle it all. The package.json for my app is at https://github.com/erkyrath/lectrote/blob/master/package.json . As you see, the scripts section isn't short, but it's tidy, and it's all I need to package my thing. (I chose to have five separate script lines rather than using "all". That's on me.) |
Thinking out loud, perhaps a separate node module that provides a nice API to merge plist files? |
We just merged a new feature, which unfortunately means that your PR now has merge conflicts. Could you please rebase? |
I'll take a look tonight. |
… Mac application package. `extend-info`: Take the filename of a plist file and extend Info.plist with its contents. Other explicit arguments such as `app-bundle-id` override this. `extra-resource`: Take a filename and copy that file into the app's Contents/Resources directory. May be used multiple times.
Sorry, the merge message got duplicated there. I tried to fix it and it got worse, so I'm not touching it any more. |
Hmm. It looks like you did |
I did a rebase, and then git told me that origin had a new commit that I had to pull, so I did, then I rebased that, then git told me that origin had a new commit... then I realized I was stuck in a time loop so I gave up. |
I might have some time to take a crack at it this weekend. |
The code is right (and the pull didn't change it). Feel free to rearrange the commits however you like. |
(Or I could just force-discard that last commit entirely) |
Did a quick check to see if I could rebase easily, looks like the answer is no. When I try this weekend, I'm likely going to branch master, cherry-pick your commit, and hand-merge any conflicts (yay for a pretty comprehensive testsuite). |
7cf7807
to
92bda9c
Compare
I tried |
Yah, I don't know. Travis checks just succeeded on exactly the same code as the checks that just failed. Looks like a timeout error? A transient problem? I hope so because it's bedtime here. :/ |
I just tried this out (while trying to solve electron/electron#4403) and weirdly, I had to change https://github.com/erkyrath/electron-packager/blob/featureplist/mac.js#L116 from using |
This PR seems good to me btw 👍 |
What went wrong when you had the (Those calls are not me; it's been |
The Info.plist didn't have my additions. I only had to change the one line I linked to, not all of the
Yeah saw that. |
Add `extend-info` and `extra-resource` arguments for creating the Mac application package.
It is useful to be able to set arbitrary fields in the plist file. MacOS documents many keys, and it's unreasonable to define a separate electron-packager argument for each one. Some keys also need large array or dict structures, which can't comfortably be specified on the command line or in a package script.
Therefore, we want to be able to specify a plist file and merge its contents into the app Info.plist.
We may also need to install files directly into the app's Contents/Resources directory. For example,
UTExportedTypeDeclarations
may specify an icon for a document type; the icon should be an .icns file in Contents/Resources.Therefore, two new arguments:
extend-info
: Take the filename of a plist file and extend Info.plist with its contents. Other explicit arguments such asapp-bundle-id
override this.extra-resource
: Take a filename and copy that file into the app's Contents/Resources directory. May be used multiple times.