Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
2dd593fe
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
2dd593fe
编写于
12月 17, 2015
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve gulp hygiene filters to cover top level files
上级
807b2e4d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
160 addition
and
154 deletion
+160
-154
build/gulpfile.hygiene.js
build/gulpfile.hygiene.js
+6
-0
gulpfile.js
gulpfile.js
+154
-154
未找到文件。
build/gulpfile.hygiene.js
浏览文件 @
2dd593fe
...
...
@@ -9,6 +9,7 @@ var es = require('event-stream');
var
path
=
require
(
'
path
'
);
var
all
=
[
'
*
'
,
'
build/**/*
'
,
'
extensions/**/*
'
,
'
scripts/**/*
'
,
...
...
@@ -18,6 +19,8 @@ var all = [
var
eolFilter
=
[
'
**
'
,
'
!ThirdPartyNotices.txt
'
,
'
!LICENSE.txt
'
,
'
!extensions/**/out/**
'
,
'
!**/node_modules/**
'
,
'
!**/fixtures/**
'
,
...
...
@@ -26,6 +29,9 @@ var eolFilter = [
var
indentationFilter
=
[
'
**
'
,
'
!ThirdPartyNotices.txt
'
,
'
!**/*.md
'
,
'
!**/*.yml
'
,
'
!**/lib/**
'
,
'
!**/*.d.ts
'
,
'
!extensions/typescript/server/**
'
,
...
...
gulpfile.js
浏览文件 @
2dd593fe
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Increase max listeners for event emitters
require
(
'
events
'
).
EventEmitter
.
defaultMaxListeners
=
100
;
var
gulp
=
require
(
'
gulp
'
);
var
tsb
=
require
(
'
gulp-tsb
'
);
var
filter
=
require
(
'
gulp-filter
'
);
var
mocha
=
require
(
'
gulp-mocha
'
);
var
es
=
require
(
'
event-stream
'
);
var
watch
=
require
(
'
./build/lib/watch
'
);
var
nls
=
require
(
'
./build/lib/nls
'
);
var
util
=
require
(
'
./build/lib/util
'
);
var
reporter
=
require
(
'
./build/lib/reporter
'
)();
var
remote
=
require
(
'
gulp-remote-src
'
);
var
rename
=
require
(
'
gulp-rename
'
);
var
zip
=
require
(
'
gulp-vinyl-zip
'
);
var
path
=
require
(
'
path
'
);
var
bom
=
require
(
'
gulp-bom
'
);
var
sourcemaps
=
require
(
'
gulp-sourcemaps
'
);
var
_
=
require
(
'
underscore
'
);
var
quiet
=
!!
process
.
env
[
'
VSCODE_BUILD_QUIET
'
];
var
rootDir
=
path
.
join
(
__dirname
,
'
src
'
);
var
tsOptions
=
{
target
:
'
ES5
'
,
module
:
'
amd
'
,
verbose
:
!
quiet
,
preserveConstEnums
:
true
,
experimentalDecorators
:
true
,
sourceMap
:
true
,
rootDir
:
rootDir
,
sourceRoot
:
util
.
toFileUri
(
rootDir
)
};
function
createCompile
(
build
)
{
var
opts
=
_
.
clone
(
tsOptions
);
opts
.
inlineSources
=
!!
build
;
var
ts
=
tsb
.
create
(
opts
,
null
,
null
,
quiet
?
null
:
function
(
err
)
{
reporter
(
err
.
toString
());
});
return
function
(
token
)
{
var
utf8Filter
=
filter
(
'
**/test/**/*utf8*
'
,
{
restore
:
true
});
var
tsFilter
=
filter
([
'
**/*.ts
'
,
'
!vs/languages/typescript/common/lib/lib.**.ts
'
],
{
restore
:
true
});
var
input
=
es
.
through
();
var
output
=
input
.
pipe
(
utf8Filter
)
.
pipe
(
bom
())
.
pipe
(
utf8Filter
.
restore
)
.
pipe
(
tsFilter
)
.
pipe
(
util
.
loadSourcemaps
())
.
pipe
(
ts
(
token
))
.
pipe
(
build
?
nls
()
:
es
.
through
())
.
pipe
(
sourcemaps
.
write
(
'
.
'
,
{
addComment
:
false
,
includeContent
:
!!
build
,
sourceRoot
:
tsOptions
.
sourceRoot
}))
.
pipe
(
tsFilter
.
restore
)
.
pipe
(
quiet
?
es
.
through
()
:
reporter
());
return
es
.
duplex
(
input
,
output
);
};
}
function
compileTask
(
out
,
build
)
{
var
compile
=
createCompile
(
build
);
return
function
()
{
var
src
=
gulp
.
src
(
'
src/**
'
,
{
base
:
'
src
'
});
return
src
.
pipe
(
compile
())
.
pipe
(
gulp
.
dest
(
out
));
};
}
function
watchTask
(
out
,
build
)
{
var
compile
=
createCompile
(
build
);
return
function
()
{
var
src
=
gulp
.
src
(
'
src/**
'
,
{
base
:
'
src
'
});
var
watchSrc
=
watch
(
'
src/**
'
,
{
base
:
'
src
'
});
return
watchSrc
.
pipe
(
util
.
incremental
(
compile
,
src
,
true
))
.
pipe
(
gulp
.
dest
(
out
));
};
}
// Fast compile for development time
gulp
.
task
(
'
clean-client
'
,
util
.
rimraf
(
'
out
'
));
gulp
.
task
(
'
compile-client
'
,
[
'
clean-client
'
],
compileTask
(
'
out
'
,
false
));
gulp
.
task
(
'
watch-client
'
,
[
'
clean-client
'
],
watchTask
(
'
out
'
,
false
));
// Full compile, including nls and inline sources in sourcemaps, for build
gulp
.
task
(
'
clean-build
'
,
util
.
rimraf
(
'
out-build
'
));
gulp
.
task
(
'
compile-build
'
,
[
'
clean-build
'
],
compileTask
(
'
out-build
'
,
true
));
gulp
.
task
(
'
watch-build
'
,
[
'
clean-build
'
],
watchTask
(
'
out-build
'
,
true
));
// Default
gulp
.
task
(
'
default
'
,
[
'
compile-all
'
]);
// All
gulp
.
task
(
'
clean
'
,
[
'
clean-client
'
,
'
clean-plugins
'
]);
gulp
.
task
(
'
compile
'
,
[
'
compile-client
'
,
'
compile-plugins
'
]);
gulp
.
task
(
'
watch
'
,
[
'
watch-client
'
,
'
watch-plugins
'
]);
gulp
.
task
(
'
test
'
,
function
()
{
return
gulp
.
src
(
'
test/all.js
'
)
.
pipe
(
mocha
({
ui
:
'
tdd
'
,
delay
:
true
}))
.
once
(
'
end
'
,
function
()
{
process
.
exit
();
});
});
gulp
.
task
(
'
mixin
'
,
function
()
{
var
repo
=
process
.
env
[
'
VSCODE_MIXIN_REPO
'
];
if
(
!
repo
)
{
return
;
}
var
url
=
'
https://github.com/
'
+
repo
+
'
/archive/master.zip
'
;
var
opts
=
{
base
:
''
};
var
username
=
process
.
env
[
'
VSCODE_MIXIN_USERNAME
'
];
var
password
=
process
.
env
[
'
VSCODE_MIXIN_PASSWORD
'
];
if
(
username
||
password
)
{
opts
.
auth
=
{
user
:
username
||
''
,
pass
:
password
||
''
};
}
console
.
log
(
'
Mixing in sources from
\'
'
+
url
+
'
\'
:
'
);
return
remote
(
url
,
opts
)
.
pipe
(
zip
.
src
())
.
pipe
(
rename
(
function
(
f
)
{
f
.
dirname
=
f
.
dirname
.
replace
(
/^
[^\/\\]
+
[\/\\]?
/
,
''
);
}))
.
pipe
(
es
.
mapSync
(
function
(
f
)
{
console
.
log
(
f
.
relative
);
return
f
;
}))
.
pipe
(
gulp
.
dest
(
'
.
'
));
});
require
(
'
./build/gulpfile.hygiene
'
);
require
(
'
./build/gulpfile.vscode
'
);
require
(
'
./build/gulpfile.editor
'
);
require
(
'
./build/gulpfile.plugins
'
);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Increase max listeners for event emitters
require
(
'
events
'
).
EventEmitter
.
defaultMaxListeners
=
100
;
var
gulp
=
require
(
'
gulp
'
);
var
tsb
=
require
(
'
gulp-tsb
'
);
var
filter
=
require
(
'
gulp-filter
'
);
var
mocha
=
require
(
'
gulp-mocha
'
);
var
es
=
require
(
'
event-stream
'
);
var
watch
=
require
(
'
./build/lib/watch
'
);
var
nls
=
require
(
'
./build/lib/nls
'
);
var
util
=
require
(
'
./build/lib/util
'
);
var
reporter
=
require
(
'
./build/lib/reporter
'
)();
var
remote
=
require
(
'
gulp-remote-src
'
);
var
rename
=
require
(
'
gulp-rename
'
);
var
zip
=
require
(
'
gulp-vinyl-zip
'
);
var
path
=
require
(
'
path
'
);
var
bom
=
require
(
'
gulp-bom
'
);
var
sourcemaps
=
require
(
'
gulp-sourcemaps
'
);
var
_
=
require
(
'
underscore
'
);
var
quiet
=
!!
process
.
env
[
'
VSCODE_BUILD_QUIET
'
];
var
rootDir
=
path
.
join
(
__dirname
,
'
src
'
);
var
tsOptions
=
{
target
:
'
ES5
'
,
module
:
'
amd
'
,
verbose
:
!
quiet
,
preserveConstEnums
:
true
,
experimentalDecorators
:
true
,
sourceMap
:
true
,
rootDir
:
rootDir
,
sourceRoot
:
util
.
toFileUri
(
rootDir
)
};
function
createCompile
(
build
)
{
var
opts
=
_
.
clone
(
tsOptions
);
opts
.
inlineSources
=
!!
build
;
var
ts
=
tsb
.
create
(
opts
,
null
,
null
,
quiet
?
null
:
function
(
err
)
{
reporter
(
err
.
toString
());
});
return
function
(
token
)
{
var
utf8Filter
=
filter
(
'
**/test/**/*utf8*
'
,
{
restore
:
true
});
var
tsFilter
=
filter
([
'
**/*.ts
'
,
'
!vs/languages/typescript/common/lib/lib.**.ts
'
],
{
restore
:
true
});
var
input
=
es
.
through
();
var
output
=
input
.
pipe
(
utf8Filter
)
.
pipe
(
bom
())
.
pipe
(
utf8Filter
.
restore
)
.
pipe
(
tsFilter
)
.
pipe
(
util
.
loadSourcemaps
())
.
pipe
(
ts
(
token
))
.
pipe
(
build
?
nls
()
:
es
.
through
())
.
pipe
(
sourcemaps
.
write
(
'
.
'
,
{
addComment
:
false
,
includeContent
:
!!
build
,
sourceRoot
:
tsOptions
.
sourceRoot
}))
.
pipe
(
tsFilter
.
restore
)
.
pipe
(
quiet
?
es
.
through
()
:
reporter
());
return
es
.
duplex
(
input
,
output
);
};
}
function
compileTask
(
out
,
build
)
{
var
compile
=
createCompile
(
build
);
return
function
()
{
var
src
=
gulp
.
src
(
'
src/**
'
,
{
base
:
'
src
'
});
return
src
.
pipe
(
compile
())
.
pipe
(
gulp
.
dest
(
out
));
};
}
function
watchTask
(
out
,
build
)
{
var
compile
=
createCompile
(
build
);
return
function
()
{
var
src
=
gulp
.
src
(
'
src/**
'
,
{
base
:
'
src
'
});
var
watchSrc
=
watch
(
'
src/**
'
,
{
base
:
'
src
'
});
return
watchSrc
.
pipe
(
util
.
incremental
(
compile
,
src
,
true
))
.
pipe
(
gulp
.
dest
(
out
));
};
}
// Fast compile for development time
gulp
.
task
(
'
clean-client
'
,
util
.
rimraf
(
'
out
'
));
gulp
.
task
(
'
compile-client
'
,
[
'
clean-client
'
],
compileTask
(
'
out
'
,
false
));
gulp
.
task
(
'
watch-client
'
,
[
'
clean-client
'
],
watchTask
(
'
out
'
,
false
));
// Full compile, including nls and inline sources in sourcemaps, for build
gulp
.
task
(
'
clean-build
'
,
util
.
rimraf
(
'
out-build
'
));
gulp
.
task
(
'
compile-build
'
,
[
'
clean-build
'
],
compileTask
(
'
out-build
'
,
true
));
gulp
.
task
(
'
watch-build
'
,
[
'
clean-build
'
],
watchTask
(
'
out-build
'
,
true
));
// Default
gulp
.
task
(
'
default
'
,
[
'
compile-all
'
]);
// All
gulp
.
task
(
'
clean
'
,
[
'
clean-client
'
,
'
clean-plugins
'
]);
gulp
.
task
(
'
compile
'
,
[
'
compile-client
'
,
'
compile-plugins
'
]);
gulp
.
task
(
'
watch
'
,
[
'
watch-client
'
,
'
watch-plugins
'
]);
gulp
.
task
(
'
test
'
,
function
()
{
return
gulp
.
src
(
'
test/all.js
'
)
.
pipe
(
mocha
({
ui
:
'
tdd
'
,
delay
:
true
}))
.
once
(
'
end
'
,
function
()
{
process
.
exit
();
});
});
gulp
.
task
(
'
mixin
'
,
function
()
{
var
repo
=
process
.
env
[
'
VSCODE_MIXIN_REPO
'
];
if
(
!
repo
)
{
return
;
}
var
url
=
'
https://github.com/
'
+
repo
+
'
/archive/master.zip
'
;
var
opts
=
{
base
:
''
};
var
username
=
process
.
env
[
'
VSCODE_MIXIN_USERNAME
'
];
var
password
=
process
.
env
[
'
VSCODE_MIXIN_PASSWORD
'
];
if
(
username
||
password
)
{
opts
.
auth
=
{
user
:
username
||
''
,
pass
:
password
||
''
};
}
console
.
log
(
'
Mixing in sources from
\'
'
+
url
+
'
\'
:
'
);
return
remote
(
url
,
opts
)
.
pipe
(
zip
.
src
())
.
pipe
(
rename
(
function
(
f
)
{
f
.
dirname
=
f
.
dirname
.
replace
(
/^
[^\/\\]
+
[\/\\]?
/
,
''
);
}))
.
pipe
(
es
.
mapSync
(
function
(
f
)
{
console
.
log
(
f
.
relative
);
return
f
;
}))
.
pipe
(
gulp
.
dest
(
'
.
'
));
});
require
(
'
./build/gulpfile.hygiene
'
);
require
(
'
./build/gulpfile.vscode
'
);
require
(
'
./build/gulpfile.editor
'
);
require
(
'
./build/gulpfile.plugins
'
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录