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

Side by Side Diff: third_party/pkg/di/lib/transformer/options.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 library di.transformer.options;
2
3 import 'dart:async';
4
5 import 'package:barback/barback.dart';
6 import 'package:code_transformers/resolver.dart';
7
8 const List<String> DEFAULT_INJECTABLE_ANNOTATIONS =
9 const ['di.annotations.Injectable'];
10
11 /// Returns either a bool or a Future<bool> when complete.
12 typedef EntryFilter(Asset asset);
13
14 /** Options used by DI transformers */
15 class TransformOptions {
16
17 /**
18 * Filter to determine which assets should be modified.
19 */
20 final EntryFilter entryFilter;
21
22 /**
23 * List of additional annotations which are used to indicate types as being
24 * injectable.
25 */
26 final List<String> injectableAnnotations;
27
28 /**
29 * Set of additional types which should be injected.
30 */
31 final Set<String> injectedTypes;
32
33 /**
34 * Path to the Dart SDK directory, for resolving Dart libraries.
35 */
36 final String sdkDirectory;
37
38 TransformOptions({EntryFilter entryFilter, String sdkDirectory,
39 List<String> injectableAnnotations, List<String> injectedTypes})
40 : entryFilter = entryFilter != null ? entryFilter : isPossibleDartEntry,
41 sdkDirectory = sdkDirectory,
42 injectableAnnotations =
43 (injectableAnnotations != null ? injectableAnnotations : [])
44 ..addAll(DEFAULT_INJECTABLE_ANNOTATIONS),
45 injectedTypes =
46 new Set.from(injectedTypes != null ? injectedTypes : []) {
47 if (sdkDirectory == null)
48 throw new ArgumentError('sdkDirectory must be provided.');
49 }
50
51 Future<bool> isDartEntry(Asset asset) => new Future.value(entryFilter(asset));
52 }
OLDNEW
« no previous file with comments | « third_party/pkg/di/lib/transformer/injector_generator.dart ('k') | third_party/pkg/di/lib/transformer/refactor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698