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 library dev_compiler.src.options; | 6 library dev_compiler.src.options; |
7 | 7 |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 var customUrlMappings = <String, String>{}; | 227 var customUrlMappings = <String, String>{}; |
228 for (var mapping in args['url-mapping']) { | 228 for (var mapping in args['url-mapping']) { |
229 var splitMapping = mapping.split(','); | 229 var splitMapping = mapping.split(','); |
230 if (splitMapping.length != 2) { | 230 if (splitMapping.length != 2) { |
231 showUsage = true; | 231 showUsage = true; |
232 continue; | 232 continue; |
233 } | 233 } |
234 customUrlMappings[splitMapping[0]] = splitMapping[1]; | 234 customUrlMappings[splitMapping[0]] = splitMapping[1]; |
235 } | 235 } |
236 | 236 |
237 if (serverMode && args.rest.length != 1) showUsage = true; | |
238 | |
239 return new CompilerOptions( | 237 return new CompilerOptions( |
240 codegenOptions: new CodegenOptions( | 238 codegenOptions: new CodegenOptions( |
241 emitSourceMaps: args['source-maps'], | 239 emitSourceMaps: args['source-maps'], |
242 forceCompile: args['force-compile'] || serverMode, | 240 forceCompile: args['force-compile'] || serverMode, |
243 closure: args['closure'], | 241 closure: args['closure'], |
244 destructureNamedParams: args['destructure-named-params'], | 242 destructureNamedParams: args['destructure-named-params'], |
245 outputDir: outputDir, | 243 outputDir: outputDir, |
246 arrowFnBindThisWorkaround: args['arrow-fn-bind-this'], | 244 arrowFnBindThisWorkaround: args['arrow-fn-bind-this'], |
247 moduleFormat: parseModuleFormat(args['modules'])), | 245 moduleFormat: parseModuleFormat(args['modules'])), |
248 sourceOptions: new SourceResolverOptions( | 246 sourceOptions: new SourceResolverOptions( |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // The pub-cache directory is two levels up, but we verify that the layout | 407 // The pub-cache directory is two levels up, but we verify that the layout |
410 // looks correct. | 408 // looks correct. |
411 if (path.basename(dir) != 'dev_compiler') return null; | 409 if (path.basename(dir) != 'dev_compiler') return null; |
412 dir = path.dirname(dir); | 410 dir = path.dirname(dir); |
413 if (path.basename(dir) != 'global_packages') return null; | 411 if (path.basename(dir) != 'global_packages') return null; |
414 dir = path.dirname(dir); | 412 dir = path.dirname(dir); |
415 return path.join(dir, cacheDir, 'lib', 'runtime'); | 413 return path.join(dir, cacheDir, 'lib', 'runtime'); |
416 } | 414 } |
417 return null; | 415 return null; |
418 } | 416 } |
OLD | NEW |