@@ -31,7 +31,7 @@ public void Generate(IEnumerable<string> typeScriptFiles)
31
31
var list = new List < string > ( ) ;
32
32
string libFile = null ;
33
33
34
- foreach ( var file in typeScriptFiles )
34
+ foreach ( var file in typeScriptFiles )
35
35
{
36
36
if ( ! alreadyProcessed . Contains ( file ) )
37
37
{
@@ -95,7 +95,10 @@ private void GenerateCore(IEnumerable<string> fileNames, string libFile)
95
95
ProcessLaunchService . ProcessRunResult result ;
96
96
try
97
97
{
98
- result = new ProcessLaunchService ( ) . RunAndRedirectOutput ( "node" , arguments ) ;
98
+ using ( Disposable . Timing ( "Calling Node.js to process TypeScript" ) )
99
+ {
100
+ result = new ProcessLaunchService ( ) . RunAndRedirectOutput ( "node" , arguments ) ;
101
+ }
99
102
}
100
103
catch ( Win32Exception )
101
104
{
@@ -104,24 +107,27 @@ private void GenerateCore(IEnumerable<string> fileNames, string libFile)
104
107
return ;
105
108
}
106
109
107
- foreach ( var file in Directory . GetFiles ( output ) )
110
+ using ( Disposable . Timing ( "Generating TypeScript files" ) )
108
111
{
109
- if ( Path . GetFileNameWithoutExtension ( file ) == "ok" )
112
+ foreach ( var file in Directory . GetFiles ( output ) )
110
113
{
111
- continue ;
112
- }
114
+ if ( Path . GetFileNameWithoutExtension ( file ) == "ok" )
115
+ {
116
+ continue ;
117
+ }
113
118
114
- if ( Path . GetFileNameWithoutExtension ( file ) == "error" )
115
- {
116
- var errorContent = File . ReadAllText ( file ) ;
117
- Log . Exception ( DateTime . Now . ToString ( ) + " " + errorContent ) ;
118
- return ;
119
- }
119
+ if ( Path . GetFileNameWithoutExtension ( file ) == "error" )
120
+ {
121
+ var errorContent = File . ReadAllText ( file ) ;
122
+ Log . Exception ( DateTime . Now . ToString ( ) + " " + errorContent ) ;
123
+ return ;
124
+ }
120
125
121
- var text = File . ReadAllText ( file ) ;
122
- AnalyzedFile analysis = JsonConvert . DeserializeObject < AnalyzedFile > ( text ) ;
126
+ var text = File . ReadAllText ( file ) ;
127
+ AnalyzedFile analysis = JsonConvert . DeserializeObject < AnalyzedFile > ( text ) ;
123
128
124
- EnsureFileGeneratedAndGetUrl ( analysis ) ;
129
+ EnsureFileGeneratedAndGetUrl ( analysis ) ;
130
+ }
125
131
}
126
132
}
127
133
0 commit comments