@@ -6,6 +6,8 @@ var path = require("path");
6
6
var child_process = require ( "child_process" ) ;
7
7
var fold = require ( "travis-fold" ) ;
8
8
var runTestsInParallel = require ( "./scripts/mocha-parallel" ) . runTestsInParallel ;
9
+ var ts = require ( "./lib/typescript" ) ;
10
+
9
11
10
12
// Variables
11
13
var compilerDirectory = "src/compiler/" ;
@@ -34,6 +36,24 @@ if (process.env.path !== undefined) {
34
36
process . env . PATH = nodeModulesPathPrefix + process . env . PATH ;
35
37
}
36
38
39
+ function filesFromConfig ( configPath ) {
40
+ var configText = fs . readFileSync ( configPath ) . toString ( ) ;
41
+ var config = ts . parseConfigFileTextToJson ( configPath , configText , /*stripComments*/ true ) ;
42
+ if ( config . error ) {
43
+ throw new Error ( diagnosticsToString ( [ config . error ] ) ) ;
44
+ }
45
+ const configFileContent = ts . parseJsonConfigFileContent ( config . config , ts . sys , path . dirname ( configPath ) ) ;
46
+ if ( configFileContent . errors && configFileContent . errors . length ) {
47
+ throw new Error ( diagnosticsToString ( configFileContent . errors ) ) ;
48
+ }
49
+
50
+ return configFileContent . fileNames ;
51
+
52
+ function diagnosticsToString ( s ) {
53
+ return s . map ( function ( e ) { return ts . flattenDiagnosticMessageText ( e . messageText , ts . sys . newLine ) ; } ) . join ( ts . sys . newLine ) ;
54
+ }
55
+ }
56
+
37
57
function toNs ( diff ) {
38
58
return diff [ 0 ] * 1e9 + diff [ 1 ] ;
39
59
}
@@ -56,173 +76,12 @@ function measure(marker) {
56
76
console . log ( "travis_time:end:" + marker . id + ":start=" + toNs ( marker . stamp ) + ",finish=" + toNs ( total ) + ",duration=" + toNs ( diff ) + "\r" ) ;
57
77
}
58
78
59
- var compilerSources = [
60
- "core.ts" ,
61
- "performance.ts" ,
62
- "sys.ts" ,
63
- "types.ts" ,
64
- "scanner.ts" ,
65
- "parser.ts" ,
66
- "utilities.ts" ,
67
- "binder.ts" ,
68
- "checker.ts" ,
69
- "factory.ts" ,
70
- "visitor.ts" ,
71
- "transformers/destructuring.ts" ,
72
- "transformers/ts.ts" ,
73
- "transformers/jsx.ts" ,
74
- "transformers/esnext.ts" ,
75
- "transformers/es2017.ts" ,
76
- "transformers/es2016.ts" ,
77
- "transformers/es2015.ts" ,
78
- "transformers/generators.ts" ,
79
- "transformers/es5.ts" ,
80
- "transformers/module/es2015.ts" ,
81
- "transformers/module/system.ts" ,
82
- "transformers/module/module.ts" ,
83
- "transformer.ts" ,
84
- "sourcemap.ts" ,
85
- "comments.ts" ,
86
- "declarationEmitter.ts" ,
87
- "emitter.ts" ,
88
- "program.ts" ,
89
- "commandLineParser.ts" ,
90
- "tsc.ts" ,
91
- "diagnosticInformationMap.generated.ts"
92
- ] . map ( function ( f ) {
93
- return path . join ( compilerDirectory , f ) ;
94
- } ) ;
95
-
96
- var servicesSources = [
97
- "core.ts" ,
98
- "performance.ts" ,
99
- "sys.ts" ,
100
- "types.ts" ,
101
- "scanner.ts" ,
102
- "parser.ts" ,
103
- "utilities.ts" ,
104
- "binder.ts" ,
105
- "checker.ts" ,
106
- "factory.ts" ,
107
- "visitor.ts" ,
108
- "transformers/destructuring.ts" ,
109
- "transformers/ts.ts" ,
110
- "transformers/jsx.ts" ,
111
- "transformers/esnext.ts" ,
112
- "transformers/es2017.ts" ,
113
- "transformers/es2016.ts" ,
114
- "transformers/es2015.ts" ,
115
- "transformers/generators.ts" ,
116
- "transformers/es5.ts" ,
117
- "transformers/module/es2015.ts" ,
118
- "transformers/module/system.ts" ,
119
- "transformers/module/module.ts" ,
120
- "transformer.ts" ,
121
- "sourcemap.ts" ,
122
- "comments.ts" ,
123
- "declarationEmitter.ts" ,
124
- "emitter.ts" ,
125
- "program.ts" ,
126
- "commandLineParser.ts" ,
127
- "diagnosticInformationMap.generated.ts"
128
- ] . map ( function ( f ) {
129
- return path . join ( compilerDirectory , f ) ;
130
- } ) . concat ( [
131
- "types.ts" ,
132
- "utilities.ts" ,
133
- "breakpoints.ts" ,
134
- "classifier.ts" ,
135
- "completions.ts" ,
136
- "documentHighlights.ts" ,
137
- "documentRegistry.ts" ,
138
- "findAllReferences.ts" ,
139
- "goToDefinition.ts" ,
140
- "goToImplementation.ts" ,
141
- "jsDoc.ts" ,
142
- "jsTyping.ts" ,
143
- "navigateTo.ts" ,
144
- "navigationBar.ts" ,
145
- "outliningElementsCollector.ts" ,
146
- "patternMatcher.ts" ,
147
- "preProcess.ts" ,
148
- "rename.ts" ,
149
- "services.ts" ,
150
- "shims.ts" ,
151
- "signatureHelp.ts" ,
152
- "symbolDisplay.ts" ,
153
- "transpile.ts" ,
154
- // Formatting
155
- "formatting/formatting.ts" ,
156
- "formatting/formattingContext.ts" ,
157
- "formatting/formattingRequestKind.ts" ,
158
- "formatting/formattingScanner.ts" ,
159
- "formatting/references.ts" ,
160
- "formatting/rule.ts" ,
161
- "formatting/ruleAction.ts" ,
162
- "formatting/ruleDescriptor.ts" ,
163
- "formatting/ruleFlag.ts" ,
164
- "formatting/ruleOperation.ts" ,
165
- "formatting/ruleOperationContext.ts" ,
166
- "formatting/rules.ts" ,
167
- "formatting/rulesMap.ts" ,
168
- "formatting/rulesProvider.ts" ,
169
- "formatting/smartIndenter.ts" ,
170
- "formatting/tokenRange.ts" ,
171
- // CodeFixes
172
- "codeFixProvider.ts" ,
173
- "codefixes/fixes.ts" ,
174
- "codefixes/fixExtendsInterfaceBecomesImplements.ts" ,
175
- "codefixes/fixClassIncorrectlyImplementsInterface.ts" ,
176
- "codefixes/fixClassDoesntImplementInheritedAbstractMember.ts" ,
177
- "codefixes/fixClassSuperMustPrecedeThisAccess.ts" ,
178
- "codefixes/fixConstructorForDerivedNeedSuperCall.ts" ,
179
- "codefixes/helpers.ts" ,
180
- "codefixes/importFixes.ts" ,
181
- "codefixes/unusedIdentifierFixes.ts"
182
- ] . map ( function ( f ) {
183
- return path . join ( servicesDirectory , f ) ;
184
- } ) ) ;
185
-
186
- var baseServerCoreSources = [
187
- "builder.ts" ,
188
- "editorServices.ts" ,
189
- "lsHost.ts" ,
190
- "project.ts" ,
191
- "protocol.ts" ,
192
- "scriptInfo.ts" ,
193
- "scriptVersionCache.ts" ,
194
- "session.ts" ,
195
- "shared.ts" ,
196
- "types.ts" ,
197
- "typingsCache.ts" ,
198
- "utilities.ts" ,
199
- ] . map ( function ( f ) {
200
- return path . join ( serverDirectory , f ) ;
201
- } ) ;
202
-
203
- var serverCoreSources = [
204
- "server.ts"
205
- ] . map ( function ( f ) {
206
- return path . join ( serverDirectory , f ) ;
207
- } ) . concat ( baseServerCoreSources ) ;
208
-
209
- var cancellationTokenSources = [
210
- "cancellationToken.ts"
211
- ] . map ( function ( f ) {
212
- return path . join ( cancellationTokenDirectory , f ) ;
213
- } ) ;
214
-
215
- var typingsInstallerSources = [
216
- "../types.ts" ,
217
- "../shared.ts" ,
218
- "typingsInstaller.ts" ,
219
- "nodeTypingsInstaller.ts"
220
- ] . map ( function ( f ) {
221
- return path . join ( typingsInstallerDirectory , f ) ;
222
- } ) ;
223
-
224
- var serverSources = serverCoreSources . concat ( servicesSources ) ;
225
- var languageServiceLibrarySources = baseServerCoreSources . concat ( servicesSources ) ;
79
+ var compilerSources = filesFromConfig ( "./src/compiler/tsconfig.json" ) ;
80
+ var servicesSources = filesFromConfig ( "./src/services/tsconfig.json" ) ;
81
+ var cancellationTokenSources = filesFromConfig ( path . join ( serverDirectory , "cancellationToken/tsconfig.json" ) ) ;
82
+ var typingsInstallerSources = filesFromConfig ( path . join ( serverDirectory , "typingsInstaller/tsconfig.json" ) ) ;
83
+ var serverSources = filesFromConfig ( path . join ( serverDirectory , "tsconfig.json" ) )
84
+ var languageServiceLibrarySources = filesFromConfig ( path . join ( serverDirectory , "tsconfig.library.json" ) ) ;
226
85
227
86
var harnessCoreSources = [
228
87
"harness.ts" ,
@@ -1230,13 +1089,16 @@ var lintTargets = compilerSources
1230
1089
. concat ( harnessSources )
1231
1090
// Other harness sources
1232
1091
. concat ( [ "instrumenter.ts" ] . map ( function ( f ) { return path . join ( harnessDirectory , f ) } ) )
1233
- . concat ( serverCoreSources )
1092
+ . concat ( serverSources )
1234
1093
. concat ( tslintRulesFiles )
1235
1094
. concat ( servicesSources )
1236
1095
. concat ( typingsInstallerSources )
1237
1096
. concat ( cancellationTokenSources )
1238
1097
. concat ( [ "Gulpfile.ts" ] )
1239
- . concat ( [ nodeServerInFile , perftscPath , "tests/perfsys.ts" , webhostPath ] ) ;
1098
+ . concat ( [ nodeServerInFile , perftscPath , "tests/perfsys.ts" , webhostPath ] )
1099
+ . map ( function ( p ) { return path . resolve ( p ) } ) ;
1100
+ // keep only unique items
1101
+ lintTargets = Array . from ( new Set ( lintTargets ) ) ;
1240
1102
1241
1103
function sendNextFile ( files , child , callback , failures ) {
1242
1104
var file = files . pop ( ) ;
0 commit comments