Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5048816e
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5048816e
编写于
10月 16, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
extract yarn electron
上级
be68a4e1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
291 addition
and
140 deletion
+291
-140
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+1
-86
build/lib/electron.js
build/lib/electron.js
+107
-20
build/lib/electron.ts
build/lib/electron.ts
+127
-0
build/lib/util.js
build/lib/util.js
+24
-14
build/lib/util.ts
build/lib/util.ts
+27
-15
package.json
package.json
+1
-0
scripts/code-cli.sh
scripts/code-cli.sh
+1
-2
scripts/code.sh
scripts/code.sh
+1
-1
scripts/node-electron.sh
scripts/node-electron.sh
+1
-1
scripts/test.sh
scripts/test.sh
+1
-1
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
5048816e
...
...
@@ -30,7 +30,7 @@ const product = require('../product.json');
const
crypto
=
require
(
'
crypto
'
);
const
i18n
=
require
(
'
./lib/i18n
'
);
const
deps
=
require
(
'
./dependencies
'
);
const
getElectronVersion
=
require
(
'
./lib/electron
'
).
getElectronVersion
;
const
{
getElectron
,
config
}
=
require
(
'
./lib/electron
'
)
;
const
createAsar
=
require
(
'
./lib/asar
'
).
createAsar
;
const
minimist
=
require
(
'
minimist
'
);
const
{
compileBuildTask
}
=
require
(
'
./gulpfile.compile
'
);
...
...
@@ -115,91 +115,6 @@ gulp.task(minifyVSCodeTask);
// Package
// @ts-ignore JSON checking: darwinCredits is optional
const
darwinCreditsTemplate
=
product
.
darwinCredits
&&
_
.
template
(
fs
.
readFileSync
(
path
.
join
(
root
,
product
.
darwinCredits
),
'
utf8
'
));
function
darwinBundleDocumentType
(
extensions
,
icon
)
{
return
{
name
:
product
.
nameLong
+
'
document
'
,
role
:
'
Editor
'
,
ostypes
:
[
"
TEXT
"
,
"
utxt
"
,
"
TUTX
"
,
"
****
"
],
extensions
:
extensions
,
iconFile
:
icon
};
}
const
config
=
{
version
:
getElectronVersion
(),
productAppName
:
product
.
nameLong
,
companyName
:
'
Microsoft Corporation
'
,
copyright
:
'
Copyright (C) 2019 Microsoft. All rights reserved
'
,
darwinIcon
:
'
resources/darwin/code.icns
'
,
darwinBundleIdentifier
:
product
.
darwinBundleIdentifier
,
darwinApplicationCategoryType
:
'
public.app-category.developer-tools
'
,
darwinHelpBookFolder
:
'
VS Code HelpBook
'
,
darwinHelpBookName
:
'
VS Code HelpBook
'
,
darwinBundleDocumentTypes
:
[
darwinBundleDocumentType
([
"
bat
"
,
"
cmd
"
],
'
resources/darwin/bat.icns
'
),
darwinBundleDocumentType
([
"
bowerrc
"
],
'
resources/darwin/bower.icns
'
),
darwinBundleDocumentType
([
"
c
"
,
"
h
"
],
'
resources/darwin/c.icns
'
),
darwinBundleDocumentType
([
"
config
"
,
"
editorconfig
"
,
"
gitattributes
"
,
"
gitconfig
"
,
"
gitignore
"
,
"
ini
"
],
'
resources/darwin/config.icns
'
),
darwinBundleDocumentType
([
"
cc
"
,
"
cpp
"
,
"
cxx
"
,
"
hh
"
,
"
hpp
"
,
"
hxx
"
],
'
resources/darwin/cpp.icns
'
),
darwinBundleDocumentType
([
"
cs
"
,
"
csx
"
],
'
resources/darwin/csharp.icns
'
),
darwinBundleDocumentType
([
"
css
"
],
'
resources/darwin/css.icns
'
),
darwinBundleDocumentType
([
"
go
"
],
'
resources/darwin/go.icns
'
),
darwinBundleDocumentType
([
"
asp
"
,
"
aspx
"
,
"
cshtml
"
,
"
htm
"
,
"
html
"
,
"
jshtm
"
,
"
jsp
"
,
"
phtml
"
,
"
shtml
"
],
'
resources/darwin/html.icns
'
),
darwinBundleDocumentType
([
"
jade
"
],
'
resources/darwin/jade.icns
'
),
darwinBundleDocumentType
([
"
jav
"
,
"
java
"
],
'
resources/darwin/java.icns
'
),
darwinBundleDocumentType
([
"
js
"
,
"
jscsrc
"
,
"
jshintrc
"
,
"
mjs
"
],
'
resources/darwin/javascript.icns
'
),
darwinBundleDocumentType
([
"
json
"
],
'
resources/darwin/json.icns
'
),
darwinBundleDocumentType
([
"
less
"
],
'
resources/darwin/less.icns
'
),
darwinBundleDocumentType
([
"
markdown
"
,
"
md
"
,
"
mdoc
"
,
"
mdown
"
,
"
mdtext
"
,
"
mdtxt
"
,
"
mdwn
"
,
"
mkd
"
,
"
mkdn
"
],
'
resources/darwin/markdown.icns
'
),
darwinBundleDocumentType
([
"
php
"
],
'
resources/darwin/php.icns
'
),
darwinBundleDocumentType
([
"
ps1
"
,
"
psd1
"
,
"
psm1
"
],
'
resources/darwin/powershell.icns
'
),
darwinBundleDocumentType
([
"
py
"
],
'
resources/darwin/python.icns
'
),
darwinBundleDocumentType
([
"
gemspec
"
,
"
rb
"
],
'
resources/darwin/ruby.icns
'
),
darwinBundleDocumentType
([
"
scss
"
],
'
resources/darwin/sass.icns
'
),
darwinBundleDocumentType
([
"
bash
"
,
"
bash_login
"
,
"
bash_logout
"
,
"
bash_profile
"
,
"
bashrc
"
,
"
profile
"
,
"
rhistory
"
,
"
rprofile
"
,
"
sh
"
,
"
zlogin
"
,
"
zlogout
"
,
"
zprofile
"
,
"
zsh
"
,
"
zshenv
"
,
"
zshrc
"
],
'
resources/darwin/shell.icns
'
),
darwinBundleDocumentType
([
"
sql
"
],
'
resources/darwin/sql.icns
'
),
darwinBundleDocumentType
([
"
ts
"
],
'
resources/darwin/typescript.icns
'
),
darwinBundleDocumentType
([
"
tsx
"
,
"
jsx
"
],
'
resources/darwin/react.icns
'
),
darwinBundleDocumentType
([
"
vue
"
],
'
resources/darwin/vue.icns
'
),
darwinBundleDocumentType
([
"
ascx
"
,
"
csproj
"
,
"
dtd
"
,
"
wxi
"
,
"
wxl
"
,
"
wxs
"
,
"
xml
"
,
"
xaml
"
],
'
resources/darwin/xml.icns
'
),
darwinBundleDocumentType
([
"
eyaml
"
,
"
eyml
"
,
"
yaml
"
,
"
yml
"
],
'
resources/darwin/yaml.icns
'
),
darwinBundleDocumentType
([
"
clj
"
,
"
cljs
"
,
"
cljx
"
,
"
clojure
"
,
"
code-workspace
"
,
"
coffee
"
,
"
ctp
"
,
"
dockerfile
"
,
"
dot
"
,
"
edn
"
,
"
fs
"
,
"
fsi
"
,
"
fsscript
"
,
"
fsx
"
,
"
handlebars
"
,
"
hbs
"
,
"
lua
"
,
"
m
"
,
"
makefile
"
,
"
ml
"
,
"
mli
"
,
"
pl
"
,
"
pl6
"
,
"
pm
"
,
"
pm6
"
,
"
pod
"
,
"
pp
"
,
"
properties
"
,
"
psgi
"
,
"
pug
"
,
"
r
"
,
"
rs
"
,
"
rt
"
,
"
svg
"
,
"
svgz
"
,
"
t
"
,
"
txt
"
,
"
vb
"
,
"
xcodeproj
"
,
"
xcworkspace
"
],
'
resources/darwin/default.icns
'
)
],
darwinBundleURLTypes
:
[{
role
:
'
Viewer
'
,
name
:
product
.
nameLong
,
urlSchemes
:
[
product
.
urlProtocol
]
}],
darwinForceDarkModeSupport
:
true
,
darwinCredits
:
darwinCreditsTemplate
?
Buffer
.
from
(
darwinCreditsTemplate
({
commit
:
commit
,
date
:
new
Date
().
toISOString
()
}))
:
undefined
,
linuxExecutableName
:
product
.
applicationName
,
winIcon
:
'
resources/win32/code.ico
'
,
token
:
process
.
env
[
'
VSCODE_MIXIN_PASSWORD
'
]
||
process
.
env
[
'
GITHUB_TOKEN
'
]
||
undefined
,
// @ts-ignore JSON checking: electronRepository is optional
repo
:
product
.
electronRepository
||
undefined
};
function
getElectron
(
arch
)
{
return
()
=>
{
const
electronOpts
=
_
.
extend
({},
config
,
{
platform
:
process
.
platform
,
arch
,
ffmpegChromium
:
true
,
keepDefaultApp
:
true
});
return
gulp
.
src
(
'
package.json
'
)
.
pipe
(
json
({
name
:
product
.
nameShort
}))
.
pipe
(
electron
(
electronOpts
))
.
pipe
(
filter
([
'
**
'
,
'
!**/app/package.json
'
]))
.
pipe
(
vfs
.
dest
(
'
.build/electron
'
));
};
}
gulp
.
task
(
task
.
define
(
'
electron
'
,
task
.
series
(
util
.
rimraf
(
'
.build/electron
'
),
getElectron
(
process
.
arch
))));
gulp
.
task
(
task
.
define
(
'
electron-ia32
'
,
task
.
series
(
util
.
rimraf
(
'
.build/electron
'
),
getElectron
(
'
ia32
'
))));
gulp
.
task
(
task
.
define
(
'
electron-x64
'
,
task
.
series
(
util
.
rimraf
(
'
.build/electron
'
),
getElectron
(
'
x64
'
))));
...
...
build/lib/electron.js
浏览文件 @
5048816e
...
...
@@ -2,29 +2,116 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
fs
=
require
(
"
fs
"
);
const
path
=
require
(
"
path
"
);
const
vfs
=
require
(
"
vinyl-fs
"
);
const
filter
=
require
(
"
gulp-filter
"
);
const
json
=
require
(
"
gulp-json-editor
"
);
const
_
=
require
(
"
underscore
"
);
const
util
=
require
(
"
./util
"
);
const
electron
=
require
(
'
gulp-atom-electron
'
);
const
root
=
path
.
dirname
(
path
.
dirname
(
__dirname
));
const
product
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
root
,
'
product.json
'
),
'
utf8
'
));
const
commit
=
util
.
getVersion
(
root
);
function
getElectronVersion
()
{
const
yarnrc
=
fs
.
readFileSync
(
path
.
join
(
root
,
'
.yarnrc
'
),
'
utf8
'
);
// @ts-ignore
const
target
=
/^target "
(
.*
)
"$/m
.
exec
(
yarnrc
)[
1
];
return
target
;
const
yarnrc
=
fs
.
readFileSync
(
path
.
join
(
root
,
'
.yarnrc
'
),
'
utf8
'
);
const
target
=
/^target "
(
.*
)
"$/m
.
exec
(
yarnrc
)[
1
];
return
target
;
}
exports
.
getElectronVersion
=
getElectronVersion
;
const
darwinCreditsTemplate
=
product
.
darwinCredits
&&
_
.
template
(
fs
.
readFileSync
(
path
.
join
(
root
,
product
.
darwinCredits
),
'
utf8
'
));
function
darwinBundleDocumentType
(
extensions
,
icon
)
{
return
{
name
:
product
.
nameLong
+
'
document
'
,
role
:
'
Editor
'
,
ostypes
:
[
"
TEXT
"
,
"
utxt
"
,
"
TUTX
"
,
"
****
"
],
extensions
:
extensions
,
iconFile
:
icon
};
}
exports
.
config
=
{
version
:
getElectronVersion
(),
productAppName
:
product
.
nameLong
,
companyName
:
'
Microsoft Corporation
'
,
copyright
:
'
Copyright (C) 2019 Microsoft. All rights reserved
'
,
darwinIcon
:
'
resources/darwin/code.icns
'
,
darwinBundleIdentifier
:
product
.
darwinBundleIdentifier
,
darwinApplicationCategoryType
:
'
public.app-category.developer-tools
'
,
darwinHelpBookFolder
:
'
VS Code HelpBook
'
,
darwinHelpBookName
:
'
VS Code HelpBook
'
,
darwinBundleDocumentTypes
:
[
darwinBundleDocumentType
([
"
bat
"
,
"
cmd
"
],
'
resources/darwin/bat.icns
'
),
darwinBundleDocumentType
([
"
bowerrc
"
],
'
resources/darwin/bower.icns
'
),
darwinBundleDocumentType
([
"
c
"
,
"
h
"
],
'
resources/darwin/c.icns
'
),
darwinBundleDocumentType
([
"
config
"
,
"
editorconfig
"
,
"
gitattributes
"
,
"
gitconfig
"
,
"
gitignore
"
,
"
ini
"
],
'
resources/darwin/config.icns
'
),
darwinBundleDocumentType
([
"
cc
"
,
"
cpp
"
,
"
cxx
"
,
"
hh
"
,
"
hpp
"
,
"
hxx
"
],
'
resources/darwin/cpp.icns
'
),
darwinBundleDocumentType
([
"
cs
"
,
"
csx
"
],
'
resources/darwin/csharp.icns
'
),
darwinBundleDocumentType
([
"
css
"
],
'
resources/darwin/css.icns
'
),
darwinBundleDocumentType
([
"
go
"
],
'
resources/darwin/go.icns
'
),
darwinBundleDocumentType
([
"
asp
"
,
"
aspx
"
,
"
cshtml
"
,
"
htm
"
,
"
html
"
,
"
jshtm
"
,
"
jsp
"
,
"
phtml
"
,
"
shtml
"
],
'
resources/darwin/html.icns
'
),
darwinBundleDocumentType
([
"
jade
"
],
'
resources/darwin/jade.icns
'
),
darwinBundleDocumentType
([
"
jav
"
,
"
java
"
],
'
resources/darwin/java.icns
'
),
darwinBundleDocumentType
([
"
js
"
,
"
jscsrc
"
,
"
jshintrc
"
,
"
mjs
"
],
'
resources/darwin/javascript.icns
'
),
darwinBundleDocumentType
([
"
json
"
],
'
resources/darwin/json.icns
'
),
darwinBundleDocumentType
([
"
less
"
],
'
resources/darwin/less.icns
'
),
darwinBundleDocumentType
([
"
markdown
"
,
"
md
"
,
"
mdoc
"
,
"
mdown
"
,
"
mdtext
"
,
"
mdtxt
"
,
"
mdwn
"
,
"
mkd
"
,
"
mkdn
"
],
'
resources/darwin/markdown.icns
'
),
darwinBundleDocumentType
([
"
php
"
],
'
resources/darwin/php.icns
'
),
darwinBundleDocumentType
([
"
ps1
"
,
"
psd1
"
,
"
psm1
"
],
'
resources/darwin/powershell.icns
'
),
darwinBundleDocumentType
([
"
py
"
],
'
resources/darwin/python.icns
'
),
darwinBundleDocumentType
([
"
gemspec
"
,
"
rb
"
],
'
resources/darwin/ruby.icns
'
),
darwinBundleDocumentType
([
"
scss
"
],
'
resources/darwin/sass.icns
'
),
darwinBundleDocumentType
([
"
bash
"
,
"
bash_login
"
,
"
bash_logout
"
,
"
bash_profile
"
,
"
bashrc
"
,
"
profile
"
,
"
rhistory
"
,
"
rprofile
"
,
"
sh
"
,
"
zlogin
"
,
"
zlogout
"
,
"
zprofile
"
,
"
zsh
"
,
"
zshenv
"
,
"
zshrc
"
],
'
resources/darwin/shell.icns
'
),
darwinBundleDocumentType
([
"
sql
"
],
'
resources/darwin/sql.icns
'
),
darwinBundleDocumentType
([
"
ts
"
],
'
resources/darwin/typescript.icns
'
),
darwinBundleDocumentType
([
"
tsx
"
,
"
jsx
"
],
'
resources/darwin/react.icns
'
),
darwinBundleDocumentType
([
"
vue
"
],
'
resources/darwin/vue.icns
'
),
darwinBundleDocumentType
([
"
ascx
"
,
"
csproj
"
,
"
dtd
"
,
"
wxi
"
,
"
wxl
"
,
"
wxs
"
,
"
xml
"
,
"
xaml
"
],
'
resources/darwin/xml.icns
'
),
darwinBundleDocumentType
([
"
eyaml
"
,
"
eyml
"
,
"
yaml
"
,
"
yml
"
],
'
resources/darwin/yaml.icns
'
),
darwinBundleDocumentType
([
"
clj
"
,
"
cljs
"
,
"
cljx
"
,
"
clojure
"
,
"
code-workspace
"
,
"
coffee
"
,
"
ctp
"
,
"
dockerfile
"
,
"
dot
"
,
"
edn
"
,
"
fs
"
,
"
fsi
"
,
"
fsscript
"
,
"
fsx
"
,
"
handlebars
"
,
"
hbs
"
,
"
lua
"
,
"
m
"
,
"
makefile
"
,
"
ml
"
,
"
mli
"
,
"
pl
"
,
"
pl6
"
,
"
pm
"
,
"
pm6
"
,
"
pod
"
,
"
pp
"
,
"
properties
"
,
"
psgi
"
,
"
pug
"
,
"
r
"
,
"
rs
"
,
"
rt
"
,
"
svg
"
,
"
svgz
"
,
"
t
"
,
"
txt
"
,
"
vb
"
,
"
xcodeproj
"
,
"
xcworkspace
"
],
'
resources/darwin/default.icns
'
)
],
darwinBundleURLTypes
:
[{
role
:
'
Viewer
'
,
name
:
product
.
nameLong
,
urlSchemes
:
[
product
.
urlProtocol
]
}],
darwinForceDarkModeSupport
:
true
,
darwinCredits
:
darwinCreditsTemplate
?
Buffer
.
from
(
darwinCreditsTemplate
({
commit
:
commit
,
date
:
new
Date
().
toISOString
()
}))
:
undefined
,
linuxExecutableName
:
product
.
applicationName
,
winIcon
:
'
resources/win32/code.ico
'
,
token
:
process
.
env
[
'
VSCODE_MIXIN_PASSWORD
'
]
||
process
.
env
[
'
GITHUB_TOKEN
'
]
||
undefined
,
repo
:
product
.
electronRepository
||
undefined
};
function
getElectron
(
arch
)
{
return
()
=>
{
const
electronOpts
=
_
.
extend
({},
exports
.
config
,
{
platform
:
process
.
platform
,
arch
,
ffmpegChromium
:
true
,
keepDefaultApp
:
true
});
return
vfs
.
src
(
'
package.json
'
)
.
pipe
(
json
({
name
:
product
.
nameShort
}))
.
pipe
(
electron
(
electronOpts
))
.
pipe
(
filter
([
'
**
'
,
'
!**/app/package.json
'
]))
.
pipe
(
vfs
.
dest
(
'
.build/electron
'
));
};
}
exports
.
getElectron
=
getElectron
;
async
function
main
()
{
const
version
=
getElectronVersion
();
const
electronPath
=
path
.
join
(
root
,
'
.build
'
,
'
electron
'
);
const
versionFile
=
path
.
join
(
electronPath
,
'
version
'
);
const
isUpToDate
=
fs
.
existsSync
(
versionFile
)
&&
fs
.
readFileSync
(
versionFile
,
'
utf8
'
)
===
`
${
version
}
`
;
if
(
!
isUpToDate
)
{
await
util
.
rimraf
(
electronPath
)();
await
util
.
streamToPromise
(
getElectron
(
process
.
arch
)());
}
}
module
.
exports
.
getElectronVersion
=
getElectronVersion
;
// returns 0 if the right version of electron is in .build/electron
// @ts-ignore
if
(
require
.
main
===
module
)
{
const
version
=
getElectronVersion
();
const
versionFile
=
path
.
join
(
root
,
'
.build
'
,
'
electron
'
,
'
version
'
);
const
isUpToDate
=
fs
.
existsSync
(
versionFile
)
&&
fs
.
readFileSync
(
versionFile
,
'
utf8
'
)
===
`
${
version
}
`
;
process
.
exit
(
isUpToDate
?
0
:
1
);
main
().
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
}
build/lib/electron.ts
0 → 100644
浏览文件 @
5048816e
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
path
from
'
path
'
;
import
*
as
vfs
from
'
vinyl-fs
'
;
import
*
as
filter
from
'
gulp-filter
'
;
import
*
as
json
from
'
gulp-json-editor
'
;
import
*
as
_
from
'
underscore
'
;
import
*
as
util
from
'
./util
'
;
const
electron
=
require
(
'
gulp-atom-electron
'
);
const
root
=
path
.
dirname
(
path
.
dirname
(
__dirname
));
const
product
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
join
(
root
,
'
product.json
'
),
'
utf8
'
));
const
commit
=
util
.
getVersion
(
root
);
export
function
getElectronVersion
():
string
{
const
yarnrc
=
fs
.
readFileSync
(
path
.
join
(
root
,
'
.yarnrc
'
),
'
utf8
'
);
const
target
=
/^target "
(
.*
)
"$/m
.
exec
(
yarnrc
)
!
[
1
];
return
target
;
}
const
darwinCreditsTemplate
=
product
.
darwinCredits
&&
_
.
template
(
fs
.
readFileSync
(
path
.
join
(
root
,
product
.
darwinCredits
),
'
utf8
'
));
function
darwinBundleDocumentType
(
extensions
:
string
[],
icon
:
string
)
{
return
{
name
:
product
.
nameLong
+
'
document
'
,
role
:
'
Editor
'
,
ostypes
:
[
"
TEXT
"
,
"
utxt
"
,
"
TUTX
"
,
"
****
"
],
extensions
:
extensions
,
iconFile
:
icon
};
}
export
const
config
=
{
version
:
getElectronVersion
(),
productAppName
:
product
.
nameLong
,
companyName
:
'
Microsoft Corporation
'
,
copyright
:
'
Copyright (C) 2019 Microsoft. All rights reserved
'
,
darwinIcon
:
'
resources/darwin/code.icns
'
,
darwinBundleIdentifier
:
product
.
darwinBundleIdentifier
,
darwinApplicationCategoryType
:
'
public.app-category.developer-tools
'
,
darwinHelpBookFolder
:
'
VS Code HelpBook
'
,
darwinHelpBookName
:
'
VS Code HelpBook
'
,
darwinBundleDocumentTypes
:
[
darwinBundleDocumentType
([
"
bat
"
,
"
cmd
"
],
'
resources/darwin/bat.icns
'
),
darwinBundleDocumentType
([
"
bowerrc
"
],
'
resources/darwin/bower.icns
'
),
darwinBundleDocumentType
([
"
c
"
,
"
h
"
],
'
resources/darwin/c.icns
'
),
darwinBundleDocumentType
([
"
config
"
,
"
editorconfig
"
,
"
gitattributes
"
,
"
gitconfig
"
,
"
gitignore
"
,
"
ini
"
],
'
resources/darwin/config.icns
'
),
darwinBundleDocumentType
([
"
cc
"
,
"
cpp
"
,
"
cxx
"
,
"
hh
"
,
"
hpp
"
,
"
hxx
"
],
'
resources/darwin/cpp.icns
'
),
darwinBundleDocumentType
([
"
cs
"
,
"
csx
"
],
'
resources/darwin/csharp.icns
'
),
darwinBundleDocumentType
([
"
css
"
],
'
resources/darwin/css.icns
'
),
darwinBundleDocumentType
([
"
go
"
],
'
resources/darwin/go.icns
'
),
darwinBundleDocumentType
([
"
asp
"
,
"
aspx
"
,
"
cshtml
"
,
"
htm
"
,
"
html
"
,
"
jshtm
"
,
"
jsp
"
,
"
phtml
"
,
"
shtml
"
],
'
resources/darwin/html.icns
'
),
darwinBundleDocumentType
([
"
jade
"
],
'
resources/darwin/jade.icns
'
),
darwinBundleDocumentType
([
"
jav
"
,
"
java
"
],
'
resources/darwin/java.icns
'
),
darwinBundleDocumentType
([
"
js
"
,
"
jscsrc
"
,
"
jshintrc
"
,
"
mjs
"
],
'
resources/darwin/javascript.icns
'
),
darwinBundleDocumentType
([
"
json
"
],
'
resources/darwin/json.icns
'
),
darwinBundleDocumentType
([
"
less
"
],
'
resources/darwin/less.icns
'
),
darwinBundleDocumentType
([
"
markdown
"
,
"
md
"
,
"
mdoc
"
,
"
mdown
"
,
"
mdtext
"
,
"
mdtxt
"
,
"
mdwn
"
,
"
mkd
"
,
"
mkdn
"
],
'
resources/darwin/markdown.icns
'
),
darwinBundleDocumentType
([
"
php
"
],
'
resources/darwin/php.icns
'
),
darwinBundleDocumentType
([
"
ps1
"
,
"
psd1
"
,
"
psm1
"
],
'
resources/darwin/powershell.icns
'
),
darwinBundleDocumentType
([
"
py
"
],
'
resources/darwin/python.icns
'
),
darwinBundleDocumentType
([
"
gemspec
"
,
"
rb
"
],
'
resources/darwin/ruby.icns
'
),
darwinBundleDocumentType
([
"
scss
"
],
'
resources/darwin/sass.icns
'
),
darwinBundleDocumentType
([
"
bash
"
,
"
bash_login
"
,
"
bash_logout
"
,
"
bash_profile
"
,
"
bashrc
"
,
"
profile
"
,
"
rhistory
"
,
"
rprofile
"
,
"
sh
"
,
"
zlogin
"
,
"
zlogout
"
,
"
zprofile
"
,
"
zsh
"
,
"
zshenv
"
,
"
zshrc
"
],
'
resources/darwin/shell.icns
'
),
darwinBundleDocumentType
([
"
sql
"
],
'
resources/darwin/sql.icns
'
),
darwinBundleDocumentType
([
"
ts
"
],
'
resources/darwin/typescript.icns
'
),
darwinBundleDocumentType
([
"
tsx
"
,
"
jsx
"
],
'
resources/darwin/react.icns
'
),
darwinBundleDocumentType
([
"
vue
"
],
'
resources/darwin/vue.icns
'
),
darwinBundleDocumentType
([
"
ascx
"
,
"
csproj
"
,
"
dtd
"
,
"
wxi
"
,
"
wxl
"
,
"
wxs
"
,
"
xml
"
,
"
xaml
"
],
'
resources/darwin/xml.icns
'
),
darwinBundleDocumentType
([
"
eyaml
"
,
"
eyml
"
,
"
yaml
"
,
"
yml
"
],
'
resources/darwin/yaml.icns
'
),
darwinBundleDocumentType
([
"
clj
"
,
"
cljs
"
,
"
cljx
"
,
"
clojure
"
,
"
code-workspace
"
,
"
coffee
"
,
"
ctp
"
,
"
dockerfile
"
,
"
dot
"
,
"
edn
"
,
"
fs
"
,
"
fsi
"
,
"
fsscript
"
,
"
fsx
"
,
"
handlebars
"
,
"
hbs
"
,
"
lua
"
,
"
m
"
,
"
makefile
"
,
"
ml
"
,
"
mli
"
,
"
pl
"
,
"
pl6
"
,
"
pm
"
,
"
pm6
"
,
"
pod
"
,
"
pp
"
,
"
properties
"
,
"
psgi
"
,
"
pug
"
,
"
r
"
,
"
rs
"
,
"
rt
"
,
"
svg
"
,
"
svgz
"
,
"
t
"
,
"
txt
"
,
"
vb
"
,
"
xcodeproj
"
,
"
xcworkspace
"
],
'
resources/darwin/default.icns
'
)
],
darwinBundleURLTypes
:
[{
role
:
'
Viewer
'
,
name
:
product
.
nameLong
,
urlSchemes
:
[
product
.
urlProtocol
]
}],
darwinForceDarkModeSupport
:
true
,
darwinCredits
:
darwinCreditsTemplate
?
Buffer
.
from
(
darwinCreditsTemplate
({
commit
:
commit
,
date
:
new
Date
().
toISOString
()
}))
:
undefined
,
linuxExecutableName
:
product
.
applicationName
,
winIcon
:
'
resources/win32/code.ico
'
,
token
:
process
.
env
[
'
VSCODE_MIXIN_PASSWORD
'
]
||
process
.
env
[
'
GITHUB_TOKEN
'
]
||
undefined
,
repo
:
product
.
electronRepository
||
undefined
};
export
function
getElectron
(
arch
:
string
):
()
=>
NodeJS
.
ReadWriteStream
{
return
()
=>
{
const
electronOpts
=
_
.
extend
({},
config
,
{
platform
:
process
.
platform
,
arch
,
ffmpegChromium
:
true
,
keepDefaultApp
:
true
});
return
vfs
.
src
(
'
package.json
'
)
.
pipe
(
json
({
name
:
product
.
nameShort
}))
.
pipe
(
electron
(
electronOpts
))
.
pipe
(
filter
([
'
**
'
,
'
!**/app/package.json
'
]))
.
pipe
(
vfs
.
dest
(
'
.build/electron
'
));
};
}
async
function
main
():
Promise
<
void
>
{
const
version
=
getElectronVersion
();
const
electronPath
=
path
.
join
(
root
,
'
.build
'
,
'
electron
'
);
const
versionFile
=
path
.
join
(
electronPath
,
'
version
'
);
const
isUpToDate
=
fs
.
existsSync
(
versionFile
)
&&
fs
.
readFileSync
(
versionFile
,
'
utf8
'
)
===
`
${
version
}
`
;
if
(
!
isUpToDate
)
{
await
util
.
rimraf
(
electronPath
)();
await
util
.
streamToPromise
(
getElectron
(
process
.
arch
)());
}
}
if
(
require
.
main
===
module
)
{
main
().
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
}
build/lib/util.js
浏览文件 @
5048816e
...
...
@@ -166,20 +166,23 @@ function stripSourceMappingURL() {
}
exports
.
stripSourceMappingURL
=
stripSourceMappingURL
;
function
rimraf
(
dir
)
{
let
retries
=
0
;
const
retry
=
(
cb
)
=>
{
_rimraf
(
dir
,
{
maxBusyTries
:
1
},
(
err
)
=>
{
if
(
!
err
)
{
return
cb
();
}
if
(
err
.
code
===
'
ENOTEMPTY
'
&&
++
retries
<
5
)
{
return
setTimeout
(()
=>
retry
(
cb
),
10
);
}
return
cb
(
err
);
});
};
retry
.
taskName
=
`clean-
${
path
.
basename
(
dir
).
toLowerCase
()}
`
;
return
retry
;
const
result
=
()
=>
new
Promise
((
c
,
e
)
=>
{
let
retries
=
0
;
const
retry
=
()
=>
{
_rimraf
(
dir
,
{
maxBusyTries
:
1
},
(
err
)
=>
{
if
(
!
err
)
{
return
c
();
}
if
(
err
.
code
===
'
ENOTEMPTY
'
&&
++
retries
<
5
)
{
return
setTimeout
(()
=>
retry
(),
10
);
}
return
e
(
err
);
});
};
retry
();
});
result
.
taskName
=
`clean-
${
path
.
basename
(
dir
).
toLowerCase
()}
`
;
return
result
;
}
exports
.
rimraf
=
rimraf
;
function
getVersion
(
root
)
{
...
...
@@ -219,3 +222,10 @@ function versionStringToNumber(versionStr) {
return
parseInt
(
match
[
1
],
10
)
*
1
e4
+
parseInt
(
match
[
2
],
10
)
*
1
e2
+
parseInt
(
match
[
3
],
10
);
}
exports
.
versionStringToNumber
=
versionStringToNumber
;
function
streamToPromise
(
stream
)
{
return
new
Promise
((
c
,
e
)
=>
{
stream
.
on
(
'
error
'
,
err
=>
e
(
err
));
stream
.
on
(
'
end
'
,
()
=>
c
());
});
}
exports
.
streamToPromise
=
streamToPromise
;
build/lib/util.ts
浏览文件 @
5048816e
...
...
@@ -218,24 +218,29 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
return
es
.
duplex
(
input
,
output
);
}
export
function
rimraf
(
dir
:
string
):
(
cb
:
any
)
=>
void
{
let
retries
=
0
;
export
function
rimraf
(
dir
:
string
):
()
=>
Promise
<
void
>
{
const
result
=
()
=>
new
Promise
<
void
>
((
c
,
e
)
=>
{
let
retries
=
0
;
const
retry
=
(
cb
:
(
err
?:
any
)
=>
void
)
=>
{
_rimraf
(
dir
,
{
maxBusyTries
:
1
},
(
err
:
any
)
=>
{
if
(
!
err
)
{
return
cb
();
}
const
retry
=
(
)
=>
{
_rimraf
(
dir
,
{
maxBusyTries
:
1
},
(
err
:
any
)
=>
{
if
(
!
err
)
{
return
c
();
}
if
(
err
.
code
===
'
ENOTEMPTY
'
&&
++
retries
<
5
)
{
return
setTimeout
(()
=>
retry
(
cb
),
10
);
}
if
(
err
.
code
===
'
ENOTEMPTY
'
&&
++
retries
<
5
)
{
return
setTimeout
(()
=>
retry
(
),
10
);
}
return
cb
(
err
);
});
};
retry
.
taskName
=
`clean-
${
path
.
basename
(
dir
).
toLowerCase
()}
`
;
return
retry
;
return
e
(
err
);
});
};
retry
();
});
result
.
taskName
=
`clean-
${
path
.
basename
(
dir
).
toLowerCase
()}
`
;
return
result
;
}
export
function
getVersion
(
root
:
string
):
string
|
undefined
{
...
...
@@ -281,3 +286,10 @@ export function versionStringToNumber(versionStr: string) {
return
parseInt
(
match
[
1
],
10
)
*
1
e4
+
parseInt
(
match
[
2
],
10
)
*
1
e2
+
parseInt
(
match
[
3
],
10
);
}
export
function
streamToPromise
(
stream
:
NodeJS
.
ReadWriteStream
):
Promise
<
void
>
{
return
new
Promise
((
c
,
e
)
=>
{
stream
.
on
(
'
error
'
,
err
=>
e
(
err
));
stream
.
on
(
'
end
'
,
()
=>
c
());
});
}
package.json
浏览文件 @
5048816e
...
...
@@ -18,6 +18,7 @@
"monaco-editor-test"
:
"mocha --only-monaco-editor"
,
"precommit"
:
"node build/gulpfile.hygiene.js"
,
"gulp"
:
"gulp --max_old_space_size=8192"
,
"electron"
:
"node build/lib/electron"
,
"7z"
:
"7z"
,
"update-grammars"
:
"node build/npm/update-all-grammars.js"
,
"update-localization-extension"
:
"node build/npm/update-localization-extension.js"
,
...
...
scripts/code-cli.sh
浏览文件 @
5048816e
...
...
@@ -22,8 +22,7 @@ function code() {
test
-d
node_modules
||
yarn
# Get electron
node build/lib/electron.js
||
./node_modules/.bin/gulp electron
yarn electron
# Manage built-in extensions
if
[[
"
$1
"
==
"--builtin"
]]
;
then
...
...
scripts/code.sh
浏览文件 @
5048816e
...
...
@@ -27,7 +27,7 @@ function code() {
test
-d
node_modules
||
yarn
# Get electron
node build/lib/electron.js
||
./node_modules/.bin/gulp
electron
yarn
electron
# Manage built-in extensions
if
[[
"
$1
"
==
"--builtin"
]]
;
then
...
...
scripts/node-electron.sh
浏览文件 @
5048816e
...
...
@@ -18,7 +18,7 @@ else
fi
# Get electron
node build/lib/electron.js
||
./node_modules/.bin/gulp
electron
yarn
electron
popd
...
...
scripts/test.sh
浏览文件 @
5048816e
...
...
@@ -22,7 +22,7 @@ fi
test
-d
node_modules
||
yarn
# Get electron
node build/lib/electron.js
||
./node_modules/.bin/gulp
electron
yarn
electron
# Unit Tests
if
[[
"
$OSTYPE
"
==
"darwin"
*
]]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录