| OLD | NEW |
| 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 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
| 6 | 6 |
| 7 import java.io.File; | 7 import java.io.File; |
| 8 import java.net.URI; | 8 import java.net.URI; |
| 9 import java.net.URISyntaxException; | 9 import java.net.URISyntaxException; |
| 10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 | 218 |
| 219 public List<File> getPackageRoots(){ | 219 public List<File> getPackageRoots(){ |
| 220 return packageRoots; | 220 return packageRoots; |
| 221 } | 221 } |
| 222 | 222 |
| 223 | 223 |
| 224 public void setPackageRoots(List<File> roots){ | 224 public void setPackageRoots(List<File> roots){ |
| 225 if (roots == null || roots.isEmpty()){ | 225 if (roots == null || roots.isEmpty()){ |
| 226 this.packageRoots = DEFAULT_PACKAGE_ROOTS; | 226 roots = DEFAULT_PACKAGE_ROOTS; |
| 227 } else { | |
| 228 packageRoots.clear(); | |
| 229 for (File file : roots){ | |
| 230 packageRoots.add(file.getAbsoluteFile()); | |
| 231 } | |
| 232 } | 227 } |
| 228 packageRoots.clear(); |
| 229 for (File file : roots){ |
| 230 packageRoots.add(file.getAbsoluteFile()); |
| 231 } |
| 233 packageRootsUri.clear(); | 232 packageRootsUri.clear(); |
| 234 for (File file : roots){ | 233 for (File file : roots){ |
| 235 packageRootsUri.add(file.toURI()); | 234 packageRootsUri.add(file.toURI()); |
| 236 } | 235 } |
| 237 } | 236 } |
| 238 | 237 |
| 239 /** | 238 /** |
| 240 * Translate the URI from dart://[host]/[pathToLib] (e.g. dart://html/html.dar
t) | 239 * Translate the URI from dart://[host]/[pathToLib] (e.g. dart://html/html.dar
t) |
| 241 * to a "file:" URI (e.g. "file:/some/install/directory/html.dart") | 240 * to a "file:" URI (e.g. "file:/some/install/directory/html.dart") |
| 242 * | 241 * |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return SDK_LIBRARY_MANAGER.getAllSystemLibraries(); | 312 return SDK_LIBRARY_MANAGER.getAllSystemLibraries(); |
| 314 } | 313 } |
| 315 | 314 |
| 316 public File getSdkLibPath() { | 315 public File getSdkLibPath() { |
| 317 return SDK_LIBRARY_MANAGER.getSdkLibPath(); | 316 return SDK_LIBRARY_MANAGER.getSdkLibPath(); |
| 318 } | 317 } |
| 319 | 318 |
| 320 | 319 |
| 321 | 320 |
| 322 } | 321 } |
| OLD | NEW |