OLD | NEW |
| (Empty) |
1 /** | |
2 * Read database.json, | |
3 * write database.filtered.json (with "best" entries) | |
4 * and obsolete.json (with entries marked obsolete). | |
5 */ | |
6 | |
7 library postProcess; | |
8 | |
9 import 'dart:convert'; | |
10 import 'dart:io'; | |
11 import 'util.dart'; | |
12 | |
13 void main() { | |
14 // Database of code documentation. | |
15 Map<String, List> database = JSON.decode( | |
16 new File('output/database.json').readAsStringSync()); | |
17 final filteredDb = {}; | |
18 final obsolete = []; | |
19 for (String type in database.keys) { | |
20 final entry = pickBestEntry(database[type], type); | |
21 if (entry == null) { | |
22 print("Can't find ${type} in database. Skipping."); | |
23 continue; | |
24 } | |
25 filteredDb[type] = entry; | |
26 if (entry.containsKey("members")) { | |
27 Map members = getMembersMap(entry); | |
28 for (String name in members.keys) { | |
29 Map memberData = members[name]; | |
30 if (memberData['obsolete'] == true) { | |
31 obsolete.add({'type': type, 'member' : name}); | |
32 } | |
33 } | |
34 } | |
35 } | |
36 writeFileSync("output/database.filtered.json", JSON.encode(filteredDb)); | |
37 writeFileSync("output/obsolete.json", JSON.encode(obsolete)); | |
38 } | |
OLD | NEW |