OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'package:path/path.dart'; | 6 import 'package:path/path.dart'; |
7 import 'main.dart' as performance; | 7 import 'main.dart' as performance; |
8 | 8 |
9 // Local driver for performance measurement | 9 // Local driver for performance measurement |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /* | 44 /* |
45 * Symlink the out or xcodebuild directory | 45 * Symlink the out or xcodebuild directory |
46 */ | 46 */ |
47 var outDirName = 'out'; | 47 var outDirName = 'out'; |
48 if (!new Directory(join(gitDir.path, outDirName)).existsSync()) { | 48 if (!new Directory(join(gitDir.path, outDirName)).existsSync()) { |
49 outDirName = 'xcodebuild'; | 49 outDirName = 'xcodebuild'; |
50 } | 50 } |
51 if (!new Directory(join(gitDir.path, outDirName)).existsSync()) { | 51 if (!new Directory(join(gitDir.path, outDirName)).existsSync()) { |
52 throw 'failed to find out or xcodebuild directory'; | 52 throw 'failed to find out or xcodebuild directory'; |
53 } | 53 } |
54 result = Process.runSync('ln', [ | 54 result = Process.runSync('ln', |
55 '-s', | 55 ['-s', join(gitDir.path, outDirName), join(tmpSrcDirPath, outDirName)]); |
56 join(gitDir.path, outDirName), | |
57 join(tmpSrcDirPath, outDirName) | |
58 ]); | |
59 if (result.exitCode != 0) throw 'failed to link out or xcodebuild: $result'; | 56 if (result.exitCode != 0) throw 'failed to link out or xcodebuild: $result'; |
60 /* | 57 /* |
61 * Collect arguments | 58 * Collect arguments |
62 */ | 59 */ |
63 var perfArgs = ['-i${inputFile.path}', '-t$tmpSrcDirPath',]; | 60 var perfArgs = ['-i${inputFile.path}', '-t$tmpSrcDirPath',]; |
64 for (int index = 3; index < args.length; ++index) { | 61 for (int index = 3; index < args.length; ++index) { |
65 perfArgs.add(args[index].replaceAll('@tmpSrcDir@', tmpSrcDirPath)); | 62 perfArgs.add(args[index].replaceAll('@tmpSrcDir@', tmpSrcDirPath)); |
66 } | 63 } |
67 perfArgs.add('-m${gitDir.path},$tmpSrcDirPath'); | 64 perfArgs.add('-m${gitDir.path},$tmpSrcDirPath'); |
68 /* | 65 /* |
(...skipping 11 matching lines...) Expand all Loading... |
80 } | 77 } |
81 print('''Required arguments: <gitDir> <branch> <inputFile> | 78 print('''Required arguments: <gitDir> <branch> <inputFile> |
82 gitDir = a path to the git repository containing the initial target source | 79 gitDir = a path to the git repository containing the initial target source |
83 branch = the branch containing the initial target source | 80 branch = the branch containing the initial target source |
84 inputFile = the instrumentation or log file | 81 inputFile = the instrumentation or log file |
85 | 82 |
86 Optional arguments:'''); | 83 Optional arguments:'''); |
87 print(performance.argParser.usage); | 84 print(performance.argParser.usage); |
88 exit(1); | 85 exit(1); |
89 } | 86 } |
OLD | NEW |