Skip to content

Commit

Permalink
feat: specified icon not being used when generating osx build
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Jun 21, 2016
1 parent c56f583 commit 74388bb
Show file tree
Hide file tree
Showing 48 changed files with 970 additions and 621 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/typescript-compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cache:
before_install:
- brew install --ignore-dependencies --force-bottle gnu-tar dpkg libicns graphicsmagick lzip freetype
- brew deps --skip-optional wine | grep -v -e freetype -e libtiff -e libpng -e libtool -e libicns -e jpeg -e gmp | xargs brew install --ignore-dependencies --force-bottle
- brew install --ignore-dependencies --force-bottle wine mono
- brew install --ignore-dependencies --force-bottle wine
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.0/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.0.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull

install:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This includes:
- log of the terminal output
- node version
- npm version
- on which system do you want to create installers (OS X, Windows or Linux)
- on which system do you want to create installers (MacOS, Windows or Linux)

# Pull Requests
To check that your contributions match the project coding style make sure `npm test` passes.
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# electron-builder [![npm version](https://img.shields.io/npm/v/electron-builder.svg)](https://npmjs.org/package/electron-builder)
Complete solution to package and build ready for distribution and "auto update" Electron app for OS X, Windows and Linux.
Complete solution to package and build ready for distribution and "auto update" Electron app for MacOS, Windows and Linux.

