Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
07141d4e
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,发现更多精彩内容 >>
提交
07141d4e
编写于
9月 03, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
print all stats at the end of the package task
上级
165bb1aa
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
89 addition
and
10 deletion
+89
-10
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+8
-2
build/lib/extensions.js
build/lib/extensions.js
+1
-1
build/lib/extensions.ts
build/lib/extensions.ts
+1
-1
build/lib/optimize.js
build/lib/optimize.js
+1
-1
build/lib/optimize.ts
build/lib/optimize.ts
+1
-1
build/lib/stats.js
build/lib/stats.js
+40
-2
build/lib/stats.ts
build/lib/stats.ts
+37
-2
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
07141d4e
...
...
@@ -327,6 +327,12 @@ function packageTask(platform, arch, opts) {
.
pipe
(
rename
(
'
bin/
'
+
product
.
applicationName
)));
}
// submit all stats that have been collected during
// the build phase
if
(
opts
.
stats
)
{
result
.
on
(
'
end
'
,
()
=>
require
(
'
./lib/stats
'
).
submitAllStats
());
}
return
result
.
pipe
(
vfs
.
dest
(
destination
));
};
}
...
...
@@ -342,14 +348,14 @@ gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'VSCode-lin
gulp
.
task
(
'
vscode-win32-ia32
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-win32-ia32
'
],
packageTask
(
'
win32
'
,
'
ia32
'
));
gulp
.
task
(
'
vscode-win32-x64
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-win32-x64
'
],
packageTask
(
'
win32
'
,
'
x64
'
));
gulp
.
task
(
'
vscode-darwin
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-darwin
'
],
packageTask
(
'
darwin
'
));
gulp
.
task
(
'
vscode-darwin
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-darwin
'
],
packageTask
(
'
darwin
'
,
null
,
{
stats
:
true
}
));
gulp
.
task
(
'
vscode-linux-ia32
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-linux-ia32
'
],
packageTask
(
'
linux
'
,
'
ia32
'
));
gulp
.
task
(
'
vscode-linux-x64
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-linux-x64
'
],
packageTask
(
'
linux
'
,
'
x64
'
));
gulp
.
task
(
'
vscode-linux-arm
'
,
[
'
optimize-vscode
'
,
'
clean-vscode-linux-arm
'
],
packageTask
(
'
linux
'
,
'
arm
'
));
gulp
.
task
(
'
vscode-win32-ia32-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-win32-ia32
'
],
packageTask
(
'
win32
'
,
'
ia32
'
,
{
minified
:
true
}));
gulp
.
task
(
'
vscode-win32-x64-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-win32-x64
'
],
packageTask
(
'
win32
'
,
'
x64
'
,
{
minified
:
true
}));
gulp
.
task
(
'
vscode-darwin-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-darwin
'
],
packageTask
(
'
darwin
'
,
null
,
{
minified
:
true
}));
gulp
.
task
(
'
vscode-darwin-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-darwin
'
],
packageTask
(
'
darwin
'
,
null
,
{
minified
:
true
,
stats
:
true
}));
gulp
.
task
(
'
vscode-linux-ia32-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-linux-ia32
'
],
packageTask
(
'
linux
'
,
'
ia32
'
,
{
minified
:
true
}));
gulp
.
task
(
'
vscode-linux-x64-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-linux-x64
'
],
packageTask
(
'
linux
'
,
'
x64
'
,
{
minified
:
true
}));
gulp
.
task
(
'
vscode-linux-arm-min
'
,
[
'
minify-vscode
'
,
'
clean-vscode-linux-arm
'
],
packageTask
(
'
linux
'
,
'
arm
'
,
{
minified
:
true
}));
...
...
build/lib/extensions.js
浏览文件 @
07141d4e
...
...
@@ -115,7 +115,7 @@ function fromLocal(extensionPath, sourceMappingURLBase) {
filesStream
.
pipe
(
result
);
}
}).
catch
(
function
(
err
)
{
return
result
.
emit
(
'
error
'
,
err
);
});
return
result
.
pipe
(
stats_1
.
createStatsStream
(
path
.
basename
(
extensionPath
)
,
true
));
return
result
.
pipe
(
stats_1
.
createStatsStream
(
path
.
basename
(
extensionPath
)));
}
exports
.
fromLocal
=
fromLocal
;
function
error
(
err
)
{
...
...
build/lib/extensions.ts
浏览文件 @
07141d4e
...
...
@@ -132,7 +132,7 @@ export function fromLocal(extensionPath: string, sourceMappingURLBase?: string):
}).
catch
(
err
=>
result
.
emit
(
'
error
'
,
err
));
return
result
.
pipe
(
createStatsStream
(
path
.
basename
(
extensionPath
)
,
true
));
return
result
.
pipe
(
createStatsStream
(
path
.
basename
(
extensionPath
)));
}
function
error
(
err
:
any
):
Stream
{
...
...
build/lib/optimize.js
浏览文件 @
07141d4e
...
...
@@ -103,7 +103,7 @@ function toConcatStream(src, bundledFileHeader, sources, dest) {
return
es
.
readArray
(
treatedSources
)
.
pipe
(
useSourcemaps
?
util
.
loadSourcemaps
()
:
es
.
through
())
.
pipe
(
concat
(
dest
))
.
pipe
(
stats_1
.
createStatsStream
(
dest
,
true
));
.
pipe
(
stats_1
.
createStatsStream
(
dest
));
}
function
toBundleStream
(
src
,
bundledFileHeader
,
bundles
)
{
return
es
.
merge
(
bundles
.
map
(
function
(
bundle
)
{
...
...
build/lib/optimize.ts
浏览文件 @
07141d4e
...
...
@@ -123,7 +123,7 @@ function toConcatStream(src: string, bundledFileHeader: string, sources: bundle.
return
es
.
readArray
(
treatedSources
)
.
pipe
(
useSourcemaps
?
util
.
loadSourcemaps
()
:
es
.
through
())
.
pipe
(
concat
(
dest
))
.
pipe
(
createStatsStream
(
dest
,
true
));
.
pipe
(
createStatsStream
(
dest
));
}
function
toBundleStream
(
src
:
string
,
bundledFileHeader
:
string
,
bundles
:
bundle
.
IConcatFile
[]):
NodeJS
.
ReadWriteStream
{
...
...
build/lib/stats.js
浏览文件 @
07141d4e
...
...
@@ -12,8 +12,26 @@ var Entry = /** @class */ (function () {
this
.
totalCount
=
totalCount
;
this
.
totalSize
=
totalSize
;
}
Entry
.
prototype
.
toString
=
function
()
{
return
this
.
name
+
"
:
"
+
this
.
totalCount
+
"
files with
"
+
this
.
totalSize
+
"
bytes
"
;
Entry
.
prototype
.
toString
=
function
(
pretty
)
{
if
(
!
pretty
)
{
if
(
this
.
totalCount
===
1
)
{
return
this
.
name
+
"
:
"
+
this
.
totalSize
+
"
bytes
"
;
}
else
{
return
this
.
name
+
"
:
"
+
this
.
totalCount
+
"
files with
"
+
this
.
totalSize
+
"
bytes
"
;
}
}
else
{
if
(
this
.
totalCount
===
1
)
{
return
"
Stats for '
"
+
util
.
colors
.
grey
(
this
.
name
)
+
"
':
"
+
Math
.
round
(
this
.
totalSize
/
1204
)
+
"
KB
"
;
}
else
{
var
count
=
this
.
totalCount
<
100
?
util
.
colors
.
green
(
this
.
totalCount
.
toString
())
:
util
.
colors
.
red
(
this
.
totalCount
.
toString
());
return
"
Stats for '
"
+
util
.
colors
.
grey
(
this
.
name
)
+
"
':
"
+
count
+
"
files,
"
+
Math
.
round
(
this
.
totalSize
/
1204
)
+
"
KB
"
;
}
}
};
return
Entry
;
}());
...
...
@@ -52,3 +70,23 @@ function createStatsStream(group, log) {
});
}
exports
.
createStatsStream
=
createStatsStream
;
function
submitAllStats
()
{
var
sorted
=
[];
// move entries for single files to the
// front
_entries
.
forEach
(
function
(
value
)
{
if
(
value
.
totalCount
===
1
)
{
sorted
.
unshift
(
value
);
}
else
{
sorted
.
push
(
value
);
}
});
// todo@ramya/joh - send the data as telemetry event
// so that it can be stored in the datawarehouse
for
(
var
_i
=
0
,
sorted_1
=
sorted
;
_i
<
sorted_1
.
length
;
_i
++
)
{
var
entry
=
sorted_1
[
_i
];
console
.
log
(
entry
.
toString
(
true
));
}
}
exports
.
submitAllStats
=
submitAllStats
;
build/lib/stats.ts
浏览文件 @
07141d4e
...
...
@@ -12,8 +12,25 @@ import * as File from 'vinyl';
class
Entry
{
constructor
(
readonly
name
:
string
,
public
totalCount
:
number
,
public
totalSize
:
number
)
{
}
toString
():
string
{
return
`
${
this
.
name
}
:
${
this
.
totalCount
}
files with
${
this
.
totalSize
}
bytes`
;
toString
(
pretty
?:
boolean
):
string
{
if
(
!
pretty
)
{
if
(
this
.
totalCount
===
1
)
{
return
`
${
this
.
name
}
:
${
this
.
totalSize
}
bytes`
;
}
else
{
return
`
${
this
.
name
}
:
${
this
.
totalCount
}
files with
${
this
.
totalSize
}
bytes`
;
}
}
else
{
if
(
this
.
totalCount
===
1
)
{
return
`Stats for '
${
util
.
colors
.
grey
(
this
.
name
)}
':
${
Math
.
round
(
this
.
totalSize
/
1204
)}
KB`
;
}
else
{
let
count
=
this
.
totalCount
<
100
?
util
.
colors
.
green
(
this
.
totalCount
.
toString
())
:
util
.
colors
.
red
(
this
.
totalCount
.
toString
());
return
`Stats for '
${
util
.
colors
.
grey
(
this
.
name
)}
':
${
count
}
files,
${
Math
.
round
(
this
.
totalSize
/
1204
)}
KB`
;
}
}
}
}
...
...
@@ -54,3 +71,21 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
this
.
emit
(
'
end
'
);
});
}
export
function
submitAllStats
():
void
{
let
sorted
:
Entry
[]
=
[];
// move entries for single files to the
// front
_entries
.
forEach
(
value
=>
{
if
(
value
.
totalCount
===
1
)
{
sorted
.
unshift
(
value
);
}
else
{
sorted
.
push
(
value
);
}
});
// todo@ramya/joh - send the data as telemetry event
// so that it can be stored in the datawarehouse
for
(
const
entry
of
sorted
)
{
console
.
log
(
entry
.
toString
(
true
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录