Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** | 5 /** |
| 6 * **Note**: If you already have a `build.dart` in your application, we | 6 * **Note**: If you already have a `build.dart` in your application, we |
| 7 * recommend to use the `package:polymer/builder.dart` library instead. | 7 * recommend to use the `package:polymer/builder.dart` library instead. |
| 8 | 8 |
| 9 * Temporary deploy command used to create a version of the app that can be | 9 * Temporary deploy command used to create a version of the app that can be |
| 10 * compiled with dart2js and deployed. Following pub layout conventions, this | 10 * compiled with dart2js and deployed. Following pub layout conventions, this |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 | 37 |
| 38 var test = args['test']; | 38 var test = args['test']; |
| 39 var outDir = args['out']; | 39 var outDir = args['out']; |
| 40 | 40 |
| 41 var options; | 41 var options; |
| 42 if (test == null) { | 42 if (test == null) { |
| 43 var transformOps = new TransformOptions( | 43 var transformOps = new TransformOptions( |
| 44 directlyIncludeJS: args['js'], | 44 directlyIncludeJS: args['js'], |
| 45 contentSecurityPolicy: args['csp'], | 45 contentSecurityPolicy: args['csp'], |
| 46 releaseMode: !args['debug']); | 46 releaseMode: !args['debug']); |
| 47 options = new BarbackOptions(createDeployPhases(transformOps), outDir); | 47 var phases = createDeployPhases(transformOps); |
| 48 options = new BarbackOptions(phases, outDir, | |
|
Siggi Cherem (dart-lang)
2014/02/11 23:15:20
it's fine in it's current form, but I wonder if we
blois
2014/02/12 02:39:27
Yeah- I was considering removing the phases comple
Siggi Cherem (dart-lang)
2014/02/12 03:05:28
sounds good
| |
| 49 packagePhases: {'polymer': phases}); | |
| 48 } else { | 50 } else { |
| 49 options = _createTestOptions( | 51 options = _createTestOptions( |
| 50 test, outDir, args['js'], args['csp'], !args['debug']); | 52 test, outDir, args['js'], args['csp'], !args['debug']); |
| 51 } | 53 } |
| 52 if (options == null) exit(1); | 54 if (options == null) exit(1); |
| 53 | 55 |
| 54 print('polymer/deploy.dart: creating a deploy target for ' | 56 print('polymer/deploy.dart: creating a deploy target for ' |
| 55 '"${options.currentPackage}"'); | 57 '"${options.currentPackage}"'); |
| 56 | 58 |
| 57 runBarback(options) | 59 runBarback(options) |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 77 var packageName = readCurrentPackageFromPubspec(pubspecDir); | 79 var packageName = readCurrentPackageFromPubspec(pubspecDir); |
| 78 | 80 |
| 79 var phases = createDeployPhases(new TransformOptions( | 81 var phases = createDeployPhases(new TransformOptions( |
| 80 entryPoints: [path.relative(testFile, from: pubspecDir)], | 82 entryPoints: [path.relative(testFile, from: pubspecDir)], |
| 81 directlyIncludeJS: directlyIncludeJS, | 83 directlyIncludeJS: directlyIncludeJS, |
| 82 contentSecurityPolicy: contentSecurityPolicy, | 84 contentSecurityPolicy: contentSecurityPolicy, |
| 83 releaseMode: releaseMode)); | 85 releaseMode: releaseMode)); |
| 84 return new BarbackOptions(phases, outDir, | 86 return new BarbackOptions(phases, outDir, |
| 85 currentPackage: packageName, | 87 currentPackage: packageName, |
| 86 packageDirs: {packageName : pubspecDir}, | 88 packageDirs: {packageName : pubspecDir}, |
| 89 packagePhases: {'polymer': phases}, | |
| 87 transformTests: true); | 90 transformTests: true); |
| 88 } | 91 } |
| 89 | 92 |
| 90 String _findDirWithFile(String dir, String filename) { | 93 String _findDirWithFile(String dir, String filename) { |
| 91 while (!new File(path.join(dir, filename)).existsSync()) { | 94 while (!new File(path.join(dir, filename)).existsSync()) { |
| 92 var parentDir = path.dirname(dir); | 95 var parentDir = path.dirname(dir); |
| 93 // If we reached root and failed to find it, bail. | 96 // If we reached root and failed to find it, bail. |
| 94 if (parentDir == dir) return null; | 97 if (parentDir == dir) return null; |
| 95 dir = parentDir; | 98 dir = parentDir; |
| 96 } | 99 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 _showUsage(parser); | 139 _showUsage(parser); |
| 137 return null; | 140 return null; |
| 138 } | 141 } |
| 139 } | 142 } |
| 140 | 143 |
| 141 _showUsage(parser) { | 144 _showUsage(parser) { |
| 142 print('Usage: dart --package-root=packages/ ' | 145 print('Usage: dart --package-root=packages/ ' |
| 143 'package:polymer/deploy.dart [options]'); | 146 'package:polymer/deploy.dart [options]'); |
| 144 print(parser.getUsage()); | 147 print(parser.getUsage()); |
| 145 } | 148 } |
| OLD | NEW |