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

Side by Side Diff: compiler/java/com/google/dart/runner/BundleLibrarySource.java

Issue 9466041: Removes dependency on v8 from dartc testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated date, copyright notices, build.xml Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 package com.google.dart.runner;
6
7 import com.google.dart.compiler.DartSource;
8 import com.google.dart.compiler.LibrarySource;
9 import com.google.dart.compiler.UrlDartSource;
10 import com.google.dart.compiler.UrlSource;
11
12 import java.net.URISyntaxException;
13
14 class BundleLibrarySource extends UrlSource implements LibrarySource {
15
16 private final class BundleDartSource extends UrlDartSource {
17 private BundleDartSource(ClassLoader loader, String basePath, String filenam e)
18 throws URISyntaxException {
19 super(loader.getResource(basePath + filename).toURI(), filename, BundleLib rarySource.this);
20 }
21
22 @Override
23 public String getName() {
24 return basePath + getRelativePath();
25 }
26 }
27
28 private final ClassLoader loader;
29 private final String basePath;
30 private final String filename;
31
32 public BundleLibrarySource(ClassLoader loader, String basePath, String filenam e)
33 throws URISyntaxException {
34 super(loader.getResource(basePath + filename).toURI());
35 this.loader = loader;
36 this.basePath = basePath;
37 this.filename = filename;
38 }
39
40 @Override
41 public LibrarySource getImportFor(String relPath) {
42 try {
43 return new BundleLibrarySource(loader, basePath, relPath);
44 } catch (URISyntaxException e) {
45 return null;
46 }
47 }
48
49 @Override
50 public DartSource getSourceFor(String relPath) {
51 try {
52 return new BundleDartSource(loader, basePath, relPath);
53 } catch (URISyntaxException e) {
54 return null;
55 }
56 }
57
58 @Override
59 public String getName() {
60 return basePath + filename;
61 }
62 }
OLDNEW
« no previous file with comments | « compiler/java/com/google/dart/compiler/UnitTestBatchRunner.java ('k') | compiler/java/com/google/dart/runner/DartRunner.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698