diff --git a/.gitignore b/.gitignore
index bf5e38ebaf2..d19f9ccf57a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,5 @@ dist/
/typings/browser.d.ts
/typings/main.d.ts
.DS_Store
-.idea/shelf/
\ No newline at end of file
+.idea/shelf/
+test/typings/electron-builder.d.ts
\ No newline at end of file
diff --git a/.idea/bashsupport_project.xml b/.idea/bashsupport_project.xml
new file mode 100644
index 00000000000..5aa825effb2
--- /dev/null
+++ b/.idea/bashsupport_project.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index f0ceae48247..d52229a2c3d 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -22,12 +22,14 @@
-
+
+
+
diff --git a/README.md b/README.md
index 4c058fb7ae1..bd2c5e99895 100755
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Complete solution to package and build ready for distribution and "auto update"
* Numerous target formats:
* All platforms: `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`.
* [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`.
+ * [Linux](https://github.com/electron-userland/electron-builder/wiki/Options#LinuxBuildOptions-target): `AppImage`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`.
* [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).
diff --git a/docs/Options.md b/docs/Options.md
index 199d979e1c0..dad08b6a86f 100644
--- a/docs/Options.md
+++ b/docs/Options.md
@@ -140,12 +140,12 @@ Linux specific build options.
| Name | Description
| --- | ---
| description | As [description](#AppMetadata-description) from application package.json, but allows you to specify different for Linux.
+| target |
Target package type: list of AppImage, deb, rpm, freebsd, pacman, p5p, apk, 7z, zip, tar.xz, tar.lz, tar.gz, tar.bz2. Defaults to deb.
The most effective [xz](https://en.wikipedia.org/wiki/Xz) compression format used by default.
Only deb and AppImage is tested. Feel free to file issues for rpm and other package formats.
| synopsis | *deb-only.* The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).
| maintainer | The maintainer. Defaults to [author](#AppMetadata-author).
| vendor | The vendor. Defaults to [author](#AppMetadata-author).
| compression | *deb-only.* The compression type, one of `gz`, `bzip2`, `xz`. Defaults to `xz`.
| depends | Package dependencies. Defaults to `["libappindicator1", "libnotify-bin"]`.
-| target |
Target package type: list of deb, rpm, freebsd, pacman, p5p, apk, 7z, zip, tar.xz, tar.lz, tar.gz, tar.bz2. Defaults to deb.
The most effective [xz](https://en.wikipedia.org/wiki/Xz) compression format used by default.
Only deb is tested. Feel free to file issues for rpm and other package formats.
## `.directories`
diff --git a/package.json b/package.json
index 126c147404b..0436dbdde6b 100644
--- a/package.json
+++ b/package.json
@@ -15,8 +15,8 @@
},
"scripts": {
"compile": "npm run compile-production && npm run compile-test",
- "compile-production": "tsconfig -i 2 && ts-babel",
- "compile-test": "tsconfig -i 2 test && ts-babel test",
+ "compile-production": "ts-babel",
+ "compile-test": "ts-babel test",
"lint": "tslint src/*.ts test/src/*.ts",
"pretest": "npm run compile && npm run lint",
"test": "node ./test/out/helpers/runTests.js",
@@ -83,7 +83,7 @@
"semver": "^5.2.0",
"signcode-tf": "~0.7.3",
"source-map-support": "^0.4.1",
- "typescript": "^2.0.0-dev.20160630",
+ "typescript": "2.0.0-dev.20160705",
"update-notifier": "^1.0.2",
"uuid-1345": "^0.99.6",
"yargs": "^4.7.1"
@@ -100,11 +100,11 @@
]
},
"devDependencies": {
- "@types/debug": "0.0.22-alpha",
- "@types/mime": "0.0.25-alpha",
- "@types/progress": "^1.1.24-alpha",
- "@types/semver": "^4.3.23-alpha",
- "@types/source-map-support": "^0.2.24-alpha",
+ "@types/debug": "0.0.26-alpha",
+ "@types/mime": "0.0.26-alpha",
+ "@types/progress": "^1.1.25-alpha",
+ "@types/semver": "^4.3.24-alpha",
+ "@types/source-map-support": "^0.2.25-alpha",
"ava-tf": "^0.15.3",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
@@ -119,8 +119,7 @@
"semantic-release": "^6.3.0",
"should": "^9.0.2",
"ts-babel": "^1.0.3",
- "tsconfig-glob": "^0.4.3",
- "tslint": "3.12.0-dev.1",
+ "tslint": "3.13.0",
"typescript": "2.0.0-dev.20160620-1.0",
"whitespace": "^2.0.0"
},
@@ -139,8 +138,5 @@
"test/out/*.js"
]
},
- "typings": "./out/electron-builder.d.ts",
- "publishConfig": {
- "tag": "next"
- }
+ "typings": "./out/electron-builder.d.ts"
}
diff --git a/src/builder.ts b/src/builder.ts
index a239f445ab6..94ea305f93c 100644
--- a/src/builder.ts
+++ b/src/builder.ts
@@ -164,6 +164,7 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
delete r.w
delete r.windows
delete r.osx
+ delete r.macos
delete r["$0"]
delete r._
delete r.version
diff --git a/src/metadata.ts b/src/metadata.ts
index 95a6741303f..e627842d5ea 100755
--- a/src/metadata.ts
+++ b/src/metadata.ts
@@ -178,6 +178,8 @@ export interface BuildMetadata {
*/
readonly linux?: LinuxBuildOptions | null
+ readonly deb?: LinuxBuildOptions | null
+
/*
The compression level, one of `store`, `normal`, `maximum` (default: `normal`). If you want to rapidly test build, `store` can reduce build time significantly.
*/
@@ -391,6 +393,15 @@ export interface LinuxBuildOptions extends PlatformSpecificBuildOptions {
*/
readonly description?: string | null
+ /*
+ Target package type: list of `AppImage`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`. Defaults to `deb`.
+
+ The most effective [xz](https://en.wikipedia.org/wiki/Xz) compression format used by default.
+
+ Only `deb` and `AppImage` is tested. Feel free to file issues for `rpm` and other package formats.
+ */
+ readonly target?: Array | null
+
/*
*deb-only.* The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).
*/
@@ -424,15 +435,6 @@ export interface LinuxBuildOptions extends PlatformSpecificBuildOptions {
Package dependencies. Defaults to `["libappindicator1", "libnotify-bin"]`.
*/
readonly depends?: string[] | null
-
- /*
- Target package type: list of `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`. Defaults to `deb`.
-
- The most effective [xz](https://en.wikipedia.org/wiki/Xz) compression format used by default.
-
- Only `deb` is tested. Feel free to file issues for `rpm` and other package formats.
- */
- readonly target?: Array | null
}
/*
diff --git a/src/targets/LinuxTargetHelper.ts b/src/targets/LinuxTargetHelper.ts
index 8b62f3b8e7f..7d1fdd62899 100644
--- a/src/targets/LinuxTargetHelper.ts
+++ b/src/targets/LinuxTargetHelper.ts
@@ -64,7 +64,7 @@ export class LinuxTargetHelper {
}
}
- async computeDesktopEntry(exec?: string): Promise {
+ async computeDesktopEntry(exec?: string, extra?: string): Promise {
const appInfo = this.packager.appInfo
const custom = this.packager.platformSpecificBuildOptions.desktop
@@ -81,7 +81,7 @@ Exec=${(exec == null ? `"${installPrefix}/${productFilename}/${productFilename}"
Terminal=false
Type=Application
Icon=${appInfo.name}
-`)
+${extra == null ? "" : `${extra}\n`}`)
return tempFile
}
diff --git a/src/targets/appImage.ts b/src/targets/appImage.ts
index 94fe267b02a..614103c0a7f 100644
--- a/src/targets/appImage.ts
+++ b/src/targets/appImage.ts
@@ -11,11 +11,16 @@ import { Promise as BluebirdPromise } from "bluebird"
const __awaiter = require("../util/awaiter")
const appImageVersion = "AppImage-5"
+//noinspection SpellCheckingInspection
const appImagePathPromise = getBin("AppImage", appImageVersion, `https://dl.bintray.com/electron-userland/bin/${appImageVersion}.7z`, "19833e5db3cbc546432de8ddc8a54181489e6faad4944bd1f3138adf4b771259")
export default class AppImageTarget extends TargetEx {
+ private readonly desktopEntry: Promise
+
constructor(private packager: PlatformPackager, private helper: LinuxTargetHelper, private outDir: string) {
super("appImage")
+
+ this.desktopEntry = helper.computeDesktopEntry("AppRun", `X-AppImage-Version=${packager.appInfo.buildVersion}`)
}
async build(appOutDir: string, arch: Arch): Promise {
@@ -33,6 +38,7 @@ export default class AppImageTarget extends TargetEx {
"-padding", "0",
"-map", appOutDir, "/usr/bin",
"-map", path.join(__dirname, "..", "..", "templates", "linux", "AppRun.sh"), `/AppRun`,
+ "-map", await this.desktopEntry, `/${appInfo.name}.desktop`,
"-move", `/usr/bin/${appInfo.productFilename}`, "/usr/bin/app",
]
for (let [from, to] of (await this.helper.icons)) {
@@ -50,17 +56,17 @@ export default class AppImageTarget extends TargetEx {
await exec(process.platform === "darwin" ? path.join(appImagePath, "xorriso") : "xorriso", args)
+ await new BluebirdPromise((resolve, reject) => {
+ const rd = createReadStream(path.join(appImagePath, arch === Arch.ia32 ? "32" : "64", "runtime"))
+ rd.on("error", reject)
+ const wr = createWriteStream(image)
+ wr.on("error", reject)
+ wr.on("finish", resolve)
+ rd.pipe(wr)
+ })
+
const fd = await open(image, "r+")
try {
- await new BluebirdPromise((resolve, reject) => {
- const rd = createReadStream(path.join(appImagePath, arch === Arch.ia32 ? "32" : "64", "runtime"))
- rd.on("error", reject)
- const wr = createWriteStream(image, {fd: fd, autoClose: false})
- wr.on("error", reject)
- wr.on("finish", resolve)
- rd.pipe(wr)
- })
-
const magicData = new Buffer([0x41, 0x49, 0x01])
await write(fd, magicData, 0, magicData.length, 8)
}
@@ -72,7 +78,7 @@ export default class AppImageTarget extends TargetEx {
// we archive because you cannot distribute exe as is - e.g. Ubuntu clear exec flag and user cannot just click on AppImage to run
// also, LZMA compression - 29MB vs zip 42MB
// we use slow xz instead of 7za because 7za doesn't preserve exec file permissions for xz
- await spawn("xz", ["--compress", "--force", image], {
+ await spawn("xz", ["--x86", "--lzma2", "--compress", "--force", packager.devMetadata.build.compression === "store" ? "-0" : "-9e", image], {
cwd: path.dirname(image),
stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"],
})
diff --git a/src/util/util.ts b/src/util/util.ts
index a410cba6d75..c6dff900b64 100644
--- a/src/util/util.ts
+++ b/src/util/util.ts
@@ -6,15 +6,14 @@ import * as path from "path"
import { readJson, stat, Stats, unlink } from "fs-extra-p"
import { yellow, red } from "chalk"
import debugFactory = require("debug")
-import IDebugger = debug.IDebugger
import { warn, task, log } from "./log"
import { createHash } from "crypto"
//noinspection JSUnusedLocalSymbols
const __awaiter = require("./awaiter")
-export const debug: IDebugger = debugFactory("electron-builder")
-export const debug7z: IDebugger = debugFactory("electron-builder:7z")
+export const debug = debugFactory("electron-builder")
+export const debug7z = debugFactory("electron-builder:7z")
const DEFAULT_APP_DIR_NAMES = ["app", "www"]
diff --git a/templates/linux/AppRun.sh b/templates/linux/AppRun.sh
index 0961e95e890..c59afdd9189 100755
--- a/templates/linux/AppRun.sh
+++ b/templates/linux/AppRun.sh
@@ -1,41 +1,23 @@
#!/bin/bash
-# The purpose of this script is to provide lightweight desktop integration
-# into the host system without special help from the host system.
-# If you want to use it, then place this in usr/bin/$APPNAME.wrapper
-# and set it as the Exec= line of the .desktop file in the AppImage.
-#
-# For example, to install the appropriate icons for Scribus,
-# put them into the AppDir at the following locations:
-#
-# ./usr/share/icons/default/128x128/apps/scribus.png
-# ./usr/share/icons/default/128x128/mimetypes/application-vnd.scribus.png
-#
-# Note that the filename application-vnd.scribus.png is derived from
-# and must be match MimeType=application/vnd.scribus; in scribus.desktop
-# (with "/" characters replaced by "-").
-#
-# Then, change Exec=scribus to Exec=scribus.wrapper and place the script
-# below in usr/bin/scribus.wrapper and make it executable.
-# When you run AppRun, then AppRun runs the wrapper script below
-# which in turn will run the main application.
-#
-# TODO:
-# Handle multiple versions of the same AppImage?
-# Handle removed AppImages? Currently we are just setting TryExec=
-# See http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DELETE
-# Possibly move this to the C runtime that is part of every AppImage?
-
-# Exit on errors
set -e
+echo "$APPDIR"
+
THIS="$0"
-HERE="$(dirname "$(readlink -f "${THIS}")")"
-export PATH="${HERE}/usr/bin:${HERE}/usr/sbin:${PATH}"
-export LD_LIBRARY_PATH="${HERE}/usr/lib:${LD_LIBRARY_PATH}"
-export XDG_DATA_DIRS="${HERE}/usr/share:${XDG_DATA_DIRS}"
-export GSETTINGS_SCHEMA_DIR="${HERE}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"
+# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
+# desktop file has to be installed in an applications subdirectory
+# of one of the $XDG_DATA_DIRS components
+if [ -z "$XDG_DATA_DIRS" ] ; then
+ echo "\$XDG_DATA_DIRS is missing. Please run ${THIS} from within an AppImage."
+ exit 0
+fi
+
+export PATH="${APPDIR}/usr/bin:${APPDIR}/usr/sbin:${PATH}"
+export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
+export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS}"
+export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"
# Be verbose if $DEBUG=1 is set
if [ ! -z "$DEBUG" ] ; then
@@ -51,9 +33,7 @@ NUMBER_OF_ARGS="$#"
# such as desktop integration daemons
VENDORPREFIX=appimagekit
-echo "$APPDIR"
-
-BIN="${HERE}/usr/bin/app"
+BIN="${APPDIR}/usr/bin/app"
trap atexit EXIT
@@ -64,7 +44,11 @@ trap atexit EXIT
atexit()
{
if [ $NUMBER_OF_ARGS -eq 0 ] ; then
- exec "${BIN}"
+# if [ -z $(which "gtk-launch") ] ; then
+ exec "${BIN}"
+# else
+# gtk-launch "${DESKTOP_FILE}"
+# fi
else
exec "${BIN}" "${args[@]}"
fi
@@ -140,11 +124,10 @@ check_dep xdg-icon-resource
check_dep xdg-mime
check_dep xdg-desktop-menu
-DESKTOPFILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
-echo "$DESKTOPFILE"
-DESKTOPFILE_NAME=$(basename $DESKTOPFILE)
+DESKTOP_FILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
+DESKTOP_FILE_NAME=$(basename "${DESKTOP_FILE}")
-if [ ! -f "$DESKTOPFILE" ] ; then
+if [ ! -f "$DESKTOP_FILE" ] ; then
echo "Desktop file is missing. Please run ${THIS} from within an AppImage."
exit 0
fi
@@ -154,26 +137,6 @@ if [ -z "$APPIMAGE" ] ; then
# Not running from within an AppImage; hence using the AppRun for Exec=
fi
-# Construct path to the icon according to
-# http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html
-ABS_APPIMAGE=$(readlink -e "$APPIMAGE")
-ICONURL="file://$ABS_APPIMAGE"
-MD5=$(echo -n $ICONURL | md5sum | cut -c -32)
-ICONFILE="$HOME/.cache/thumbnails/normal/$MD5.png"
-if [ ! -f "$ICONFILE" ] ; then
- echo "$ICONFILE is missing. Probably not running ${THIS} from within an AppImage."
- echo "Hence falling back to using .DirIcon"
- ICONFILE="$APPDIR/.DirIcon"
-fi
-
-# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
-# desktop file has to be installed in an applications subdirectory
-# of one of the $XDG_DATA_DIRS components
-if [ -z "$XDG_DATA_DIRS" ] ; then
- echo "\$XDG_DATA_DIRS is missing. Please run ${THIS} from within an AppImage."
- exit 0
-fi
-
# Determine where the desktop file should be installed
if [[ $EUID -ne 0 ]]; then
DESTINATION_DIR_DESKTOP="$HOME/.local/share/applications"
@@ -186,11 +149,11 @@ fi
# Check if the desktop file is already there
# and if so, whether it points to the same AppImage
-if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" ] ; then
- # echo "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME already there"
- EXEC=$(grep "^Exec=" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" | head -n 1 | cut -d " " -f 1)
- # echo $EXEC
- if [ "Exec=$APPIMAGE" == "$EXEC" ] ; then
+if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOP_FILE_NAME" ] ; then
+ INSTALLED_APP_VERSION=$(grep "^X-AppImage-Version=" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOP_FILE_NAME" | head -n 1 | cut -d " " -f 1)
+ APP_VERSION=$(grep "^X-AppImage-Version=" "$DESKTOP_FILE" | head -n 1 | cut -d " " -f 1)
+ echo "installed: $INSTALLED_APP_VERSION image: $APP_VERSION"
+ if [ "$INSTALLED_APP_VERSION" == "$APP_VERSION" ] ; then
exit 0
fi
fi
@@ -200,10 +163,10 @@ if [ -z "$SKIP" ] ; then
yesno "Install" "Should a desktop file for $APPIMAGE be installed?"
fi
-APP=$(echo "$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
-
# If the user has agreed, rewrite and install the desktop file, and the MIME information
if [ -z "$SKIP" ] ; then
+ APP=$(echo "$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
+
# desktop-file-install is supposed to install .desktop files to the user's
# applications directory when run as a non-root user,
# and to /usr/share/applications if run as root
@@ -211,14 +174,14 @@ if [ -z "$SKIP" ] ; then
desktop-file-install --rebuild-mime-info-cache \
--vendor=$VENDORPREFIX --set-key=Exec --set-value="${APPIMAGE} %U" \
--set-key=X-AppImage-Comment --set-value="Generated by ${THIS}" \
- --set-icon=$ICONFILE --set-key=TryExec --set-value=$APPIMAGE $DESKTOPFILE \
+ --set-icon="$VENDORPREFIX-$APP" --set-key=TryExec --set-value="${APPIMAGE}" "${DESKTOP_FILE}" \
--dir "$DESTINATION_DIR_DESKTOP"
chmod a+x "$DESTINATION_DIR_DESKTOP/"*
- RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
- echo $RESOURCE_NAME
+ RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
+ echo ${RESOURCE_NAME}
# Install the icon files for the application; TODO: scalable
- ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/apps/${APP}.png" || true)
+ ICONS=$(find "${APPDIR}/usr/share/icons/" -path "*/apps/${APP}.png" || true)
for ICON in $ICONS ; do
ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
xdg-icon-resource install --context apps --size ${ICON_SIZE} "${ICON}" "${RESOURCE_NAME}"
@@ -235,5 +198,6 @@ if [ -z "$SKIP" ] ; then
done
xdg-desktop-menu forceupdate
- gtk-update-icon-cache # for MIME
+ # for MIME
+ gtk-update-icon-cache
fi
\ No newline at end of file
diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts
index 1f554ab6ff6..14f76492ffb 100755
--- a/test/src/helpers/packTester.ts
+++ b/test/src/helpers/packTester.ts
@@ -5,7 +5,7 @@ import * as path from "path"
import { parse as parsePlist } from "plist"
import { CSC_LINK } from "./codeSignData"
import { expectedLinuxContents, expectedWinContents } from "./expectedContents"
-import { Packager, PackagerOptions, Platform, ArtifactCreated, Arch, DIR_TARGET } from "out"
+import { Packager, PackagerOptions, Platform, ArtifactCreated, Arch, DIR_TARGET, DEFAULT_TARGET } from "out"
import { exec, getTempName } from "out/util/util"
import { log, warn } from "out/util/log"
import { createTargets } from "out"
@@ -38,7 +38,7 @@ interface AssertPackOptions {
export async function assertPack(fixtureName: string, packagerOptions: PackagerOptions, checkOptions?: AssertPackOptions): Promise {
const tempDirCreated = checkOptions == null ? null : checkOptions.tempDirCreated
- const useTempDir = tempDirCreated != null || packagerOptions.devMetadata != null || (checkOptions != null && checkOptions.useTempDir)
+ const useTempDir = tempDirCreated != null || packagerOptions.devMetadata != null || (checkOptions != null && checkOptions.useTempDir) || packagerOptions.targets.values().next().value.values().next().value[0] !== DEFAULT_TARGET
let projectDir = path.join(__dirname, "..", "..", "fixtures", fixtureName)
// const isDoNotUseTempDir = platform === "darwin"
diff --git a/test/src/linuxPackagerTest.ts b/test/src/linuxPackagerTest.ts
index 0d0b8753a4a..d2ada8c626c 100755
--- a/test/src/linuxPackagerTest.ts
+++ b/test/src/linuxPackagerTest.ts
@@ -11,47 +11,22 @@ test.ifNotWindows("deb", () => assertPack("test-app-one", platform(Platform.LINU
test.ifDevOrLinuxCi("AppImage", () => assertPack("test-app-one", {
targets: Platform.LINUX.createTarget("appimage"),
- appMetadata: {
- name: "Bar",
- productName: "Bar",
- },
}
))
+// "apk" is very slow, don't test for now
test.ifDevOrLinuxCi("targets", () => assertPack("test-app-one", {
- targets: Platform.LINUX.createTarget(),
- devMetadata: {
- build: {
- linux: {
- // "apk" is very slow, don't test for now
- target: ["sh", "freebsd", "pacman", "zip", "7z"],
- }
- }
- }
+ targets: Platform.LINUX.createTarget(["sh", "freebsd", "pacman", "zip", "7z"]),
}))
test.ifDevOrLinuxCi("tar", () => assertPack("test-app-one", {
- targets: Platform.LINUX.createTarget(),
- devMetadata: {
- build: {
- linux: {
- target: ["tar.xz", "tar.lz", "tar.bz2"],
- }
- }
- }
+ targets: Platform.LINUX.createTarget(["tar.xz", "tar.lz", "tar.bz2"]),
}))
// https://github.com/electron-userland/electron-builder/issues/460
// for some reasons in parallel to fmp we cannot use tar
test.ifDevOrLinuxCi("rpm and tar.gz", () => assertPack("test-app-one", {
- targets: Platform.LINUX.createTarget(),
- devMetadata: {
- build: {
- linux: {
- target: ["rpm", "tar.gz"],
- }
- }
- }
+ targets: Platform.LINUX.createTarget(["rpm", "tar.gz"]),
}))
test.ifNotWindows("icons from ICNS", () => assertPack("test-app-one", {
@@ -60,11 +35,11 @@ test.ifNotWindows("icons from ICNS", () => assertPack("test-app-one", {
tempDirCreated: it => remove(path.join(it, "build", "icons"))
}))
-test.ifNotWindows("custom configuration", () => assertPack("test-app-one", {
- targets: Platform.LINUX.createTarget(),
+test.ifNotWindows("custom depends", () => assertPack("test-app-one", {
+ targets: Platform.LINUX.createTarget("deb"),
devMetadata: {
build: {
- linux: {
+ deb: {
depends: ["foo"],
}
}
@@ -76,10 +51,8 @@ test.ifNotWindows("custom configuration", () => assertPack("test-app-one", {
test.ifNotWindows("no-author-email", t => {
t.throws(assertPack("test-app-one", platform(Platform.LINUX), {
- tempDirCreated: projectDir => {
- return modifyPackageJson(projectDir, data => {
- data.author = "Foo"
- })
- }
+ tempDirCreated: projectDir => modifyPackageJson(projectDir, data => {
+ data.author = "Foo"
+ })
}), /Please specify author 'email' in .+/)
})
\ No newline at end of file
diff --git a/test/tsconfig.json b/test/tsconfig.json
index 0a4bee2bcc2..2a2321b8a1c 100755
--- a/test/tsconfig.json
+++ b/test/tsconfig.json
@@ -14,68 +14,17 @@
"noEmitHelpers": true,
"noFallthroughCasesInSwitch": true
},
- "filesGlob": [
+ "include": [
"../typings/**/*.d.ts",
"typings/**/*.d.ts",
"src/**/*.ts",
"../node_modules/ava-tf/index.d.ts",
"../node_modules/fs-extra-p/index.d.ts",
"../node_modules/fs-extra-p/bluebird.d.ts",
- "out/electron-builder.d.ts",
"../node_modules/electron-osx-sign/index.d.ts",
- "../node_modules/@types/**/*.d.ts",
- "!../node_modules/@types/node/node-*.d.ts"
+ "../node_modules/@types/**/*.d.ts"
],
- "files": [
- "../typings/ansi-escapes.d.ts",
- "../typings/appdmg.d.ts",
- "../typings/asar.d.ts",
- "../typings/chalk.d.ts",
- "../typings/electron-packager.d.ts",
- "../typings/electron-winstaller-fixed.d.ts",
- "../typings/gh-api.d.ts",
- "../typings/hosted-git-info.d.ts",
- "../typings/lib.es2016.array.include.d.ts",
- "../typings/minimatch.d.ts",
- "../typings/path-sort.d.ts",
- "../typings/pretty-ms.d.ts",
- "../typings/progress-stream.d.ts",
- "../typings/read-package-json.d.ts",
- "../typings/sanitize-filename.d.ts",
- "../typings/signcode.d.ts",
- "../typings/updateNotifier.d.ts",
- "../typings/uuid-1345.d.ts",
- "../typings/yargs.d.ts",
- "typings/decompress-zip.d.ts",
- "typings/diff.d.ts",
- "typings/json8.d.ts",
- "typings/plist.d.ts",
- "typings/should.d.ts",
- "../node_modules/ava-tf/index.d.ts",
- "../node_modules/fs-extra-p/index.d.ts",
- "../node_modules/fs-extra-p/bluebird.d.ts",
- "out/electron-builder.d.ts",
- "../node_modules/electron-osx-sign/index.d.ts",
- "../node_modules/@types/debug/index.d.ts",
- "../node_modules/@types/mime/index.d.ts",
- "../node_modules/@types/node/index.d.ts",
- "../node_modules/@types/progress/index.d.ts",
- "../node_modules/@types/semver/index.d.ts",
- "../node_modules/@types/source-map-support/index.d.ts",
- "src/ArtifactPublisherTest.ts",
- "src/BuildTest.ts",
- "src/CodeSignTest.ts",
- "src/RepoSlugTest.ts",
- "src/globTest.ts",
- "src/helpers/avaEx.ts",
- "src/helpers/codeSignData.ts",
- "src/helpers/expectedContents.ts",
- "src/helpers/fileAssert.ts",
- "src/helpers/packTester.ts",
- "src/helpers/runTests.ts",
- "src/httpRequestTest.ts",
- "src/linuxPackagerTest.ts",
- "src/macPackagerTest.ts",
- "src/winPackagerTest.ts"
+ "exclude": [
+ "../node_modules/@types/node/node-*.d.ts"
]
}
diff --git a/tsconfig.json b/tsconfig.json
index 85b6b45441d..e023f5f0394 100755
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -16,87 +16,19 @@
},
"declaration": {
"electron-builder": "out/electron-builder.d.ts",
- "": "test/out/electron-builder.d.ts"
+ "": "test/typings/electron-builder.d.ts"
},
"docs": "docs/Options.md",
- "filesGlob": [
+ "include": [
"src/**/*.ts",
- "lib/*.d.ts",
"typings/**/*.d.ts",
- "!typings/browser/**/*.d.ts",
- "!typings/browser.d.ts",
- "!typings/main.d.ts",
"node_modules/fs-extra-p/index.d.ts",
"node_modules/7zip-bin/index.d.ts",
"node_modules/fs-extra-p/bluebird.d.ts",
"node_modules/electron-osx-sign/index.d.ts",
- "node_modules/@types/**/*.d.ts",
- "!node_modules/@types/node/node-*.d.ts"
+ "node_modules/@types/**/*.d.ts"
],
- "files": [
- "typings/ansi-escapes.d.ts",
- "typings/appdmg.d.ts",
- "typings/asar.d.ts",
- "typings/chalk.d.ts",
- "typings/electron-packager.d.ts",
- "typings/electron-winstaller-fixed.d.ts",
- "typings/gh-api.d.ts",
- "typings/hosted-git-info.d.ts",
- "typings/lib.es2016.array.include.d.ts",
- "typings/minimatch.d.ts",
- "typings/path-sort.d.ts",
- "typings/pretty-ms.d.ts",
- "typings/progress-stream.d.ts",
- "typings/read-package-json.d.ts",
- "typings/sanitize-filename.d.ts",
- "typings/signcode.d.ts",
- "typings/updateNotifier.d.ts",
- "typings/uuid-1345.d.ts",
- "typings/yargs.d.ts",
- "node_modules/fs-extra-p/index.d.ts",
- "node_modules/7zip-bin/index.d.ts",
- "node_modules/fs-extra-p/bluebird.d.ts",
- "node_modules/electron-osx-sign/index.d.ts",
- "node_modules/@types/debug/index.d.ts",
- "node_modules/@types/mime/index.d.ts",
- "node_modules/@types/node/index.d.ts",
- "node_modules/@types/progress/index.d.ts",
- "node_modules/@types/semver/index.d.ts",
- "node_modules/@types/source-map-support/index.d.ts",
- "src/appInfo.ts",
- "src/asarUtil.ts",
- "src/build-cli.ts",
- "src/builder.ts",
- "src/cleanup.ts",
- "src/cliOptions.ts",
- "src/codeSign.ts",
- "src/errorMessages.ts",
- "src/gitHubPublisher.ts",
- "src/gitHubRequest.ts",
- "src/index.ts",
- "src/install-app-deps.ts",
- "src/linuxPackager.ts",
- "src/macPackager.ts",
- "src/metadata.ts",
- "src/packager.ts",
- "src/platformPackager.ts",
- "src/repositoryInfo.ts",
- "src/targets/LinuxTargetHelper.ts",
- "src/targets/appImage.ts",
- "src/targets/archive.ts",
- "src/targets/dmg.ts",
- "src/targets/fpm.ts",
- "src/targets/nsis.ts",
- "src/targets/squirrelWindows.ts",
- "src/targets/targetFactory.ts",
- "src/util/awaiter.ts",
- "src/util/binDownload.ts",
- "src/util/deepAssign.ts",
- "src/util/filter.ts",
- "src/util/httpRequest.ts",
- "src/util/log.ts",
- "src/util/promise.ts",
- "src/util/util.ts",
- "src/winPackager.ts"
+ "exclude": [
+ "node_modules/@types/node/node-*.d.ts"
]
}