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

Unified Diff: pkg/polymer/lib/deploy.dart

Issue 211393006: Enables codegen support in polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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: pkg/polymer/lib/deploy.dart
diff --git a/pkg/polymer/lib/deploy.dart b/pkg/polymer/lib/deploy.dart
index 8e5f724d10e8204eca85042c7b324d6d759c4dd0..882418c4305b1a1b71093d1e6e0e2a64530300c5 100644
--- a/pkg/polymer/lib/deploy.dart
+++ b/pkg/polymer/lib/deploy.dart
@@ -27,6 +27,7 @@ import 'package:path/path.dart' as path;
import 'src/build/common.dart' show TransformOptions, phasesForPolymer;
import 'src/build/runner.dart';
import 'transformer.dart';
Jennifer Messerly 2014/03/27 02:20:32 move up by other package: imports?
Siggi Cherem (dart-lang) 2014/03/28 01:04:26 Done.
+import 'package:code_transformers/tests.dart' show testingDartSdkDirectory;
main(List<String> arguments) {
var args = _parseArgs(arguments);
@@ -60,8 +61,6 @@ main(List<String> arguments) {
.catchError(_reportErrorAndExit);
}
-createDeployPhases(options) => new PolymerTransformerGroup(options).phases;
-
BarbackOptions _createTestOptions(String testFile, String outDir,
Jennifer Messerly 2014/03/27 02:20:32 off topic, but I wonder how long until we can use
Siggi Cherem (dart-lang) 2014/03/28 01:04:26 not clear yet. There is still a lot of work to be
bool directlyIncludeJS, bool contentSecurityPolicy, bool releaseMode) {
@@ -78,8 +77,8 @@ BarbackOptions _createTestOptions(String testFile, String outDir,
}
var packageName = readCurrentPackageFromPubspec(pubspecDir);
- // Find the dart-root so we can include both polymer and smoke as additional
- // packages whose transformers we need to run.
+ // Find the dart-root so we can include all package dependencies and
+ // transformers from other packages.
var pkgDir = path.join(_findDirWithDir(path.absolute(testDir), 'pkg'), 'pkg');
var phases = createDeployPhases(new TransformOptions(
@@ -87,17 +86,17 @@ BarbackOptions _createTestOptions(String testFile, String outDir,
directlyIncludeJS: directlyIncludeJS,
contentSecurityPolicy: contentSecurityPolicy,
releaseMode: releaseMode,
- lint: false));
+ lint: false), sdkDir: testingDartSdkDirectory);
+ var dirs = {};
+ // Note: we include all packages in pkg/ to keep things simple. Ideally this
+ // should be restricted to the transitive dependencies of this package.
+ _subDirs(pkgDir).forEach((p) { dirs[path.basename(p)] = p; });
+ // Note: packageName may be a duplicate of 'polymer', but that's ok (they
+ // should be the same value).
+ dirs[packageName]= pubspecDir;
return new BarbackOptions(phases, outDir,
currentPackage: packageName,
- packageDirs: {
- 'polymer': path.join(pkgDir, 'polymer'),
- 'smoke': path.join(pkgDir, 'smoke'),
- // packageName may be a duplicate of 'polymer', but that's ok, the
- // following will be the value used in the map (they should also be the
- // same value).
- packageName: pubspecDir,
- },
+ packageDirs: dirs,
// TODO(sigmund): include here also smoke transformer when it's on by
// default.
packagePhases: {'polymer': phasesForPolymer},
@@ -124,6 +123,11 @@ String _findDirWithDir(String dir, String subdir) {
return dir;
}
+List<String> _subDirs(String dir) =>
+ new Directory(dir).listSync(recursive: false, followLinks: false)
Jennifer Messerly 2014/03/27 02:20:32 fyi -- recursive: false is the default: https://ap
Siggi Cherem (dart-lang) 2014/03/28 01:04:26 thx, done
+ .where((d) => d is Directory).map((d) => d.path).toList();
+
+
void _reportErrorAndExit(e, trace) {
print('Uncaught error: $e');
if (trace != null) print(trace);

Powered by Google App Engine
This is Rietveld 408576698