* NPM packages management:
* [Native application dependencies](http://electron.atom.io/docs/latest/tutorial/using-native-node-modules/) compilation (only if [two-package.json project structure](#two-packagejson-structure) used).
Expand All @@ -9,9 +9,9 @@ Complete solution to package and build ready for distribution and "auto update"
* [Build version management](https://github.com/electron-userland/electron-builder/wiki/Options#build-version-management).
* Numerous target formats:
* All platforms: `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`.
* [OS X](https://github.com/electron-userland/electron-builder/wiki/Options#OsXBuildOptions-target): `dmg`, `mas`.
* [MacOS](https://github.com/electron-userland/electron-builder/wiki/Options#MacOptions-target): `dmg`, `mas`.
* [Linux](https://github.com/electron-userland/electron-builder/wiki/Options#LinuxBuildOptions-target): `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`.
* Windows: Squirrel.Windows. NSIS will be supported soon.
* [Windows](https://github.com/electron-userland/electron-builder/wiki/Options#WinBuildOptions-target): NSIS, Squirrel.Windows.
* [Publishing artifacts to GitHub Releases](https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts).

[electron-packager](https://github.com/electron-userland/electron-packager) and
Expand Down Expand Up @@ -59,9 +59,9 @@ For a production app you need to sign your application, see [Where to buy code s
```
See [options](https://github.com/electron-userland/electron-builder/wiki/Options). This object will be used as a source of [electron-packager](https://www.npmjs.com/package/electron-packager#packageropts-callback) options. You can specify any other options here.

3. Create directory `build` in the root of the project and put your `background.png` (OS X DMG background), `icon.icns` (OS X app icon) and `icon.ico` (Windows app icon).
3. Create directory `build` in the root of the project and put your `background.png` (MacOS DMG background), `icon.icns` (MacOS app icon) and `icon.ico` (Windows app icon).

<a id="user-content-linuxIcon" class="anchor" href="#linuxIcon" aria-hidden="true"></a>Linux icon set will be generated automatically on the fly from the OS X `icns` file (or you can put them into the `build/icons` directory — filename must contains size (e.g. `32x32.png`)).
<a id="user-content-linuxIcon" class="anchor" href="#linuxIcon" aria-hidden="true"></a>Linux icon set will be generated automatically on the fly from the MacOS `icns` file (or you can put them into the `build/icons` directory — filename must contains size (e.g. `32x32.png`)).

4. Add [scripts](https://docs.npmjs.com/cli/run-script) to the development `package.json`:
```json
Expand All @@ -80,7 +80,7 @@ Please note — packaged into an asar archive [by default](https://github.com/el
# Auto Update
`electron-builder` produces all required artifacts:

* `.dmg`: OS X installer, required for OS X user to initial install.
* `.dmg`: MacOS installer, required for MacOS user to initial install.
* `-mac.zip`: required for Squirrel.Mac.
* `.exe` and `-ia32.exe`: Windows installer, required for Windows user to initial install. Please note — [your app must handle Squirrel.Windows events](https://github.com/electronjs/windows-installer#handling-squirrel-events). See [real example](https://github.com/develar/onshape-desktop-shell/blob/master/src/WinSquirrelStartupEventHandler.ts).
* `.full-nupkg`: required for Squirrel.Windows.
Expand All @@ -95,17 +95,17 @@ For windows consider only [distributing 64-bit versions](https://github.com/elec
# CLI Usage
Execute `node_modules/.bin/build --help` to get actual CLI usage guide.
```
--osx, -o Build for OS X [array]
--mac, -o Build for MacOS [array]
--linux, -l Build for Linux [array]
--win, -w, --windows Build for Windows [array]
--x64 Build for x64 [boolean]
--ia32 Build for ia32 [boolean]
--publish, -p Publish artifacts (to GitHub Releases), see
https://goo.gl/WMlr4n
[choices: "onTag", "onTagOrDraft", "always", "never"]
--platform The target platform (preferred to use --osx, --win or
--platform The target platform (preferred to use --mac, --win or
--linux)
[choices: "osx", "win", "linux", "darwin", "win32", "all"]
[choices: "mac", "win", "linux", "darwin", "win32", "all"]
--arch The target arch (preferred to use --x64 or --ia32)
[choices: "ia32", "x64", "all"]
--help Show help [boolean]
Expand All @@ -123,7 +123,7 @@ const Platform = builder.Platform
// Promise is returned
builder.build({
targets: Platform.OSX.createTarget(),
targets: Platform.MAC.createTarget(),
devMetadata: {
"//": "build and other properties, see https://goo.gl/5jVxoO"
}
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cache:
- node_modules
- '%APPDATA%\npm-cache'
- '%USERPROFILE%\.electron'
- '%USERPROFILE%\.cache\nsis'

install:
- ps: Install-Product node 6 x64
Expand Down
2 changes: 1 addition & 1 deletion docker/6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM electronuserland/electron-builder:base

ENV NODE_VERSION 6.2.1
ENV NODE_VERSION 6.2.2

# https://github.com/npm/npm/issues/4531
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
Expand Down
4 changes: 2 additions & 2 deletions docs/Code Signing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OS X and Windows code signing is supported. Windows is dual code-signed (SHA1 & SHA256 hashing algorithms).
MacOS and Windows code signing is supported. Windows is dual code-signed (SHA1 & SHA256 hashing algorithms).

On a OS X development machine valid and appropriate identity from your keychain will be automatically used.
On a MacOS development machine valid and appropriate identity from your keychain will be automatically used.

| Env name | Description
| -------------- | -----------
Expand Down
16 changes: 8 additions & 8 deletions docs/Multi Platform Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ Don't expect that you can build app for all platforms on one platform.
* If your app has native dependencies, it can be compiled only on the target platform.
[prebuild](https://www.npmjs.com/package/prebuild) is a solution, but most node modules [don't provide](https://github.com/atom/node-keytar/issues/27) prebuilt binaries.

* OS Code Signing works only on OS X. [Cannot be fixed](http://stackoverflow.com/a/12156576).
* OS Code Signing works only on MacOS. [Cannot be fixed](http://stackoverflow.com/a/12156576).

Don't think that mentioned issues are major, you should use build servers — e.g. [AppVeyor](http://www.appveyor.com/) to build Windows app and [Travis](https://travis-ci.org) to build OS X/Linux apps.
Don't think that mentioned issues are major, you should use build servers — e.g. [AppVeyor](http://www.appveyor.com/) to build Windows app and [Travis](https://travis-ci.org) to build MacOS/Linux apps.

See [sample appveyor.yml](https://github.com/develar/onshape-desktop-shell/blob/master/appveyor.yml) to build Electron app for Windows.
And [sample .travis.yml](https://github.com/develar/onshape-desktop-shell/blob/master/.travis.yml) to build Electron app for OS X.
And [sample .travis.yml](https://github.com/develar/onshape-desktop-shell/blob/master/.travis.yml) to build Electron app for MacOS.

By default build for current platform and current arch. Use CLI flags `--osx`, `--win`, `--linux` to specify platforms. And `--ia32`, `--x64` to specify arch.

For example, to build app for OS X, Windows and Linux:
For example, to build app for MacOS, Windows and Linux:
```
npm run build -owl
build -mwl
```

Build performed in parallel, so, it is highly recommended to not use npm task per platform (e.g. `npm run dist:osx && npm run dist:win32`), but specify multiple platforms/targets in one build command.
You don't need to clean dist output before build — output directory is cleaned automatically.

## OS X
## MacOS

Use [brew](http://brew.sh) to install required packages.

To build app in distributable format for Windows on OS X:
To build app in distributable format for Windows on MacOS:
```
brew install Caskroom/cask/xquartz wine mono
```

To build app in distributable format for Linux on OS X:
To build app in distributable format for Linux on MacOS:
```
brew install gnu-tar libicns graphicsmagick
```
Expand Down
Loading

0 comments on commit 74388bb

Please sign in to comment.