| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 com.google.common.collect.Lists; | 7 import com.google.common.collect.Lists; |
| 8 | 8 |
| 9 import java.io.BufferedInputStream; | 9 import java.io.BufferedInputStream; |
| 10 import java.io.File; | 10 import java.io.File; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 addLib(shortName, host, host, child, dartFile.getName()); | 242 addLib(shortName, host, host, child, dartFile.getName()); |
| 243 } | 243 } |
| 244 } else { | 244 } else { |
| 245 // Otherwise treat the entry as an explicit shortName to dart file mappi
ng | 245 // Otherwise treat the entry as an explicit shortName to dart file mappi
ng |
| 246 int index = shortName.indexOf(':'); | 246 int index = shortName.indexOf(':'); |
| 247 if (index == -1) { | 247 if (index == -1) { |
| 248 continue; | 248 continue; |
| 249 } | 249 } |
| 250 explicitShortNames.add(shortName); | 250 explicitShortNames.add(shortName); |
| 251 String scheme = shortName.substring(0, index + 1); | 251 String scheme = shortName.substring(0, index + 1); |
| 252 String host = shortName.substring(index + 1); | 252 String name = shortName.substring(index + 1); |
| 253 addLib(scheme, host, host, file.getParentFile(), file.getName()); | 253 index = name.indexOf('/'); |
| 254 String host = index > 0 ? name.substring(0, index) : name; |
| 255 addLib(scheme, host, name, file.getParentFile(), file.getName()); |
| 254 } | 256 } |
| 255 } | 257 } |
| 256 return libraries.toArray(new SystemLibrary[libraries.size()]); | 258 return libraries.toArray(new SystemLibrary[libraries.size()]); |
| 257 } | 259 } |
| 258 | 260 |
| 259 /** | 261 /** |
| 260 * Read the import.config content and return it as a collection of key/value p
airs | 262 * Read the import.config content and return it as a collection of key/value p
airs |
| 261 */ | 263 */ |
| 262 protected Properties getImportConfig() { | 264 protected Properties getImportConfig() { |
| 263 Properties importConfig = new Properties(); | 265 Properties importConfig = new Properties(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (existingLib != null) { | 315 if (existingLib != null) { |
| 314 libraries.remove(existingLib); | 316 libraries.remove(existingLib); |
| 315 } | 317 } |
| 316 libraries.add(library); | 318 libraries.add(library); |
| 317 hostMap.put(host, library); | 319 hostMap.put(host, library); |
| 318 expansionMap.put(library.getShortName(), | 320 expansionMap.put(library.getShortName(), |
| 319 "//" + host + "/" + library.getPathToLib()); | 321 "//" + host + "/" + library.getPathToLib()); |
| 320 } | 322 } |
| 321 } | 323 } |
| 322 } | 324 } |
| OLD | NEW |