Skip to content

Commit a0c0d8e

Browse files
committed
feat(snap): ubuntu-app-platform (disabled by default)
1 parent 1fc26a5 commit a0c0d8e

File tree

20 files changed

+99
-39
lines changed

20 files changed

+99
-39
lines changed

.idea/dictionaries/develar.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_install:
2929
install:
3030
- nvm install $NODE_VERSION
3131
- nvm use --delete-prefix $NODE_VERSION
32-
- ln -sf $PWD/test/yarn.js /usr/local/bin/yarn
32+
- ln -sf $PWD/test/vendor/yarn.js /usr/local/bin/yarn
3333
- yarn install --pure-lockfile
3434
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && "$AUTO_PUBLISH" != "false" && "$TRAVIS_TAG" == "" && "$PUBLISH_TO_NPM" == "true" ]]; then yarn add @develar/semantic-release@next --dev ; fi
3535

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ const Platform = builder.Platform
125125
// Promise is returned
126126
builder.build({
127127
targets: Platform.MAC.createTarget(),
128-
devMetadata: {
129-
"//": "build and other properties, see https://goo.gl/5jVxoO"
128+
config: {
129+
"//": "build options, see https://goo.gl/ZhRfla"
130130
}
131131
})
132132
.then(() => {

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ environment:
1010

1111
install:
1212
- ps: Install-Product node 6 x64
13-
- node ./test/yarn.js
13+
- node ./test/vendor/yarn.js
1414

1515
build: off
1616

1717
test_script:
18-
- node ./test/yarn.js test
18+
- node ./test/vendor/yarn.js test

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- sudo apt-get install git-lfs=1.3.0
1515
- ssh git@github.com git-lfs-authenticate $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git download
1616
- git lfs pull
17-
- docker run --rm --env-file ./test/docker-env.list -v ${PWD}:/project -v ~/.electron:/root/.electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/electron-builder:$([ "$CIRCLE_NODE_INDEX" == "2" ] && echo "6" || echo "wine") /bin/bash -c "node ./test/yarn.js && node ./test/yarn.js test"
17+
- docker run --rm --env-file ./test/docker-env.list -v ${PWD}:/project -v ~/.electron:/root/.electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/electron-builder:$([ "$CIRCLE_NODE_INDEX" == "2" ] && echo "6" || echo "wine") /bin/bash -c "node ./test/vendor/yarn.js && node ./test/vendor/yarn.js test"
1818

1919
test:
2020
override:

docker/base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ENV DEBUG_COLORS true
1616
ENV FORCE_COLOR true
1717

1818
RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv dist yarn && ln -s /yarn/bin/yarn /usr/local/bin/yarn && apt-get update -y && \
19-
apt-get install --no-install-recommends -y git snapcraft xorriso bsdtar build-essential autoconf libssl-dev icnsutils graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \
19+
apt-get install --no-install-recommends -y git snapcraft qtbase5-dev xorriso bsdtar build-essential autoconf libssl-dev icnsutils graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \
2020
apt-get clean && \
2121
rm -rf /var/lib/apt/lists/* && \
2222
curl -L http://tukaani.org/xz/xz-$XZ_VERSION.tar.xz | tar -xJ && cd xz-$XZ_VERSION && ./configure && make && make install && cd .. && rm -rf xz-$XZ_VERSION && ldconfig && \

docs/Options.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Don't customize paths to background and icon, — just follow conventions.
8383
| squirrelWindows | <a name="BuildMetadata-squirrelWindows"></a>See [.build.squirrelWindows](#SquirrelWindowsOptions).
8484
| appx | <a name="BuildMetadata-appx"></a>See [.build.appx](#AppXOptions).
8585
| linux | <a name="BuildMetadata-linux"></a>See [.build.linux](#LinuxBuildOptions).
86+
| snap | <a name="BuildMetadata-snap"></a>See [.build.snap](#SnapOptions).
8687
| compression | <a name="BuildMetadata-compression"></a>The compression level, one of `store`, `normal`, `maximum` (default: `normal`). If you want to rapidly test build, `store` can reduce build time significantly.
8788
| afterPack | <a name="BuildMetadata-afterPack"></a>*programmatic API only* The function to be run after pack (but before pack into distributable format and sign). Promise must be returned.
8889
| npmRebuild | <a name="BuildMetadata-npmRebuild"></a>Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies (`npm rebuild`) before starting to package the app. Defaults to `true`.
@@ -167,7 +168,7 @@ Linux specific build options.
167168
| vendor | <a name="LinuxBuildOptions-vendor"></a>The vendor. Defaults to [author](#AppMetadata-author).
168169
| desktop | <a name="LinuxBuildOptions-desktop"></a>The [Desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) entries (name to value).
169170
| compression | <a name="LinuxBuildOptions-compression"></a>*deb-only.* The compression type, one of `gz`, `bzip2`, `xz`. Defaults to `xz`.
170-
| depends | <a name="LinuxBuildOptions-depends"></a>Package dependencies. Defaults to `["libappindicator1", "libnotify-bin"]`.
171+
| depends | <a name="LinuxBuildOptions-depends"></a>Package dependencies. Defaults to `["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]` for `deb`.
171172
| executableName | <a name="LinuxBuildOptions-executableName"></a><p>The executable name. Defaults to <code>productName</code>.</p> <p>Cannot be specified per target, allowed only in the <code>.build.linux</code>.</p>
172173

173174
<a name="MacOptions"></a>
@@ -281,6 +282,8 @@ Amazon S3 — `https` must be used, so, if you use direct Amazon S3 endpoints, f
281282
| summary | <a name="SnapOptions-summary"></a>The 78 character long summary. Defaults to [productName](#AppMetadata-productName).
282283
| grade | <a name="SnapOptions-grade"></a><p>The quality grade of the snap. It can be either <code>devel</code> (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels). Defaults to <code>stable</code>.</p>
283284
| assumes | <a name="SnapOptions-assumes"></a>The list of features that must be supported by the core in order for this snap to install.
285+
| stagePackages | <a name="SnapOptions-stagePackages"></a><p>The list of Ubuntu packages to use that are needed to support the <code>app</code> part creation. Like <code>depends</code> for <code>deb</code>. Defaults to <code>[&quot;libnotify4&quot;, &quot;libappindicator1&quot;, &quot;libxtst6&quot;, &quot;libnss3&quot;, &quot;fontconfig-config&quot;]</code>.</p>
286+
| ubuntuAppPlatformContent | <a name="SnapOptions-ubuntuAppPlatformContent"></a><p>Specify <code>ubuntu-app-platform1</code> to use [ubuntu-app-platform](https://insights.ubuntu.com/2016/11/17/how-to-create-snap-packages-on-qt-applications/). Snap size will be greatly reduced, but it is not recommended for now because “the snaps must be connected before running uitk-gallery for the first time”.</p>
284287

285288
<a name="SquirrelWindowsOptions"></a>
286289
### `.build.squirrelWindows`

docs/programmaticUsage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ builder.build({
77
platform: [builder.Platform.MAC],
88
"//": "platform, arch and other properties, see PackagerOptions in the node_modules/electron-builder/out/electron-builder.d.ts",
99
config: {
10-
"//": "build and other properties, see https://goo.gl/5jVxoO"
10+
"//": "build options, see https://goo.gl/ZhRfla"
1111
}
1212
})
1313
.then(() => {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"scripts": {
1717
"compile": "ts-babel . nsis-auto-updater test",
1818
"lint": "node ./test/lint.js",
19-
"pretest": "node ./test/yarn.js run compile && node ./test/yarn.js run lint",
19+
"pretest": "node ./test/vendor/yarn.js run compile && node ./test/vendor/yarn.js run lint",
2020
"check-deps": "node ./test/out/helpers/checkDeps.js",
2121
"test": "node ./test/out/helpers/runTests.js",
2222
"test-linux": "docker run --rm -ti -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.electron:/root/.electron electronuserland/electron-builder:wine /test.sh",
23-
"pack-updater": "cd nsis-auto-updater && node ./test/yarn.js --production && cd ..",
23+
"pack-updater": "cd nsis-auto-updater && node ./test/vendor/yarn.js --production && cd ..",
2424
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
2525
"//": "Update wiki if docs changed. Update only if functionalily are generally available (latest release, not next)",
2626
"update-wiki": "git subtree split -b wiki --prefix docs/ && git push -f wiki wiki:master",
@@ -89,7 +89,7 @@
8989
"read-installed": "^4.0.3",
9090
"sanitize-filename": "^1.6.1",
9191
"semver": "^5.3.0",
92-
"source-map-support": "^0.4.6",
92+
"source-map-support": "^0.4.8",
9393
"stat-mode": "^0.2.2",
9494
"tunnel-agent": "^0.4.3",
9595
"update-notifier": "^1.0.3",

src/metadata.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PlatformPackager } from "./platformPackager"
33
import { MacOptions, DmgOptions, MasBuildOptions } from "./options/macOptions"
44
import { Publish } from "./options/publishOptions"
55
import { WinBuildOptions, NsisOptions, SquirrelWindowsOptions, AppXOptions } from "./options/winOptions"
6-
import { LinuxBuildOptions } from "./options/linuxOptions"
6+
import { LinuxBuildOptions, SnapOptions } from "./options/linuxOptions"
77

88
export interface Metadata {
99
readonly repository?: string | RepositoryInfo | null
@@ -181,6 +181,11 @@ export interface BuildMetadata {
181181

182182
readonly deb?: LinuxBuildOptions | null
183183

184+
/*
185+
See [.build.snap](#SnapOptions).
186+
*/
187+
readonly snap?: SnapOptions | null
188+
184189
/*
185190
The compression level, one of `store`, `normal`, `maximum` (default: `normal`). If you want to rapidly test build, `store` can reduce build time significantly.
186191
*/

0 commit comments

Comments
 (0)