Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d2b2b4d7
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d2b2b4d7
编写于
9月 26, 2017
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for building x64 snap package
上级
a38d660a
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
155 addition
and
17 deletion
+155
-17
.editorconfig
.editorconfig
+1
-1
build/gulpfile.hygiene.js
build/gulpfile.hygiene.js
+21
-15
build/gulpfile.vscode.linux.js
build/gulpfile.vscode.linux.js
+51
-0
resources/linux/code.desktop
resources/linux/code.desktop
+1
-1
resources/linux/snap/electron-launch
resources/linux/snap/electron-launch
+30
-0
resources/linux/snap/snapcraft.yaml
resources/linux/snap/snapcraft.yaml
+51
-0
未找到文件。
.editorconfig
浏览文件 @
d2b2b4d7
...
...
@@ -11,6 +11,6 @@ trim_trailing_whitespace = true
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{
.travis.yml,npm-shrinkwrap.json,package.json,snapcraft.yaml
}]
[{
*.yml,*.yaml,npm-shrinkwrap.json,package.json
}]
indent_style = space
indent_size = 2
build/gulpfile.hygiene.js
浏览文件 @
d2b2b4d7
...
...
@@ -6,6 +6,7 @@
'
use strict
'
;
const
gulp
=
require
(
'
gulp
'
);
const
path
=
require
(
'
path
'
);
const
filter
=
require
(
'
gulp-filter
'
);
const
es
=
require
(
'
event-stream
'
);
const
gulptslint
=
require
(
'
gulp-tslint
'
);
...
...
@@ -172,6 +173,10 @@ const hygiene = exports.hygiene = (some, options) => {
});
const
indentation
=
es
.
through
(
function
(
file
)
{
// Only do the indentation check for non-YAML files as they forbid tabs
// for indentation
const
extname
=
path
.
extname
(
file
.
relative
);
if
(
extname
!==
'
.yaml
'
&&
extname
!==
'
.yml
'
)
{
file
.
contents
.
toString
(
'
utf8
'
)
.
split
(
/
\r\n
|
\r
|
\n
/
)
...
...
@@ -187,6 +192,7 @@ const hygiene = exports.hygiene = (some, options) => {
errorCount
++
;
}
});
}
this
.
emit
(
'
data
'
,
file
);
});
...
...
build/gulpfile.vscode.linux.js
浏览文件 @
d2b2b4d7
...
...
@@ -55,6 +55,7 @@ function prepareDebPackage(arch) {
.
pipe
(
replace
(
'
@@NAME_LONG@@
'
,
product
.
nameLong
))
.
pipe
(
replace
(
'
@@NAME_SHORT@@
'
,
product
.
nameShort
))
.
pipe
(
replace
(
'
@@NAME@@
'
,
product
.
applicationName
))
.
pipe
(
replace
(
'
@@ICON@@
'
,
product
.
applicationName
))
.
pipe
(
rename
(
'
usr/share/applications/
'
+
product
.
applicationName
+
'
.desktop
'
));
const
appdata
=
gulp
.
src
(
'
resources/linux/code.appdata.xml
'
,
{
base
:
'
.
'
})
...
...
@@ -131,6 +132,7 @@ function prepareRpmPackage(arch) {
.
pipe
(
replace
(
'
@@NAME_LONG@@
'
,
product
.
nameLong
))
.
pipe
(
replace
(
'
@@NAME_SHORT@@
'
,
product
.
nameShort
))
.
pipe
(
replace
(
'
@@NAME@@
'
,
product
.
applicationName
))
.
pipe
(
replace
(
'
@@ICON@@
'
,
product
.
applicationName
))
.
pipe
(
rename
(
'
BUILD/usr/share/applications/
'
+
product
.
applicationName
+
'
.desktop
'
));
const
appdata
=
gulp
.
src
(
'
resources/linux/code.appdata.xml
'
,
{
base
:
'
.
'
})
...
...
@@ -178,6 +180,51 @@ function buildRpmPackage(arch) {
'
cp "
'
+
rpmOut
+
'
/$(ls
'
+
rpmOut
+
'
)"
'
+
destination
+
'
/
'
]);
}
function
getSnapBuildPath
(
arch
)
{
return
`.build/linux/snap/
${
arch
}
/
${
product
.
applicationName
}
-
${
arch
}
`
;
}
function
prepareSnapPackage
(
arch
)
{
const
binaryDir
=
'
../VSCode-linux-
'
+
arch
;
const
destination
=
getSnapBuildPath
(
arch
);
return
function
()
{
const
desktop
=
gulp
.
src
(
'
resources/linux/code.desktop
'
,
{
base
:
'
.
'
})
.
pipe
(
replace
(
'
@@NAME_LONG@@
'
,
product
.
nameLong
))
.
pipe
(
replace
(
'
@@NAME_SHORT@@
'
,
product
.
nameShort
))
.
pipe
(
replace
(
'
@@NAME@@
'
,
product
.
applicationName
))
.
pipe
(
replace
(
'
@@ICON@@
'
,
`/usr/share/pixmaps/
${
product
.
applicationName
}
.png`
))
.
pipe
(
rename
(
`usr/share/applications/
${
product
.
applicationName
}
.desktop`
));
const
icon
=
gulp
.
src
(
'
resources/linux/code.png
'
,
{
base
:
'
.
'
})
.
pipe
(
rename
(
`usr/share/pixmaps/
${
product
.
applicationName
}
.png`
));
const
code
=
gulp
.
src
(
binaryDir
+
'
/**/*
'
,
{
base
:
binaryDir
})
.
pipe
(
rename
(
function
(
p
)
{
p
.
dirname
=
'
usr/share/
'
+
product
.
applicationName
+
'
/
'
+
p
.
dirname
;
}));
const
snapcraft
=
gulp
.
src
(
'
resources/linux/snap/snapcraft.yaml
'
,
{
base
:
'
.
'
})
.
pipe
(
replace
(
'
@@NAME@@
'
,
product
.
applicationName
))
.
pipe
(
replace
(
'
@@VERSION@@
'
,
packageJson
.
version
))
.
pipe
(
replace
(
'
@@EPOCH@@
'
,
linuxPackageRevision
))
.
pipe
(
rename
(
'
snap/snapcraft.yaml
'
));
const
electronLaunch
=
gulp
.
src
(
'
resources/linux/snap/electron-launch
'
,
{
base
:
'
.
'
})
.
pipe
(
rename
(
'
electron-launch
'
));
const
all
=
es
.
merge
(
desktop
,
icon
,
code
,
snapcraft
,
electronLaunch
);
return
all
.
pipe
(
vfs
.
dest
(
destination
));
};
}
function
buildSnapPackage
(
arch
)
{
const
snapBuildPath
=
getSnapBuildPath
(
arch
);
return
shell
.
task
([
`chmod +x
${
snapBuildPath
}
/electron-launch`
,
`cd
${
snapBuildPath
}
&& snapcraft snap`
]);
}
function
getFlatpakArch
(
arch
)
{
return
{
x64
:
'
x86_64
'
,
ia32
:
'
i386
'
,
arm
:
'
arm
'
}[
arch
];
...
...
@@ -273,6 +320,10 @@ gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buil
gulp
.
task
(
'
vscode-linux-x64-build-rpm
'
,
[
'
vscode-linux-x64-prepare-rpm
'
],
buildRpmPackage
(
'
x64
'
));
gulp
.
task
(
'
vscode-linux-arm-build-rpm
'
,
[
'
vscode-linux-arm-prepare-rpm
'
],
buildRpmPackage
(
'
arm
'
));
gulp
.
task
(
'
clean-vscode-linux-x64-snap
'
,
util
.
rimraf
(
'
.build/linux/snap/x64
'
));
gulp
.
task
(
'
vscode-linux-x64-prepare-snap
'
,
[
'
clean-vscode-linux-x64-snap
'
],
prepareSnapPackage
(
'
x64
'
));
gulp
.
task
(
'
vscode-linux-x64-build-snap
'
,
[
'
vscode-linux-x64-prepare-snap
'
],
buildSnapPackage
(
'
x64
'
));
gulp
.
task
(
'
clean-vscode-linux-ia32-flatpak
'
,
util
.
rimraf
(
'
.build/linux/flatpak/i386
'
));
gulp
.
task
(
'
clean-vscode-linux-x64-flatpak
'
,
util
.
rimraf
(
'
.build/linux/flatpak/x86_64
'
));
gulp
.
task
(
'
clean-vscode-linux-arm-flatpak
'
,
util
.
rimraf
(
'
.build/linux/flatpak/arm
'
));
...
...
resources/linux/code.desktop
浏览文件 @
d2b2b4d7
...
...
@@ -3,7 +3,7 @@ Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %F
Icon=@@
NAME
@@
Icon=@@
ICON
@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
...
...
resources/linux/snap/electron-launch
0 → 100644
浏览文件 @
d2b2b4d7
#!/bin/sh
if
test
"
$1
"
=
"classic"
;
then
shift
case
$SNAP_ARCH
in
amd64
)
TRIPLET
=
"x86_64-linux-gnu"
;;
armhf
)
TRIPLET
=
"arm-linux-gnueabihf"
;;
arm64
)
TRIPLET
=
"aarch64-linux-gnu"
;;
*
)
TRIPLET
=
"
$(
uname
-p
)
-linux-gnu"
;;
esac
# TODO: Swap LD lib paths whenever processes are launched
export
LD_LIBRARY_PATH_OLD
=
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
$SNAP
/usr/lib:
$SNAP
/usr/lib/
$TRIPLET
:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
$SNAP
/lib:
$SNAP
/lib/
$TRIPLET
:
$LD_LIBRARY_PATH
fi
# Correct the TMPDIR path for Chromium Framework/Electron to ensure
# libappindicator has readable resources.
export
TMPDIR
=
$XDG_RUNTIME_DIR
exec
${
SNAP
}
/bin/desktop-launch
$@
resources/linux/snap/snapcraft.yaml
0 → 100644
浏览文件 @
d2b2b4d7
name
:
@@
NAME@@
version
:
@@
VERSION@@
epoch
:
@@
EPOCH@@
summary
:
Code editing. Redefined.
description
:
|
Visual Studio Code is a new choice of tool that combines the
simplicity of a code editor with what developers need for the core
edit-build-debug cycle.
grade
:
stable
confinement
:
classic
parts
:
code
:
plugin
:
dump
source
:
.
# source: https://az764295.vo.msecnd.net/stable/27492b6bf3acb0775d82d2f87b25a93490673c6d/code_1.16.1-1505406497_amd64.deb
# source-type: deb
# Correct path to icon.
# Remove translated Name[xx]=
# - Due to http://pad.lv/1662456
# prepare: |
# sed -i 's|Icon=.code|Icon=/usr/share/pixmaps/code\.png|g' usr/share/applications/code.desktop
# sed -i '/^Name\[/d' usr/share/applications/code.desktop
after
:
-
desktop-gtk2
stage-packages
:
-
gconf2
-
libasound2
-
libnotify4
-
libnspr4
-
libnss3
-
libpulse0
-
libxss1
-
libxtst6
prime
:
-
-usr/share/dh-python
electron-launch
:
plugin
:
dump
source
:
.
organize
:
electron-launch
:
bin/electron-launch
prime
:
-
-monitor.sh
-
-OLD_VERSION
-
-*.bz2
apps
:
@@
NAME@@
:
command
:
bin/electron-launch classic ${SNAP}/usr/share/@@NAME@@/bin/@@NAME@@
desktop
:
usr/share/applications/@@NAME@@.desktop
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录