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

Unified Diff: compiler/java/com/google/dart/compiler/SystemLibraryManager.java

Issue 10907096: modify files view to use declared sdk libraries (Closed) Base URL: http://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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/SystemLibraryManager.java
===================================================================
--- compiler/java/com/google/dart/compiler/SystemLibraryManager.java (revision 11969)
+++ compiler/java/com/google/dart/compiler/SystemLibraryManager.java (working copy)
@@ -110,6 +110,9 @@
return result;
}
+ public Collection<SystemLibrary> getAllSystemLibraries(){
+ return libraries;
+ }
/**
* Load the libraries listed out in the libraries.dart files as read by the {@link SystemLibrariesReader}
@@ -131,7 +134,8 @@
continue;
}
String shortName = entry.getKey().trim();
- String path = entry.getValue().getPath();
+ DartLibrary library = entry.getValue();
+ String path = library.getPath();
File file;
try {
file = new File(base.resolve(new URI(null, null, path, null, null)).normalize());
@@ -150,20 +154,29 @@
String scheme = shortName.substring(0, index + 1);
String name = shortName.substring(index + 1);
String host = file.getParentFile().getName();
- addLib(scheme, host, name, file.getParentFile(), file.getName());
+ addLib(scheme,
+ host,
+ name,
+ file.getParentFile(),
+ file.getName(),
+ library.getCategory(),
+ library.isDocumented(),
+ library.isImplementation());
}
return libraries.toArray(new SystemLibrary[libraries.size()]);
}
- private boolean addLib(String scheme, String host, String name, File dir, String libFileName)
+ private boolean addLib(String scheme, String host, String name, File dir, String libFileName,
+ String category, boolean documented, boolean implementation)
throws AssertionError {
+
File libFile = new File(dir, libFileName);
if (!libFile.isFile()) {
throw new InternalCompilerException("Error mapping dart:" + host + ", path "
+ libFile.getAbsolutePath() + " is not a file.");
}
- SystemLibrary lib = new SystemLibrary(name, host, libFileName, dir);
+ SystemLibrary lib = new SystemLibrary(name, host, libFileName, dir, category,documented, implementation);
libraries.add(lib);
String libSpec = scheme + name;
URI libUri;

Powered by Google App Engine
This is Rietveld 408576698