`$(error ...)` (and `$(warning ...)`) functions in a Makefile can't be indented - if they are make displays a `*** commands commence before first target. Stop.` error.
`electron-sign-dmg-darwin.sh` was incorrectly referring to
`scripts/build/electron-sign-app-darwin.sh` as
`scripts/darwin/electron-sign-app.sh`, causing the DMG builds to fail in
OS X.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We have a little snippet to check if a dependency is installed on the
system that we're literally copy-pasting in every single script in the
build system script collection.
For re-usability purposes, this snippet has been extracted to a
`check-dependency.sh` that is called by every script that needs it.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit adds new rules to create directories and sets order only
pre-requisites to the existing rules as a way to centralise directory
creation, which is currently scattered around all the build scripts.
See: https://github.com/resin-io/etcher/pull/923#discussion_r90881453
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
- The Electron npm headers can now be downloaded from
https://atom.io/download/electron
- We can configure gyp to build from source by using the
`npm_config_build_from_source` environment variable rather than having
to pass `--build-from-source`
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If there are any files publishable to S3 then a `publish-aws-s3` target will
automagically exist, and similarly if there are any files publishable to
Bintray then a `publish-bintray-debian` target will automagically exist.
Like all phony targets, these get displayed by `make help` when available.
This script is in charge of downloading any asset from the internet
required by the build system. It accepts a SHA256 checksum and it uses
it to ensure the downloaded file integrity.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We are now going to be adding links to files published in AWS S3 in
GitHub Releases, so that people used to finding pre-built versions of
the software in GitHub Releases will be re-directed to the right place,
while we still keep the analytics advantages that S3 provides us.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
By changing the `Makefile` to use `jq` instead of `node` for getting settings
from `package.json`, the time to do `make help` drops from over 1.5 seconds to
under 0.05 seconds!
This makes it easier to have re-usable functionality that we can
call/source from all scripts, like logic to determine the current
operating system, or to check for a dependency in the `$PATH`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Also sets `help` as the default target, so that typing just `make` displays
the list of possible targets. Also customises the list of targets based on
TARGET_PLATFORM (because you can't build e.g. `electron-installer-dmg` when
you're on Linux).
This version was not working the last time we checked, but it looks like
there were some advancements in node-gyp in the previous months, and all
dependencies have upgraded to it already.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Using MinGW allows us to re-use the build scripts we've been developing
for GNU/Linux and OS X, which are much more robust than their `*.bat`
counterparts (due to Batch limitations).
This commit does the following changes:
- Documents MinGW as a requirement in `RUNNING-LOCALLY.md`
- It setups MinGW in Appveyor CI
- Transforms `windows/sign.bat` into `windows/electron-sign-exe.sh`
- Re-uses `dependencies-npm.sh` and `dependencies-bower.sh` in
`build/windows.bat`
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We show the Etcher version string in the update notifier modal, by giving
the version string to the template through options similar to the warning
modal.
- We memoize the version Promise and assume the update version won't change
during runtime.
Changelog-Entry: Show available Etcher version in the update notifier.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This change is needed to make `electron-create-asar.sh` output valid
asar packages on Windows (Msys).
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Code-signing in OS X now relies on the presence of a
`CODE_SIGN_IDENTITY` variable. If it doesn't exist, all the builds will
gracefully complete without code-signing.
As a consequence of this change, the `electron-installer-dmg.sh` script
has been divided into `electron-create-readwrite-dmg.sh`,
`electron-create-readwrite-dmg.sh`, and `electron-sign-dmg.sh`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We currently use the `--prefix` option in `dependencies-npm.sh` to
install dependencies in another directory, however that function causes
ENOSELF to be thrown on Windows under Msys. As a solution, we take the
same `pushd`/`popd` approach as we do in `dependencies-bower.sh`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `electron-download-package.sh` script yields the following error on
MinGW:
```
cannot verify github.com's certificate
```
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
After our recent changes, the command to install dependencies for both
OS X and GNU/Linux has been unified as `make electron-develop`, so there
is no longer a need to have multiple conditionals for each OS in
`.travis.yml`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, `scripts/unix/electron-download-package.sh` contains its own
logic to determine if the package was already downloaded.
This commit takes the electron package uncompressing task to the
configure scripts, and reduce `electron-download-package.sh` to a script
that simply downloads the zip to a certain location, since this change
allows us to have a separate Make rule to download the Electron zip (and
thus have Make take care of caching).
After this change, the `electron-configure-package-*.sh` scripts are no
longer routines that modify a certain directory, but scripts that take
the zip as an input and actually create the package directory, which
aligns better with Make's design.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
When Etcher is writing to a drive and the user closes the window,
currently there is no confirmation. This commit changes that and
the user has to confirm the exit.
Other changes include the warning modal taking a `rejectionLabel` option
that shows a reject button when provided.
Closes: https://github.com/resin-io/etcher/issues/744
Change-Type: minor
Changelog-Entry: Confirm before user quits while writing.
We add a blue clickable link to the Github changelog in the update dialog
modal.
Closes: https://github.com/resin-io/etcher/issues/905
Change-Type: patch
Changelog-Entry: Add a changelog link to the update notifier modal.
NPM might create an empty `etc/` directory when calling it with the
`--prefix` option and we have a check to see if this directory indeed
exists and its empty in order to proceed and delete it.
We currently use `rm -rf` for it, even though `rmdir` is sufficient.
See: https://github.com/resin-io/etcher/pull/923#discussion_r90570968
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This change prevents the script erroring with `BINTRAY_USER: unbound variable` when `$BINTRAY_USER` isn't defined, and instead displays the "Please define the following ..." message as expected.
We currently hardcode the temporary directory location to `/tmp`. Some
Linux systems define `$TMPDIR`, so we should attempt to re-use that
first.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, we create a "resources app" and install dependencies on it.
This means that to create another "resources app", the whole dependency
installation process needs to be repeated.
As a solution, we cache dependencies at
`release/electron-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies/` and
copy them to the resources apps as we need them.
This has the additional benefit that the resources app depends on the
dependencies rather than the other way around (dependencies depend on
the resources app), which didn't feel right.
In order to accomodate to these changes, the dependencies scripts are
now in charge of taking their corresponding manifests with them when the
prefix option is passed, given that neither `npm` nor `bower` allow to
customise the output location.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Additionally, we setup an EditorConfig rule to automatically switch to
tab style on Makefile.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This Makefile ties together all the build scripts we've been developing
so far. It currently only supports UNIX based operating systems, but
Windows support will be added soon.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, `installer-appimage` creates only the AppImage, and we rely
on code outside the main task to package it up as a Zip. Since Zip is
a required step for AppImage deployment (since the AppImage will lose
its execution permissions if its moved around), we integrate Zip
generation into the AppImage task itself.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We're currently exitting with error code 0 when displaying the usage
information on build scripts, which means that if the user forgets or
mistypes an option argument, the script will carry on its way.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The purpose of this change is to stay true to the Makefile approach,
where each rule is meant to create a single directory/file.
Currently, `unix/dependencies.sh` resulted in `bower_components` and
`node_modules`. Splitting this rule also means that we don't have to
install bower dependencies where we don't need them (e.g: the CLI).
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We tried to save the Chocolatey cache in a previous PR, but it looks
like its not working properly. This PR implements the "correct" way to
cache Chocolatey installs, as recommended in Appveyor forums.
The arrows mean that the cache is invalidated if the file in the right
side (`appveyor.yml`) in this case, is changed.
See: http://help.appveyor.com/discussions/suggestions/592-speeding-up-chocolatey-downloads-and-installs
See: e603cb0838
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Previously, the build scripts would override the top level
`node_modules` and `bower_components`. After this commit, the
dependencies are installed directly in the Electron package.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The logic to install dependencies on Windows now separately lives in
`scripts/windows/dependencies.bat`, similarly to what we've been done
with other operating systems.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The user can now double-click to swiftly select a drive in the
drive widget instead of having to toggle a drive and then clicking the
continue button to close the modal and finalize the drive selection.
Closes: https://github.com/resin-io/etcher/issues/880
Change-Type: patch
Changelog-Entry: Implement double-click to quick-select drives in the
drive widget.
The cursor is incorrectly a pointer on hover over a disabled and
unselectable drive in the drive selector widget. This patch changes the
cursor to `not-allowed`, providing the user with visual feedback that it is
not selectable.
Fixes: https://github.com/resin-io/etcher/issues/865
Change-Type: patch
Changelog-Entry: Use not-allowed cursor over disabled drives in the
drive selector widget.
This refactors the way that the build shell-scripts check for dependencies
in order to cut down on code duplication, and also adds additional
dependency-checks that were missing previously.
Change-Type: minor
Including them means we have to nicely display them in the final `.dmg`.
For simplicity reasons, we'll omit it for now.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>