UNPKG

1.87 kBJavaScriptView Raw
1var MetadataStorage_1 = require("./MetadataStorage");
2/**
3 * Registers a class from which tasks will be loaded.
4 * You can optionally specify your gulp instance if you want to register tasks specifically there.
5 */
6function Gulpclass(gulpInstance) {
7 return function (target) {
8 if (!gulpInstance)
9 gulpInstance = require("gulp");
10 MetadataStorage_1.defaultMetadataStorage.addGulpclassMetadata({
11 gulpInstance: gulpInstance,
12 classConstructor: target
13 });
14 };
15}
16exports.Gulpclass = Gulpclass;
17/**
18 * Registers a task with the given name. If name is not specified then object's method name will be used.
19 */
20function Task(name, dependencies) {
21 return function (target, key) {
22 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
23 classConstructor: target.constructor,
24 method: key,
25 name: name || key,
26 dependencies: dependencies || []
27 });
28 };
29}
30exports.Task = Task;
31/**
32 * Tasks will be run in sequence when using this annotation.
33 */
34function SequenceTask(name) {
35 return function (target, key) {
36 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
37 classConstructor: target.constructor,
38 method: key,
39 name: name || key,
40 dependencies: [],
41 isSequence: true
42 });
43 };
44}
45exports.SequenceTask = SequenceTask;
46/**
47 * Tasks will be run merged when using this annotation.
48 */
49function MergedTask(name) {
50 return function (target, key) {
51 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
52 classConstructor: target.constructor,
53 method: key,
54 name: name || key,
55 dependencies: [],
56 isMerge: true
57 });
58 };
59}
60exports.MergedTask = MergedTask;
61//# sourceMappingURL=Decorators.js.map
\No newline at end of file