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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/global/run/mode_test.dart

Issue 550643003: Add a --mode flag to pub run and pub global run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 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 import '../../descriptor.dart' as d;
2 import '../../test_pub.dart';
3 const TRANSFORMER = """
4 import 'dart:async';
5
6 import 'package:barback/barback.dart';
7
8 class DartTransformer extends Transformer {
9 final BarbackSettings _settings;
10
11 DartTransformer.asPlugin(this._settings);
12
13 String get allowedExtensions => '.in';
14
15 void apply(Transform transform) {
16 transform.addOutput(new Asset.fromString(
17 new AssetId(transform.primaryInput.id.package, "bin/script.dart"),
18 "void main() => print('\${_settings.mode.name}');"));
19 }
20 }
21 """;
22 main() {
23 initConfig();
24 integration(
25 'runs a script in an activated package with customizable modes',
26 () {
27 servePackages((builder) {
28 builder.serveRepoPackage("barback");
29 builder.serve("foo", "1.0.0", deps: {
30 "barback": "any"
31 }, pubspec: {
32 "transformers": ["foo/src/transformer"]
33 },
34 contents: [
35 d.dir(
36 "lib",
37 [
38 d.dir(
39 "src",
40 [d.file("transformer.dart", TRANSFORMER), d.file("prim ary.in", "")])])]);
41 });
42 schedulePub(args: ["global", "activate", "foo"]);
43 var pub = pubRun(global: true, args: ["foo:script"]);
44 pub.stdout.expect("release");
45 pub.shouldExit();
46 pub = pubRun(global: true, args: ["--mode", "custom-mode", "foo:script"]);
47 pub.stdout.expect("custom-mode");
48 pub.shouldExit();
49 });
50 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub_generated/lib/src/global_packages.dart ('k') | sdk/lib/_internal/pub_generated/test/run/mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698