-
-
Notifications
You must be signed in to change notification settings - Fork 29
Implement --all, refactor code, add tests #88
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds support for --all, --platform=all, and --arch=all. In order to accommodate outputting multiple directories for multiple platforms and architectures, this also implements a new directory structure under the output folder (distinguished by both platform and arch). This structure is applied even to OS X distributions, which formerly were output directly to an .app folder. This could be considered a backwards-incompatible change. One other backwards-incompatible change is the value that the packager function passes to the callback, which is now always an array of paths, rather than just a single path. The behavior of the icon option has also been modified to use its basename and apply .ico or .icns depending on platform, to make it usable with --all and --platform=all. This attempts to maximize backwards compatibility, by allowing a full filename to be specified, but replacing the filename's extension with what is appropriate for each target platform. Alternatively, the extension can now be omitted. In the process of implementing this, it became evident that some things were being done in 3 different places, and weren't always being done consistently, so I've deduplicated everything I could. This also includes a few other changes to improve stability for multi-target runs, and other fixes: * Avoid targeting darwin if the environment doesn't support symlinks, to avoid the process bailing out on Windows * Implement --overwrite centrally in index.js such that it explicitly skips if an output directory already exists, for consistency with all target platforms and to avoid any possible errors that would halt operation during one target of a multi-target run * Use ncp instead of mv to move to finalPath, which avoids flakiness I noticed when testing on Windows 8 especially with multi-target runs * Simplify temp directory logic by using a nested structure, so there is only one top-level directory to clean up * Reinstate fix from #55 which seems to have been clobbered by a later merge * linux.createApp now resolves to the final output directory; it was formerly resolving to the executable path * mac.createApp now replaces space with underscore in bundle IDs * Only the platform modules that are needed are loaded * The win32 module only loads rcedit if needed This also fixes a couple of missing updates to docs (readme/usage). This commit addresses the following issues: * Resolves #40 * Resolves #38 * Resolves #70 * Works around #71 * Resolves #84 by reinstating #55
This implements the following cases:
* Basic runs for a specific version/platform/arch with default options
(testing for existence of expected output files/folders)
* Runs for each target platform with `out` set
* Runs for each target platform with `asar` set
* Runs for each target platform with `prune` set
* Runs for each target platform with `ignore` set
* This includes testing `ignore` including a path separator
* This also includes testing that `ignore` entries are applied
with the app folder trimmed
* Runs for each target platform with `overwrite` set / not set
* Runs with `all` set, with `arch` or `platform` each set to `all`,
and with `platform` set to multiple platforms (comma-delimited or
array)
* Tests specifically for the darwin target platform, to test
`icon` and `sign`
The test logic is organized such that the version of Electron being
tested can be configured once centrally (in config.json), and the tests
will not run until after downloading any necessary electron versions
(to avoid timing out due to long downloads).
Resolves #77.
Contributor
Author
|
I've run the tests on OS X 10.10, Xubuntu, Windows 7, and Windows 8, and verified they passed before submitting this PR. |
This was referenced Jun 28, 2015
Contributor
|
EPIC |
Contributor
|
published as 5.0.0 and added @kfranqueiro as a collaborator. thanks a ton for this! |
Contributor
Author
|
Awesome! Thanks for accepting it. Glad my OCD paid off :) |
Merged
Merged
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for --all, --platform=all, and --arch=all.
In order to accommodate outputting multiple directories for multiple platforms and architectures, this also implements a new directory structure under the output folder (distinguished by both platform and
arch). This structure is applied even to OS X distributions, which formerly were output directly to an .app folder. This could be considered a backwards-incompatible change.
One other backwards-incompatible change is the value that the packager function passes to the callback, which is now always an array of paths, rather than just a single path.
The behavior of the icon option has also been modified to use its basename and apply .ico or .icns depending on platform, to make it usable with --all and --platform=all. This attempts to maximize backwards compatibility, by allowing a full filename to be specified, but replacing the filename's extension with what is appropriate for each target platform. Alternatively, the extension can now be omitted.
In the process of implementing this, it became evident that some things were being done in 3 different places, and weren't always being done consistently, so I've deduplicated everything I could.
This also includes a few other changes to improve stability for multi-target runs, and other fixes:
to avoid the process bailing out on Windows
skips if an output directory already exists, for consistency with
all target platforms and to avoid any possible errors that would halt
operation during one target of a multi-target run
I noticed when testing on Windows 8 especially with multi-target runs
is only one top-level directory to clean up
merge
it was formerly resolving to the executable path
This also fixes a couple of missing updates to docs (readme/usage).
The added tests cover the following cases:
(testing for existence of expected output files/folders)
outsetasarsetprunesetignoresetignoreincluding a path separatorignoreentries are appliedwith the app folder trimmed
overwriteset / not setallset, witharchorplatformeach set toall,and with
platformset to multiple platforms (comma-delimited orarray)
iconandsignThe test logic is organized such that the version of Electron being tested can be configured once centrally (in config.json), and the tests will not run until after downloading any necessary electron versions (to avoid timing out due to long downloads).
This addresses the following issues:
--outinconsistency #38