From 6aad2b55fc9aa479c0922fee2cca8cf710a828ed Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Sun, 28 Nov 2021 15:55:00 +0100 Subject: [PATCH 1/2] use new app-builder-bin & hook up compression option --- packages/app-builder-lib/src/targets/snap.ts | 4 ++++ packages/builder-util/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/app-builder-lib/src/targets/snap.ts b/packages/app-builder-lib/src/targets/snap.ts index 7f1dbd723f1..e6e0dbc99b3 100644 --- a/packages/app-builder-lib/src/targets/snap.ts +++ b/packages/app-builder-lib/src/targets/snap.ts @@ -222,6 +222,10 @@ export default class SnapTarget extends Target { if (this.isUseTemplateApp) { args.push("--template-url", `electron4:${snapArch}`) } + + if (options.compression != null) { + args.push("--compression", options.compression) + } await executeAppBuilder(args) await packager.info.callArtifactBuildCompleted({ diff --git a/packages/builder-util/package.json b/packages/builder-util/package.json index 178309ccc22..8e2166fa7ba 100644 --- a/packages/builder-util/package.json +++ b/packages/builder-util/package.json @@ -18,7 +18,7 @@ "7zip-bin": "~5.1.1", "@types/debug": "^4.1.6", "@types/fs-extra": "^9.0.11", - "app-builder-bin": "3.7.1", + "app-builder-bin": "4.1.0", "bluebird-lst": "^1.0.9", "builder-util-runtime": "workspace:*", "chalk": "^4.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf64bfb2085..d151bb3b1a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -171,7 +171,7 @@ importers: '@types/js-yaml': 4.0.2 '@types/source-map-support': 0.5.4 7zip-bin: ~5.1.1 - app-builder-bin: 3.7.1 + app-builder-bin: 4.1.0 bluebird-lst: ^1.0.9 builder-util-runtime: workspace:* chalk: ^4.1.1 @@ -187,7 +187,7 @@ importers: '@types/debug': 4.1.7 '@types/fs-extra': 9.0.12 7zip-bin: 5.1.1 - app-builder-bin: 3.7.1 + app-builder-bin: 4.1.0 bluebird-lst: 1.0.9 builder-util-runtime: link:../builder-util-runtime chalk: 4.1.2 @@ -2899,8 +2899,8 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.0 - /app-builder-bin/3.7.1: - resolution: {integrity: sha512-ql93vEUq6WsstGXD+SBLSIQw6SNnhbDEM0swzgugytMxLp3rT24Ag/jcC80ZHxiPRTdew1niuR7P3/FCrDqIjw==} + /app-builder-bin/4.1.0: + resolution: {integrity: sha512-rbdMe0sIVE95cpYqMQh4IFqhTDdB8LkKlTRcbO/Y3QleRYoIePejIbX774IYomYYzZbJfJuX7pLRiGvSdIxIYA==} dev: false /archiver-utils/2.1.0: From 52b70b155b33dcee3305aafdab82af2e3711c4ac Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Thu, 2 Dec 2021 17:19:42 +0100 Subject: [PATCH 2/2] set default snap compression type to lzo --- packages/app-builder-lib/scheme.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-builder-lib/scheme.json b/packages/app-builder-lib/scheme.json index 3e6043ca118..072dd8d86f7 100644 --- a/packages/app-builder-lib/scheme.json +++ b/packages/app-builder-lib/scheme.json @@ -5234,8 +5234,8 @@ "type": "null" } ], - "default": "xz", - "description": "Sets the compression type for the snap. Can be xz or lzo. Defaults to xz when not specified." + "default": "lzo", + "description": "Sets the compression type for the snap. Can be xz or lzo. Defaults to lzo when not specified." }, "useTemplateApp": { "description": "Whether to use template snap. Defaults to `true` if `stagePackages` not specified.",