Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: utils/apidoc/scripts/list_files.dart

Issue 10914255: Changed final to const in apidoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/apidoc/mdn/extract.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Traverses apidoc and dartdoc and lists all possible input files that are 6 * Traverses apidoc and dartdoc and lists all possible input files that are
7 * used when building API documentation. Used by gyp to determine when apidocs 7 * used when building API documentation. Used by gyp to determine when apidocs
8 * need to be regenerated (see `apidoc.gyp`). 8 * need to be regenerated (see `apidoc.gyp`).
9 */ 9 */
10 #library('list_files'); 10 #library('list_files');
11 11
12 #import('dart:io'); 12 #import('dart:io');
13 13
14 final allowedExtensions = const [ 14 const allowedExtensions = const [
15 '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt' 15 '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt'
16 ]; 16 ];
17 17
18 void main() { 18 void main() {
19 final scriptDir = new File(new Options().script).directorySync().path; 19 final scriptDir = new File(new Options().script).directorySync().path;
20 final dartDir = '$scriptDir/../../../'; 20 final dartDir = '$scriptDir/../../../';
21 listFiles('$dartDir/utils/apidoc'); 21 listFiles('$dartDir/utils/apidoc');
22 listFiles('$dartDir/pkg/dartdoc'); 22 listFiles('$dartDir/pkg/dartdoc');
23 } 23 }
24 24
25 void listFiles(String dirPath) { 25 void listFiles(String dirPath) {
26 final dir = new Directory(dirPath); 26 final dir = new Directory(dirPath);
27 27
28 dir.onFile = (path) { 28 dir.onFile = (path) {
29 if (allowedExtensions.indexOf(extension(path)) != -1) { 29 if (allowedExtensions.indexOf(extension(path)) != -1) {
30 print(path); 30 print(path);
31 } 31 }
32 }; 32 };
33 33
34 dir.list(recursive: true); 34 dir.list(recursive: true);
35 } 35 }
36 36
37 String extension(String path) { 37 String extension(String path) {
38 int lastDot = path.lastIndexOf('.'); 38 int lastDot = path.lastIndexOf('.');
39 if (lastDot == -1) return ''; 39 if (lastDot == -1) return '';
40 40
41 return path.substring(lastDot); 41 return path.substring(lastDot);
42 } 42 }
OLDNEW
« no previous file with comments | « utils/apidoc/mdn/extract.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698