Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
eae1b662
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,发现更多精彩内容 >>
提交
eae1b662
编写于
9月 21, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tasks: adopt configurationResolverService
上级
724c4ce2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
52 deletion
+51
-52
src/vs/base/common/processes.ts
src/vs/base/common/processes.ts
+1
-23
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+17
-14
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
+27
-10
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
+6
-5
未找到文件。
src/vs/base/common/processes.ts
浏览文件 @
eae1b662
...
@@ -11,8 +11,7 @@ import * as Platform from 'vs/base/common/platform';
...
@@ -11,8 +11,7 @@ import * as Platform from 'vs/base/common/platform';
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
*
as
Types
from
'
vs/base/common/types
'
;
import
*
as
Types
from
'
vs/base/common/types
'
;
import
{
ValidationStatus
,
ValidationState
,
ILogger
,
Parser
,
ISystemVariables
}
from
'
vs/base/common/parsers
'
;
import
{
ValidationStatus
,
ValidationState
,
ILogger
,
Parser
}
from
'
vs/base/common/parsers
'
;
/**
/**
* Options to be passed to the external program or shell.
* Options to be passed to the external program or shell.
...
@@ -252,24 +251,3 @@ export class ExecutableParser extends Parser {
...
@@ -252,24 +251,3 @@ export class ExecutableParser extends Parser {
return
executable
;
return
executable
;
}
}
}
}
export
function
resolveCommandOptions
(
options
:
CommandOptions
,
variables
:
ISystemVariables
):
CommandOptions
{
let
result
=
Objects
.
clone
(
options
);
if
(
result
.
cwd
)
{
result
.
cwd
=
variables
.
resolve
(
result
.
cwd
);
}
if
(
result
.
env
)
{
result
.
env
=
variables
.
resolve
(
result
.
env
);
}
return
result
;
}
export
function
resolveExecutable
(
executable
:
Executable
,
variables
:
ISystemVariables
):
Executable
{
let
result
=
Objects
.
clone
(
executable
);
result
.
command
=
variables
.
resolve
(
result
.
command
);
result
.
args
=
variables
.
resolve
(
result
.
args
);
if
(
result
.
options
)
{
result
.
options
=
resolveCommandOptions
(
result
.
options
,
variables
);
}
return
result
;
}
\ No newline at end of file
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
eae1b662
...
@@ -54,9 +54,9 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
...
@@ -54,9 +54,9 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import
Constants
from
'
vs/workbench/parts/markers/common/constants
'
;
import
Constants
from
'
vs/workbench/parts/markers/common/constants
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ConfigVariables
}
from
'
vs/workbench/parts/lib/node/configVariables
'
;
import
{
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
ITextFileService
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
IOutputService
,
IOutputChannelRegistry
,
Extensions
as
OutputExt
,
IOutputChannel
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputService
,
IOutputChannelRegistry
,
Extensions
as
OutputExt
,
IOutputChannel
}
from
'
vs/workbench/parts/output/common/output
'
;
...
@@ -184,7 +184,8 @@ abstract class OpenTaskConfigurationAction extends Action {
...
@@ -184,7 +184,8 @@ abstract class OpenTaskConfigurationAction extends Action {
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
)
{
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
private
configurationResolverService
:
IConfigurationResolverService
)
{
super
(
id
,
label
);
super
(
id
,
label
);
this
.
configurationService
=
configurationService
;
this
.
configurationService
=
configurationService
;
...
@@ -216,7 +217,7 @@ abstract class OpenTaskConfigurationAction extends Action {
...
@@ -216,7 +217,7 @@ abstract class OpenTaskConfigurationAction extends Action {
const
outputChannel
=
this
.
outputService
.
getChannel
(
TaskService
.
OutputChannelId
);
const
outputChannel
=
this
.
outputService
.
getChannel
(
TaskService
.
OutputChannelId
);
outputChannel
.
show
();
outputChannel
.
show
();
outputChannel
.
append
(
nls
.
localize
(
'
ConfigureTaskRunnerAction.autoDetecting
'
,
'
Auto detecting tasks for {0}
'
,
selection
.
id
)
+
'
\n
'
);
outputChannel
.
append
(
nls
.
localize
(
'
ConfigureTaskRunnerAction.autoDetecting
'
,
'
Auto detecting tasks for {0}
'
,
selection
.
id
)
+
'
\n
'
);
let
detector
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
new
ConfigVariables
(
this
.
configurationService
,
this
.
editorService
,
this
.
contextService
,
this
.
environmentService
)
);
let
detector
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
this
.
configurationResolverService
);
contentPromise
=
detector
.
detect
(
false
,
selection
.
id
).
then
((
value
)
=>
{
contentPromise
=
detector
.
detect
(
false
,
selection
.
id
).
then
((
value
)
=>
{
let
config
=
value
.
config
;
let
config
=
value
.
config
;
if
(
value
.
stderr
&&
value
.
stderr
.
length
>
0
)
{
if
(
value
.
stderr
&&
value
.
stderr
.
length
>
0
)
{
...
@@ -278,9 +279,10 @@ class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
...
@@ -278,9 +279,10 @@ class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
)
{
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
configurationResolverService
:
IConfigurationResolverService
)
{
super
(
id
,
label
,
configurationService
,
editorService
,
fileService
,
contextService
,
super
(
id
,
label
,
configurationService
,
editorService
,
fileService
,
contextService
,
outputService
,
messageService
,
quickOpenService
,
environmentService
);
outputService
,
messageService
,
quickOpenService
,
environmentService
,
configurationResolverService
);
}
}
}
}
...
@@ -293,9 +295,10 @@ class ConfigureBuildTaskAction extends OpenTaskConfigurationAction {
...
@@ -293,9 +295,10 @@ class ConfigureBuildTaskAction extends OpenTaskConfigurationAction {
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkbenchEditorService
editorService
:
IWorkbenchEditorService
,
@
IFileService
fileService
:
IFileService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IOutputService
outputService
:
IOutputService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IMessageService
messageService
:
IMessageService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
environmentService
:
IEnvironmentService
)
{
@
IEnvironmentService
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
configurationResolverService
:
IConfigurationResolverService
)
{
super
(
id
,
label
,
configurationService
,
editorService
,
fileService
,
contextService
,
super
(
id
,
label
,
configurationService
,
editorService
,
fileService
,
contextService
,
outputService
,
messageService
,
quickOpenService
,
environmentService
);
outputService
,
messageService
,
quickOpenService
,
environmentService
,
configurationResolverService
);
}
}
}
}
...
@@ -628,7 +631,8 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -628,7 +631,8 @@ class TaskService extends EventEmitter implements ITaskService {
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
IEventService
eventService
:
IEventService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
IEventService
eventService
:
IEventService
,
@
IModelService
modelService
:
IModelService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IModelService
modelService
:
IModelService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
)
{
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IConfigurationResolverService
private
configurationResolverService
:
IConfigurationResolverService
)
{
super
();
super
();
this
.
modeService
=
modeService
;
this
.
modeService
=
modeService
;
...
@@ -680,7 +684,6 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -680,7 +684,6 @@ class TaskService extends EventEmitter implements ITaskService {
this
.
_taskSystem
=
new
NullTaskSystem
();
this
.
_taskSystem
=
new
NullTaskSystem
();
this
.
_taskSystemPromise
=
TPromise
.
as
(
this
.
_taskSystem
);
this
.
_taskSystemPromise
=
TPromise
.
as
(
this
.
_taskSystem
);
}
else
{
}
else
{
let
variables
=
new
ConfigVariables
(
this
.
configurationService
,
this
.
editorService
,
this
.
contextService
,
this
.
environmentService
);
let
clearOutput
=
true
;
let
clearOutput
=
true
;
this
.
_taskSystemPromise
=
TPromise
.
as
(
this
.
configurationService
.
getConfiguration
<
TaskConfiguration
>
(
'
tasks
'
)).
then
((
config
:
TaskConfiguration
)
=>
{
this
.
_taskSystemPromise
=
TPromise
.
as
(
this
.
configurationService
.
getConfiguration
<
TaskConfiguration
>
(
'
tasks
'
)).
then
((
config
:
TaskConfiguration
)
=>
{
let
parseErrors
:
string
[]
=
config
?
(
<
any
>
config
).
$parseErrors
:
null
;
let
parseErrors
:
string
[]
=
config
?
(
<
any
>
config
).
$parseErrors
:
null
;
...
@@ -702,7 +705,7 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -702,7 +705,7 @@ class TaskService extends EventEmitter implements ITaskService {
if
(
config
)
{
if
(
config
)
{
if
(
this
.
isRunnerConfig
(
config
)
&&
this
.
hasDetectorSupport
(
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
))
{
if
(
this
.
isRunnerConfig
(
config
)
&&
this
.
hasDetectorSupport
(
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
))
{
let
fileConfig
=
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
;
let
fileConfig
=
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
;
configPromise
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
variables
,
fileConfig
).
detect
(
true
).
then
((
value
)
=>
{
configPromise
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
this
.
configurationResolverService
,
fileConfig
).
detect
(
true
).
then
((
value
)
=>
{
clearOutput
=
this
.
printStderr
(
value
.
stderr
);
clearOutput
=
this
.
printStderr
(
value
.
stderr
);
let
detectedConfig
=
value
.
config
;
let
detectedConfig
=
value
.
config
;
if
(
!
detectedConfig
)
{
if
(
!
detectedConfig
)
{
...
@@ -728,7 +731,7 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -728,7 +731,7 @@ class TaskService extends EventEmitter implements ITaskService {
configPromise
=
TPromise
.
as
<
TaskConfiguration
>
(
config
);
configPromise
=
TPromise
.
as
<
TaskConfiguration
>
(
config
);
}
}
}
else
{
}
else
{
configPromise
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
variables
).
detect
(
true
).
then
((
value
)
=>
{
configPromise
=
new
ProcessRunnerDetector
(
this
.
fileService
,
this
.
contextService
,
this
.
configurationResolverService
).
detect
(
true
).
then
((
value
)
=>
{
clearOutput
=
this
.
printStderr
(
value
.
stderr
);
clearOutput
=
this
.
printStderr
(
value
.
stderr
);
return
value
.
config
;
return
value
.
config
;
});
});
...
@@ -742,7 +745,7 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -742,7 +745,7 @@ class TaskService extends EventEmitter implements ITaskService {
if
(
config
.
buildSystem
===
'
service
'
)
{
if
(
config
.
buildSystem
===
'
service
'
)
{
result
=
new
LanguageServiceTaskSystem
(
<
LanguageServiceTaskConfiguration
>
config
,
this
.
telemetryService
,
this
.
modeService
);
result
=
new
LanguageServiceTaskSystem
(
<
LanguageServiceTaskConfiguration
>
config
,
this
.
telemetryService
,
this
.
modeService
);
}
else
if
(
this
.
isRunnerConfig
(
config
))
{
}
else
if
(
this
.
isRunnerConfig
(
config
))
{
result
=
new
ProcessRunnerSystem
(
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
,
variables
,
this
.
markerService
,
this
.
modelService
,
this
.
telemetryService
,
this
.
output
Service
,
TaskService
.
OutputChannelId
,
clearOutput
);
result
=
new
ProcessRunnerSystem
(
<
FileConfig
.
ExternalTaskRunnerConfiguration
>
config
,
this
.
markerService
,
this
.
modelService
,
this
.
telemetryService
,
this
.
outputService
,
this
.
configurationResolver
Service
,
TaskService
.
OutputChannelId
,
clearOutput
);
}
}
if
(
result
===
null
)
{
if
(
result
===
null
)
{
this
.
_taskSystemPromise
=
null
;
this
.
_taskSystemPromise
=
null
;
...
@@ -788,13 +791,13 @@ class TaskService extends EventEmitter implements ITaskService {
...
@@ -788,13 +791,13 @@ class TaskService extends EventEmitter implements ITaskService {
public
configureAction
():
Action
{
public
configureAction
():
Action
{
return
new
ConfigureTaskRunnerAction
(
ConfigureTaskRunnerAction
.
ID
,
ConfigureTaskRunnerAction
.
TEXT
,
return
new
ConfigureTaskRunnerAction
(
ConfigureTaskRunnerAction
.
ID
,
ConfigureTaskRunnerAction
.
TEXT
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
);
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
,
this
.
configurationResolverService
);
}
}
private
configureBuildTask
():
Action
{
private
configureBuildTask
():
Action
{
return
new
ConfigureBuildTaskAction
(
ConfigureBuildTaskAction
.
ID
,
ConfigureBuildTaskAction
.
TEXT
,
return
new
ConfigureBuildTaskAction
(
ConfigureBuildTaskAction
.
ID
,
ConfigureBuildTaskAction
.
TEXT
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
configurationService
,
this
.
editorService
,
this
.
fileService
,
this
.
contextService
,
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
);
this
.
outputService
,
this
.
messageService
,
this
.
quickOpenService
,
this
.
environmentService
,
this
.
configurationResolverService
);
}
}
public
build
():
TPromise
<
ITaskSummary
>
{
public
build
():
TPromise
<
ITaskSummary
>
{
...
...
src/vs/workbench/parts/tasks/node/processRunnerDetector.ts
浏览文件 @
eae1b662
...
@@ -5,16 +5,19 @@
...
@@ -5,16 +5,19 @@
'
use strict
'
;
'
use strict
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
*
as
Objects
from
'
vs/base/common/objects
'
;
import
*
as
Paths
from
'
vs/base/common/paths
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Strings
=
require
(
'
vs/base/common/strings
'
);
import
Strings
=
require
(
'
vs/base/common/strings
'
);
import
Collections
=
require
(
'
vs/base/common/collections
'
);
import
Collections
=
require
(
'
vs/base/common/collections
'
);
import
{
CommandOptions
,
resolveCommandOptions
,
Source
,
ErrorData
}
from
'
vs/base/common/processes
'
;
import
{
CommandOptions
,
Source
,
ErrorData
}
from
'
vs/base/common/processes
'
;
import
{
LineProcess
}
from
'
vs/base/node/processes
'
;
import
{
LineProcess
}
from
'
vs/base/node/processes
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
SystemVariables
}
from
'
vs/workbench/parts/lib/node/systemVariables
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
*
as
FileConfig
from
'
./processRunnerConfiguration
'
;
import
*
as
FileConfig
from
'
./processRunnerConfiguration
'
;
...
@@ -139,18 +142,21 @@ export class ProcessRunnerDetector {
...
@@ -139,18 +142,21 @@ export class ProcessRunnerDetector {
private
fileService
:
IFileService
;
private
fileService
:
IFileService
;
private
contextService
:
IWorkspaceContextService
;
private
contextService
:
IWorkspaceContextService
;
private
variables
:
SystemVariables
;
private
configurationResolverService
:
IConfigurationResolverService
;
private
taskConfiguration
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
private
taskConfiguration
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
private
_stderr
:
string
[];
private
_stderr
:
string
[];
private
_stdout
:
string
[];
private
_stdout
:
string
[];
private
_cwd
:
string
;
constructor
(
fileService
:
IFileService
,
contextService
:
IWorkspaceContextService
,
variables
:
SystemVariables
,
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
=
null
)
{
constructor
(
fileService
:
IFileService
,
contextService
:
IWorkspaceContextService
,
configurationResolverService
:
IConfigurationResolverService
,
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
=
null
)
{
this
.
fileService
=
fileService
;
this
.
fileService
=
fileService
;
this
.
contextService
=
contextService
;
this
.
contextService
=
contextService
;
this
.
variables
=
variables
;
this
.
configurationResolverService
=
configurationResolverService
;
this
.
taskConfiguration
=
config
;
this
.
taskConfiguration
=
config
;
this
.
_stderr
=
[];
this
.
_stderr
=
[];
this
.
_stdout
=
[];
this
.
_stdout
=
[];
const
workspace
=
this
.
contextService
.
getWorkspace
();
this
.
_cwd
=
workspace
?
Paths
.
normalize
(
workspace
.
resource
.
fsPath
,
true
)
:
''
;
}
}
public
get
stderr
():
string
[]
{
public
get
stderr
():
string
[]
{
...
@@ -165,10 +171,10 @@ export class ProcessRunnerDetector {
...
@@ -165,10 +171,10 @@ export class ProcessRunnerDetector {
if
(
this
.
taskConfiguration
&&
this
.
taskConfiguration
.
command
&&
ProcessRunnerDetector
.
supports
(
this
.
taskConfiguration
.
command
))
{
if
(
this
.
taskConfiguration
&&
this
.
taskConfiguration
.
command
&&
ProcessRunnerDetector
.
supports
(
this
.
taskConfiguration
.
command
))
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
this
.
taskConfiguration
.
command
);
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
this
.
taskConfiguration
.
command
);
let
args
=
(
this
.
taskConfiguration
.
args
||
[]).
concat
(
config
.
arg
);
let
args
=
(
this
.
taskConfiguration
.
args
||
[]).
concat
(
config
.
arg
);
let
options
:
CommandOptions
=
this
.
taskConfiguration
.
options
?
resolveCommandOptions
(
this
.
taskConfiguration
.
options
,
this
.
variables
)
:
{
cwd
:
this
.
variables
.
workspaceRoot
};
let
options
:
CommandOptions
=
this
.
taskConfiguration
.
options
?
this
.
resolveCommandOptions
(
this
.
taskConfiguration
.
options
)
:
{
cwd
:
this
.
_cwd
};
let
isShellCommand
=
!!
this
.
taskConfiguration
.
isShellCommand
;
let
isShellCommand
=
!!
this
.
taskConfiguration
.
isShellCommand
;
return
this
.
runDetection
(
return
this
.
runDetection
(
new
LineProcess
(
this
.
taskConfiguration
.
command
,
this
.
variables
.
resolve
(
args
),
isShellCommand
,
options
),
new
LineProcess
(
this
.
taskConfiguration
.
command
,
this
.
configurationResolverService
.
resolve
(
args
),
isShellCommand
,
options
),
this
.
taskConfiguration
.
command
,
isShellCommand
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
this
.
taskConfiguration
.
command
,
isShellCommand
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
}
else
{
}
else
{
if
(
detectSpecific
)
{
if
(
detectSpecific
)
{
...
@@ -208,10 +214,21 @@ export class ProcessRunnerDetector {
...
@@ -208,10 +214,21 @@ export class ProcessRunnerDetector {
}
}
}
}
private
resolveCommandOptions
(
options
:
CommandOptions
):
CommandOptions
{
let
result
=
Objects
.
clone
(
options
);
if
(
result
.
cwd
)
{
result
.
cwd
=
this
.
configurationResolverService
.
resolve
(
result
.
cwd
);
}
if
(
result
.
env
)
{
result
.
env
=
this
.
configurationResolverService
.
resolve
(
result
.
env
);
}
return
result
;
}
private
tryDetectGulp
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectGulp
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
gulpfile.js
'
)).
then
((
stat
)
=>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
gulpfile.js
'
)).
then
((
stat
)
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
gulp
'
);
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
gulp
'
);
let
process
=
new
LineProcess
(
'
gulp
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
variables
.
workspaceRoot
});
let
process
=
new
LineProcess
(
'
gulp
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
_cwd
});
return
this
.
runDetection
(
process
,
'
gulp
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
return
this
.
runDetection
(
process
,
'
gulp
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
},
(
err
:
any
):
FileConfig
.
ExternalTaskRunnerConfiguration
=>
{
},
(
err
:
any
):
FileConfig
.
ExternalTaskRunnerConfiguration
=>
{
return
null
;
return
null
;
...
@@ -221,7 +238,7 @@ export class ProcessRunnerDetector {
...
@@ -221,7 +238,7 @@ export class ProcessRunnerDetector {
private
tryDetectGrunt
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectGrunt
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Gruntfile.js
'
)).
then
((
stat
)
=>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Gruntfile.js
'
)).
then
((
stat
)
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
grunt
'
);
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
grunt
'
);
let
process
=
new
LineProcess
(
'
grunt
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
variables
.
workspaceRoot
});
let
process
=
new
LineProcess
(
'
grunt
'
,
[
config
.
arg
,
'
--no-color
'
],
true
,
{
cwd
:
this
.
_cwd
});
return
this
.
runDetection
(
process
,
'
grunt
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
return
this
.
runDetection
(
process
,
'
grunt
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
},
(
err
:
any
):
FileConfig
.
ExternalTaskRunnerConfiguration
=>
{
},
(
err
:
any
):
FileConfig
.
ExternalTaskRunnerConfiguration
=>
{
return
null
;
return
null
;
...
@@ -231,7 +248,7 @@ export class ProcessRunnerDetector {
...
@@ -231,7 +248,7 @@ export class ProcessRunnerDetector {
private
tryDetectJake
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
private
tryDetectJake
(
list
:
boolean
):
TPromise
<
{
config
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
stderr
:
string
[];
}
>
{
let
run
=
()
=>
{
let
run
=
()
=>
{
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
jake
'
);
let
config
=
ProcessRunnerDetector
.
detectorConfig
(
'
jake
'
);
let
process
=
new
LineProcess
(
'
jake
'
,
[
config
.
arg
],
true
,
{
cwd
:
this
.
variables
.
workspaceRoot
});
let
process
=
new
LineProcess
(
'
jake
'
,
[
config
.
arg
],
true
,
{
cwd
:
this
.
_cwd
});
return
this
.
runDetection
(
process
,
'
jake
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
return
this
.
runDetection
(
process
,
'
jake
'
,
true
,
config
.
matcher
,
ProcessRunnerDetector
.
DefaultProblemMatchers
,
list
);
};
};
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Jakefile
'
)).
then
((
stat
)
=>
{
return
this
.
fileService
.
resolveFile
(
this
.
contextService
.
toResource
(
'
Jakefile
'
)).
then
((
stat
)
=>
{
...
...
src/vs/workbench/parts/tasks/node/processRunnerSystem.ts
浏览文件 @
eae1b662
...
@@ -18,7 +18,7 @@ import { TerminateResponse, SuccessData, ErrorData } from 'vs/base/common/proces
...
@@ -18,7 +18,7 @@ import { TerminateResponse, SuccessData, ErrorData } from 'vs/base/common/proces
import
{
LineProcess
,
LineData
}
from
'
vs/base/node/processes
'
;
import
{
LineProcess
,
LineData
}
from
'
vs/base/node/processes
'
;
import
{
IOutputService
,
IOutputChannel
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputService
,
IOutputChannel
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
I
SystemVariables
}
from
'
vs/base/common/parsers
'
;
import
{
I
ConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ValidationStatus
}
from
'
vs/base/common/parsers
'
;
import
{
ValidationStatus
}
from
'
vs/base/common/parsers
'
;
...
@@ -37,11 +37,11 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
...
@@ -37,11 +37,11 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
public
static
TelemetryEventName
:
string
=
'
taskService
'
;
public
static
TelemetryEventName
:
string
=
'
taskService
'
;
private
fileConfig
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
private
fileConfig
:
FileConfig
.
ExternalTaskRunnerConfiguration
;
private
variables
:
ISystemVariables
;
private
markerService
:
IMarkerService
;
private
markerService
:
IMarkerService
;
private
modelService
:
IModelService
;
private
modelService
:
IModelService
;
private
outputService
:
IOutputService
;
private
outputService
:
IOutputService
;
private
telemetryService
:
ITelemetryService
;
private
telemetryService
:
ITelemetryService
;
private
configurationResolverService
:
IConfigurationResolverService
;
private
validationStatus
:
ValidationStatus
;
private
validationStatus
:
ValidationStatus
;
private
defaultBuildTaskIdentifier
:
string
;
private
defaultBuildTaskIdentifier
:
string
;
...
@@ -54,14 +54,15 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
...
@@ -54,14 +54,15 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
private
activeTaskIdentifier
:
string
;
private
activeTaskIdentifier
:
string
;
private
activeTaskPromise
:
TPromise
<
ITaskSummary
>
;
private
activeTaskPromise
:
TPromise
<
ITaskSummary
>
;
constructor
(
fileConfig
:
FileConfig
.
ExternalTaskRunnerConfiguration
,
variables
:
ISystemVariables
,
markerService
:
IMarkerService
,
modelService
:
IModelService
,
telemetryService
:
ITelemetryService
,
outputService
:
IOutputService
,
outputChannelId
:
string
,
clearOutput
:
boolean
=
true
)
{
constructor
(
fileConfig
:
FileConfig
.
ExternalTaskRunnerConfiguration
,
markerService
:
IMarkerService
,
modelService
:
IModelService
,
telemetryService
:
ITelemetryService
,
outputService
:
IOutputService
,
configurationResolverService
:
IConfigurationResolverService
,
outputChannelId
:
string
,
clearOutput
:
boolean
=
true
)
{
super
();
super
();
this
.
fileConfig
=
fileConfig
;
this
.
fileConfig
=
fileConfig
;
this
.
variables
=
variables
;
this
.
markerService
=
markerService
;
this
.
markerService
=
markerService
;
this
.
modelService
=
modelService
;
this
.
modelService
=
modelService
;
this
.
outputService
=
outputService
;
this
.
outputService
=
outputService
;
this
.
telemetryService
=
telemetryService
;
this
.
telemetryService
=
telemetryService
;
this
.
configurationResolverService
=
configurationResolverService
;
this
.
defaultBuildTaskIdentifier
=
null
;
this
.
defaultBuildTaskIdentifier
=
null
;
this
.
defaultTestTaskIdentifier
=
null
;
this
.
defaultTestTaskIdentifier
=
null
;
...
@@ -405,7 +406,7 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
...
@@ -405,7 +406,7 @@ export class ProcessRunnerSystem extends EventEmitter implements ITaskSystem {
}
}
private
resolveVariable
(
value
:
string
):
string
{
private
resolveVariable
(
value
:
string
):
string
{
return
this
.
variables
.
resolve
(
value
);
return
this
.
configurationResolverService
.
resolve
(
value
);
}
}
public
log
(
value
:
string
):
void
{
public
log
(
value
:
string
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录