diff --git a/.travis.yml b/.travis.yml index 37a4996f1a8..b67443c5f67 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,12 @@ -os: osx - osx_image: xcode7 -env: - - NODE_VERSION=6 - - NODE_VERSION=4 +matrix: + include: + - os: osx + env: NODE_VERSION=6 + + - os: osx + env: TEST_FILES=osxPackagerTest,CodeSignTest NODE_VERSION=4 language: c diff --git a/docs/Multi Platform Build.md b/docs/Multi Platform Build.md index 72f976ebf75..0c205beea0e 100755 --- a/docs/Multi Platform Build.md +++ b/docs/Multi Platform Build.md @@ -3,7 +3,7 @@ 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 OS X. [Cannot be fixed](http://stackoverflow.com/a/12156576). +* OS Code Signing works only on OS X. [Cannot be fixed](http://stackoverflow.com/a/12156576). * Windows Code Signing doesn't work on Linux. We are going to fix it soon. 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. diff --git a/package.json b/package.json index 2531c6bbebb..2cc77c2a07a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test": "node ./test/out/helpers/runTests.js", "semantic-release": "semantic-release pre && npm publish && semantic-release post", "//": "Update wiki if docs changed. Update only if functionalily are generally available (latest release, not next)", - "update-wiki": "git subtree split -b wiki --prefix docs/ && git push wiki wiki:master", + "update-wiki": "git subtree split -b wiki --prefix docs/ && git push -f wiki wiki:master", "whitespace": "whitespace src/*.ts", "docker-images": "docker/build.sh" }, diff --git a/src/packager.ts b/src/packager.ts index 467b5dc0cdd..8a065800a4d 100644 --- a/src/packager.ts +++ b/src/packager.ts @@ -77,6 +77,10 @@ export class Packager implements BuildInfo { // custom packager - don't check wine let checkWine = this.options.platformPackagerFactory == null for (let [platform, archToType] of this.options.targets!) { + if (platform === Platform.OSX && process.platform === Platform.WINDOWS.nodeName) { + throw new Error("Build for OS X is supported only on OS X, please see /~https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build") + } + let wineCheck: Promise | null = null if (checkWine && process.platform !== "win32" && platform === Platform.WINDOWS) { wineCheck = exec("wine", ["--version"]) diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts index ad149d7c7a4..bccbe874b69 100755 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -1,5 +1,5 @@ import test from "./helpers/avaEx" -import { assertPack, modifyPackageJson, outDirName } from "./helpers/packTester" +import { assertPack, modifyPackageJson, outDirName, platform } from "./helpers/packTester" import { expectedWinContents } from "./helpers/expectedContents" import { move, outputFile, outputJson } from "fs-extra-p" import { Promise as BluebirdPromise } from "bluebird" @@ -243,6 +243,8 @@ test("copy extra content", async () => { } }) +test.ifWinCi("Build OS X on Windows is not supported", (t: any) => t.throws(assertPack("test-app-one", platform(Platform.OSX)), /Build for OS X is supported only on OS X.+/)) + function allPlatforms(dist: boolean = true): PackagerOptions { return { targets: getPossiblePlatforms(dist ? null : DIR_TARGET), diff --git a/test/src/helpers/runTests.ts b/test/src/helpers/runTests.ts index feb2e23b0e6..3bc8d701edb 100755 --- a/test/src/helpers/runTests.ts +++ b/test/src/helpers/runTests.ts @@ -119,7 +119,7 @@ async function copyDependencies() { } /** - * CIRCLE_NODE_INDEX=3 — test nodejs 4 (on Circle). + * CIRCLE_NODE_INDEX=2 — test nodejs 4 (on Circle). */ function runTests(): BluebirdPromise { const args: Array = [] @@ -139,7 +139,7 @@ function runTests(): BluebirdPromise { } else if (!isEmptyOrSpaces(process.env.CIRCLE_NODE_INDEX)) { const circleNodeIndex = parseInt(process.env.CIRCLE_NODE_INDEX, 10) - if (circleNodeIndex === 0 || circleNodeIndex === 3) { + if (circleNodeIndex === 0 || circleNodeIndex === 2) { skipWin = true args.push(path.join(baseDir, "linuxPackagerTest.js"), path.join(baseDir, "BuildTest.js")) }