Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f794ad0a
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,发现更多精彩内容 >>
提交
f794ad0a
编写于
5月 13, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'joao/next'
上级
14206913
a477e1ea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
157 addition
and
53 deletion
+157
-53
build/.nativeignore
build/.nativeignore
+111
-0
build/azure-pipelines/product-build.yml
build/azure-pipelines/product-build.yml
+4
-2
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+2
-19
build/lib/util.js
build/lib/util.js
+9
-14
build/lib/util.ts
build/lib/util.ts
+11
-13
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+2
-2
src/vs/code/node/shellEnv.ts
src/vs/code/node/shellEnv.ts
+18
-3
未找到文件。
build/.nativeignore
0 → 100644
浏览文件 @
f794ad0a
# cleanup rules for native node modules, .gitignore style
fsevents/binding.gyp
fsevents/fsevents.cc
fsevents/build/**
fsevents/src/**
fsevents/test/**
!fsevents/**/*.node
vscode-sqlite3/binding.gyp
vscode-sqlite3/benchmark/**
vscode-sqlite3/cloudformation/**
vscode-sqlite3/deps/**
vscode-sqlite3/test/**
vscode-sqlite3/build/**
vscode-sqlite3/src/**
!vscode-sqlite3/build/Release/*.node
oniguruma/binding.gyp
oniguruma/build/**
oniguruma/src/**
oniguruma/deps/**
!oniguruma/build/Release/*.node
!oniguruma/src/*.js
windows-mutex/binding.gyp
windows-mutex/build/**
windows-mutex/src/**
!windows-mutex/**/*.node
native-keymap/binding.gyp
native-keymap/build/**
native-keymap/src/**
native-keymap/deps/**
!native-keymap/build/Release/*.node
native-is-elevated/binding.gyp
native-is-elevated/build/**
native-is-elevated/src/**
native-is-elevated/deps/**
!native-is-elevated/build/Release/*.node
native-watchdog/binding.gyp
native-watchdog/build/**
native-watchdog/src/**
!native-watchdog/build/Release/*.node
spdlog/binding.gyp
spdlog/build/**
spdlog/deps/**
spdlog/src/**
spdlog/test/**
!spdlog/build/Release/*.node
jschardet/dist/**
windows-foreground-love/binding.gyp
windows-foreground-love/build/**
windows-foreground-love/src/**
!windows-foreground-love/**/*.node
windows-process-tree/binding.gyp
windows-process-tree/build/**
windows-process-tree/src/**
!windows-process-tree/**/*.node
gc-signals/binding.gyp
gc-signals/build/**
gc-signals/src/**
gc-signals/deps/**
!gc-signals/build/Release/*.node
!gc-signals/src/index.js
keytar/binding.gyp
keytar/build/**
keytar/src/**
keytar/script/**
keytar/node_modules/**
!keytar/**/*.node
node-pty/binding.gyp
node-pty/build/**
node-pty/src/**
node-pty/tools/**
!node-pty/build/Release/*.exe
!node-pty/build/Release/*.dll
!node-pty/build/Release/*.node
vscode-nsfw/binding.gyp
vscode-nsfw/build/**
vscode-nsfw/src/**
vscode-nsfw/openpa/**
vscode-nsfw/includes/**
!vscode-nsfw/build/Release/*.node
!vscode-nsfw/**/*.a
vsda/binding.gyp
vsda/README.md
vsda/build/**
vsda/*.bat
vsda/*.sh
vsda/*.cpp
vsda/*.h
!vsda/build/Release/vsda.node
vscode-windows-ca-certs/**/*
!vscode-windows-ca-certs/package.json
!vscode-windows-ca-certs/**/*.node
node-addon-api/**/*
\ No newline at end of file
build/azure-pipelines/product-build.yml
浏览文件 @
f794ad0a
resources
:
containers
:
-
container
:
vscode-x64
image
:
joaomoreno/vscode-linux-build-agent:x64
endpoint
:
VSCodeHub
image
:
vscodehub.azurecr.io/vscode-linux-build-agent:x64
-
container
:
vscode-ia32
image
:
joaomoreno/vscode-linux-build-agent:ia32
endpoint
:
VSCodeHub
image
:
vscodehub.azurecr.io/vscode-linux-build-agent:ia32
-
container
:
snapcraft
image
:
snapcore/snapcraft
...
...
build/gulpfile.vscode.js
浏览文件 @
f794ad0a
...
...
@@ -323,28 +323,11 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const
deps
=
gulp
.
src
(
depsSrc
,
{
base
:
'
.
'
,
dot
:
true
})
.
pipe
(
filter
([
'
**
'
,
'
!**/package-lock.json
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
fsevents
'
,
[
'
binding.gyp
'
,
'
fsevents.cc
'
,
'
build/**
'
,
'
src/**
'
,
'
test/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
vscode-sqlite3
'
,
[
'
binding.gyp
'
,
'
benchmark/**
'
,
'
cloudformation/**
'
,
'
deps/**
'
,
'
test/**
'
,
'
build/**
'
,
'
src/**
'
],
[
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
oniguruma
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/*.node
'
,
'
src/*.js
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-mutex
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
native-keymap
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
native-is-elevated
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
native-watchdog
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
spdlog
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
deps/**
'
,
'
src/**
'
,
'
test/**
'
],
[
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
jschardet
'
,
[
'
dist/**
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-foreground-love
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-process-tree
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
gc-signals
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/*.node
'
,
'
src/index.js
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
keytar
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
script/**
'
,
'
node_modules/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
node-pty
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
tools/**
'
],
[
'
build/Release/*.exe
'
,
'
build/Release/*.dll
'
,
'
build/Release/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
vscode-nsfw
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
openpa/**
'
,
'
includes/**
'
],
[
'
build/Release/*.node
'
,
'
**/*.a
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
vsda
'
,
[
'
binding.gyp
'
,
'
README.md
'
,
'
build/**
'
,
'
*.bat
'
,
'
*.sh
'
,
'
*.cpp
'
,
'
*.h
'
],
[
'
build/Release/vsda.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
vscode-windows-ca-certs
'
,
[
'
**/*
'
],
[
'
package.json
'
,
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
node-addon-api
'
,
[
'
**/*
'
]))
.
pipe
(
util
.
cleanNodeModules
(
path
.
join
(
__dirname
,
'
.nativeignore
'
)))
.
pipe
(
createAsar
(
path
.
join
(
process
.
cwd
(),
'
node_modules
'
),
[
'
**/*.node
'
,
'
**/vscode-ripgrep/bin/*
'
,
'
**/node-pty/build/Release/*
'
],
'
app/node_modules.asar
'
));
let
all
=
es
.
merge
(
packageJsonStream
,
packageJsonStream
,
productJsonStream
,
license
,
api
,
...
...
build/lib/util.js
浏览文件 @
f794ad0a
...
...
@@ -8,7 +8,6 @@ const es = require("event-stream");
const
debounce
=
require
(
"
debounce
"
);
const
_filter
=
require
(
"
gulp-filter
"
);
const
rename
=
require
(
"
gulp-rename
"
);
const
_
=
require
(
"
underscore
"
);
const
path
=
require
(
"
path
"
);
const
fs
=
require
(
"
fs
"
);
const
_rimraf
=
require
(
"
rimraf
"
);
...
...
@@ -100,22 +99,18 @@ function skipDirectories() {
});
}
exports
.
skipDirectories
=
skipDirectories
;
function
cleanNodeModule
(
name
,
excludes
,
includes
)
{
const
toGlob
=
(
path
)
=>
'
**/node_modules/
'
+
name
+
(
path
?
'
/
'
+
path
:
''
);
const
negate
=
(
str
)
=>
'
!
'
+
str
;
const
allFilter
=
_filter
(
toGlob
(
'
**
'
),
{
restore
:
true
});
const
globs
=
[
toGlob
(
'
**
'
)].
concat
(
excludes
.
map
(
_
.
compose
(
negate
,
toGlob
)));
function
cleanNodeModules
(
rulePath
)
{
const
rules
=
fs
.
readFileSync
(
rulePath
,
'
utf8
'
)
.
split
(
/
\r?\n
/g
)
.
map
(
line
=>
line
.
trim
())
.
filter
(
line
=>
line
&&
!
/^#/
.
test
(
line
));
const
excludes
=
rules
.
filter
(
line
=>
!
/^!/
.
test
(
line
)).
map
(
line
=>
`!**/node_modules/
${
line
}
`
);
const
includes
=
rules
.
filter
(
line
=>
/^!/
.
test
(
line
)).
map
(
line
=>
`**/node_modules/
${
line
.
substr
(
1
)}
`
);
const
input
=
es
.
through
();
const
nodeModuleInput
=
input
.
pipe
(
allFilter
);
let
output
=
nodeModuleInput
.
pipe
(
_filter
(
globs
));
if
(
includes
)
{
const
includeGlobs
=
includes
.
map
(
toGlob
);
output
=
es
.
merge
(
output
,
nodeModuleInput
.
pipe
(
_filter
(
includeGlobs
)));
}
output
=
output
.
pipe
(
allFilter
.
restore
);
const
output
=
es
.
merge
(
input
.
pipe
(
_filter
([
'
**
'
,
...
excludes
])),
input
.
pipe
(
_filter
(
includes
)));
return
es
.
duplex
(
input
,
output
);
}
exports
.
cleanNodeModule
=
cleanNodeModule
;
exports
.
cleanNodeModule
s
=
cleanNodeModules
;
function
loadSourcemaps
()
{
const
input
=
es
.
through
();
const
output
=
input
...
...
build/lib/util.ts
浏览文件 @
f794ad0a
...
...
@@ -132,23 +132,21 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
});
}
export
function
cleanNodeModule
(
name
:
string
,
excludes
:
string
[],
includes
?:
string
[]):
NodeJS
.
ReadWriteStream
{
const
toGlob
=
(
path
:
string
)
=>
'
**/node_modules/
'
+
name
+
(
path
?
'
/
'
+
path
:
''
);
const
negate
=
(
str
:
string
)
=>
'
!
'
+
str
;
export
function
cleanNodeModules
(
rulePath
:
string
):
NodeJS
.
ReadWriteStream
{
const
rules
=
fs
.
readFileSync
(
rulePath
,
'
utf8
'
)
.
split
(
/
\r?\n
/g
)
.
map
(
line
=>
line
.
trim
())
.
filter
(
line
=>
line
&&
!
/^#/
.
test
(
line
));
const
allFilter
=
_filter
(
toGlob
(
'
**
'
),
{
restore
:
true
}
);
const
globs
=
[
toGlob
(
'
**
'
)].
concat
(
excludes
.
map
(
_
.
compose
(
negate
,
toGlob
)
as
(
x
:
string
)
=>
string
)
);
const
excludes
=
rules
.
filter
(
line
=>
!
/^!/
.
test
(
line
)).
map
(
line
=>
`!**/node_modules/
${
line
}
`
);
const
includes
=
rules
.
filter
(
line
=>
/^!/
.
test
(
line
)).
map
(
line
=>
`**/node_modules/
${
line
.
substr
(
1
)}
`
);
const
input
=
es
.
through
();
const
nodeModuleInput
=
input
.
pipe
(
allFilter
);
let
output
:
NodeJS
.
ReadWriteStream
=
nodeModuleInput
.
pipe
(
_filter
(
globs
));
const
output
=
es
.
merge
(
input
.
pipe
(
_filter
([
'
**
'
,
...
excludes
])),
input
.
pipe
(
_filter
(
includes
))
);
if
(
includes
)
{
const
includeGlobs
=
includes
.
map
(
toGlob
);
output
=
es
.
merge
(
output
,
nodeModuleInput
.
pipe
(
_filter
(
includeGlobs
)));
}
output
=
output
.
pipe
(
allFilter
.
restore
);
return
es
.
duplex
(
input
,
output
);
}
...
...
src/vs/code/electron-main/app.ts
浏览文件 @
f794ad0a
...
...
@@ -234,7 +234,7 @@ export class CodeApplication extends Disposable {
ipc
.
on
(
'
vscode:fetchShellEnv
'
,
(
event
:
Event
)
=>
{
const
webContents
=
event
.
sender
;
getShellEnvironment
().
then
(
shellEnv
=>
{
getShellEnvironment
(
this
.
logService
).
then
(
shellEnv
=>
{
if
(
!
webContents
.
isDestroyed
())
{
webContents
.
send
(
'
vscode:acceptShellEnv
'
,
shellEnv
);
}
...
...
@@ -678,7 +678,7 @@ export class CodeApplication extends Disposable {
historyMainService
.
onRecentlyOpenedChange
(()
=>
historyMainService
.
updateWindowsJumpList
());
// Start shared process after a while
const
sharedProcessSpawn
=
this
.
_register
(
new
RunOnceScheduler
(()
=>
getShellEnvironment
().
then
(
userEnv
=>
this
.
sharedProcess
.
spawn
(
userEnv
)),
3000
));
const
sharedProcessSpawn
=
this
.
_register
(
new
RunOnceScheduler
(()
=>
getShellEnvironment
(
this
.
logService
).
then
(
userEnv
=>
this
.
sharedProcess
.
spawn
(
userEnv
)),
3000
));
sharedProcessSpawn
.
schedule
();
}
...
...
src/vs/code/node/shellEnv.ts
浏览文件 @
f794ad0a
...
...
@@ -7,11 +7,16 @@ import * as cp from 'child_process';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
function
getUnixShellEnvironment
():
Promise
<
typeof
process
.
env
>
{
function
getUnixShellEnvironment
(
logService
:
ILogService
):
Promise
<
typeof
process
.
env
>
{
const
promise
=
new
Promise
<
typeof
process
.
env
>
((
resolve
,
reject
)
=>
{
const
runAsNode
=
process
.
env
[
'
ELECTRON_RUN_AS_NODE
'
];
logService
.
trace
(
'
getUnixShellEnvironment#runAsNode
'
,
runAsNode
);
const
noAttach
=
process
.
env
[
'
ELECTRON_NO_ATTACH_CONSOLE
'
];
logService
.
trace
(
'
getUnixShellEnvironment#noAttach
'
,
noAttach
);
const
mark
=
generateUuid
().
replace
(
/-/g
,
''
).
substr
(
0
,
12
);
const
regex
=
new
RegExp
(
mark
+
'
(.*)
'
+
mark
);
...
...
@@ -21,6 +26,9 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
});
const
command
=
`'
${
process
.
execPath
}
' -p '"
${
mark
}
" + JSON.stringify(process.env) + "
${
mark
}
"'`
;
logService
.
trace
(
'
getUnixShellEnvironment#env
'
,
env
);
logService
.
trace
(
'
getUnixShellEnvironment#spawn
'
,
command
);
const
child
=
cp
.
spawn
(
process
.
env
.
SHELL
!
,
[
'
-ilc
'
,
command
],
{
detached
:
true
,
stdio
:
[
'
ignore
'
,
'
pipe
'
,
process
.
stderr
],
...
...
@@ -37,6 +45,8 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
}
const
raw
=
Buffer
.
concat
(
buffers
).
toString
(
'
utf8
'
);
logService
.
trace
(
'
getUnixShellEnvironment#raw
'
,
raw
);
const
match
=
regex
.
exec
(
raw
);
const
rawStripped
=
match
?
match
[
1
]
:
'
{}
'
;
...
...
@@ -58,8 +68,10 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
delete
env
[
'
XDG_RUNTIME_DIR
'
];
logService
.
trace
(
'
getUnixShellEnvironment#result
'
,
env
);
resolve
(
env
);
}
catch
(
err
)
{
logService
.
error
(
'
getUnixShellEnvironment#error
'
,
err
);
reject
(
err
);
}
});
...
...
@@ -77,14 +89,17 @@ let _shellEnv: Promise<typeof process.env>;
* This should only be done when Code itself is not launched
* from within a shell.
*/
export
function
getShellEnvironment
():
Promise
<
typeof
process
.
env
>
{
export
function
getShellEnvironment
(
logService
:
ILogService
):
Promise
<
typeof
process
.
env
>
{
if
(
_shellEnv
===
undefined
)
{
if
(
isWindows
)
{
logService
.
trace
(
'
getShellEnvironment: runing on windows, skipping
'
);
_shellEnv
=
Promise
.
resolve
({});
}
else
if
(
process
.
env
[
'
VSCODE_CLI
'
]
===
'
1
'
)
{
logService
.
trace
(
'
getShellEnvironment: runing on CLI, skipping
'
);
_shellEnv
=
Promise
.
resolve
({});
}
else
{
_shellEnv
=
getUnixShellEnvironment
();
logService
.
trace
(
'
getShellEnvironment: running on Unix
'
);
_shellEnv
=
getUnixShellEnvironment
(
logService
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录