UNPKG

1.75 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) {
21 return function (target, key) {
22 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
23 classConstructor: target.constructor,
24 method: key,
25 name: name || key
26 });
27 };
28}
29exports.Task = Task;
30/**
31 * Tasks will be run in sequence when using this annotation.
32 */
33function SequenceTask(name) {
34 return function (target, key) {
35 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
36 classConstructor: target.constructor,
37 method: key,
38 name: name || key,
39 isSequence: true
40 });
41 };
42}
43exports.SequenceTask = SequenceTask;
44/**
45 * Tasks will be run merged when using this annotation.
46 */
47function MergedTask(name) {
48 return function (target, key) {
49 MetadataStorage_1.defaultMetadataStorage.addTaskMetadata({
50 classConstructor: target.constructor,
51 method: key,
52 name: name || key,
53 isMerge: true
54 });
55 };
56}
57exports.MergedTask = MergedTask;
58//# sourceMappingURL=Decorators.js.map
\No newline at end of file