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

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
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/lib/src/build/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/deploy.dart
diff --git a/pkg/polymer/lib/deploy.dart b/pkg/polymer/lib/deploy.dart
index 8e5f724d10e8204eca85042c7b324d6d759c4dd0..a6e302facdb25faa9068c66e46215db3ea4fc108 100644
--- a/pkg/polymer/lib/deploy.dart
+++ b/pkg/polymer/lib/deploy.dart
@@ -23,7 +23,9 @@ library polymer.deploy;
import 'dart:io';
import 'package:args/args.dart';
+import 'package:code_transformers/tests.dart' show testingDartSdkDirectory;
import 'package:path/path.dart' as path;
+
import 'src/build/common.dart' show TransformOptions, phasesForPolymer;
import 'src/build/runner.dart';
import 'transformer.dart';
@@ -60,8 +62,6 @@ main(List<String> arguments) {
.catchError(_reportErrorAndExit);
}
-createDeployPhases(options) => new PolymerTransformerGroup(options).phases;
-
BarbackOptions _createTestOptions(String testFile, String outDir,
bool directlyIncludeJS, bool contentSecurityPolicy, bool releaseMode) {
@@ -78,8 +78,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 +87,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 +124,10 @@ String _findDirWithDir(String dir, String subdir) {
return dir;
}
+List<String> _subDirs(String dir) =>
+ new Directory(dir).listSync(followLinks: false)
+ .where((d) => d is Directory).map((d) => d.path).toList();
+
void _reportErrorAndExit(e, trace) {
print('Uncaught error: $e');
if (trace != null) print(trace);
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/lib/src/build/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698