OLD | NEW |
1 #library("postProcess"); | 1 #library("postProcess"); |
2 | 2 |
3 #import("../../../frog/lib/node/node.dart"); | |
4 #import("dart:json"); | 3 #import("dart:json"); |
5 #import("util.dart"); | 4 #import("util.dart"); |
6 | 5 |
7 void main() { | 6 void main() { |
8 // Database of code documentation. | 7 // Database of code documentation. |
9 Map<String, List> database = JSON.parse( | 8 Map<String, List> database = JSON.parse( |
10 fs.readFileSync('output/database.json', 'utf8')); | 9 fs.readFileSync('output/database.json', 'utf8')); |
11 final filteredDb = {}; | 10 final filteredDb = {}; |
12 final obsolete = []; | 11 final obsolete = []; |
13 for (String type in database.getKeys()) { | 12 for (String type in database.getKeys()) { |
14 final entry = pickBestEntry(database[type], type); | 13 final entry = pickBestEntry(database[type], type); |
15 filteredDb[type] = entry; | 14 filteredDb[type] = entry; |
16 if (entry.containsKey("members")) { | 15 if (entry.containsKey("members")) { |
17 Map members = getMembersMap(entry); | 16 Map members = getMembersMap(entry); |
18 for (String name in members.getKeys()) { | 17 for (String name in members.getKeys()) { |
19 Map memberData = members[name]; | 18 Map memberData = members[name]; |
20 if (memberData['obsolete'] == true) { | 19 if (memberData['obsolete'] == true) { |
21 obsolete.add({'type': type, 'member' : name}); | 20 obsolete.add({'type': type, 'member' : name}); |
22 } | 21 } |
23 } | 22 } |
24 } | 23 } |
25 } | 24 } |
26 fs.writeFileSync("output/database.filtered.json", | 25 fs.writeFileSync("output/database.filtered.json", |
27 JSON.stringify(filteredDb)); | 26 JSON.stringify(filteredDb)); |
28 fs.writeFileSync("output/obsolete.json", JSON.stringify(obsolete)); | 27 fs.writeFileSync("output/obsolete.json", JSON.stringify(obsolete)); |
29 } | 28 } |
OLD | NEW |