OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Set of flags and options passed to the compiler | 5 /// Set of flags and options passed to the compiler |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:args/args.dart'; | 9 import 'package:args/args.dart'; |
10 import 'package:cli_util/cli_util.dart' show getSdkDir; | 10 import 'package:cli_util/cli_util.dart' show getSdkDir; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 var customUrlMappings = <String, String>{}; | 226 var customUrlMappings = <String, String>{}; |
227 for (var mapping in args['url-mapping']) { | 227 for (var mapping in args['url-mapping']) { |
228 var splitMapping = mapping.split(','); | 228 var splitMapping = mapping.split(','); |
229 if (splitMapping.length != 2) { | 229 if (splitMapping.length != 2) { |
230 showUsage = true; | 230 showUsage = true; |
231 continue; | 231 continue; |
232 } | 232 } |
233 customUrlMappings[splitMapping[0]] = splitMapping[1]; | 233 customUrlMappings[splitMapping[0]] = splitMapping[1]; |
234 } | 234 } |
235 | 235 |
236 if (serverMode && args.rest.length != 1) showUsage = true; | |
237 | |
238 return new CompilerOptions( | 236 return new CompilerOptions( |
239 codegenOptions: new CodegenOptions( | 237 codegenOptions: new CodegenOptions( |
240 emitSourceMaps: args['source-maps'], | 238 emitSourceMaps: args['source-maps'], |
241 forceCompile: args['force-compile'] || serverMode, | 239 forceCompile: args['force-compile'] || serverMode, |
242 closure: args['closure'], | 240 closure: args['closure'], |
243 destructureNamedParams: args['destructure-named-params'], | 241 destructureNamedParams: args['destructure-named-params'], |
244 outputDir: outputDir, | 242 outputDir: outputDir, |
245 arrowFnBindThisWorkaround: args['arrow-fn-bind-this'], | 243 arrowFnBindThisWorkaround: args['arrow-fn-bind-this'], |
246 moduleFormat: parseModuleFormat(args['modules'])), | 244 moduleFormat: parseModuleFormat(args['modules'])), |
247 sourceOptions: new SourceResolverOptions( | 245 sourceOptions: new SourceResolverOptions( |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // The pub-cache directory is two levels up, but we verify that the layout | 408 // The pub-cache directory is two levels up, but we verify that the layout |
411 // looks correct. | 409 // looks correct. |
412 if (path.basename(dir) != 'dev_compiler') return null; | 410 if (path.basename(dir) != 'dev_compiler') return null; |
413 dir = path.dirname(dir); | 411 dir = path.dirname(dir); |
414 if (path.basename(dir) != 'global_packages') return null; | 412 if (path.basename(dir) != 'global_packages') return null; |
415 dir = path.dirname(dir); | 413 dir = path.dirname(dir); |
416 return path.join(dir, cacheDir, 'lib', 'runtime'); | 414 return path.join(dir, cacheDir, 'lib', 'runtime'); |
417 } | 415 } |
418 return null; | 416 return null; |
419 } | 417 } |
OLD | NEW |