forked from SAP/ui5-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskRepository.js
42 lines (37 loc) · 1.25 KB
/
taskRepository.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const tasks = {
replaceCopyright: require("./replaceCopyright"),
replaceVersion: require("./replaceVersion"),
createDebugFiles: require("./createDebugFiles"),
uglify: require("./uglify"),
buildThemes: require("./buildThemes"),
transformBootstrapHtml: require("./transformBootstrapHtml"),
generateLibraryManifest: require("./generateLibraryManifest"),
generateVersionInfo: require("./generateVersionInfo"),
generateManifestBundle: require("./bundlers/generateManifestBundle"),
generateFlexChangesBundle: require("./bundlers/generateFlexChangesBundle"),
generateComponentPreload: require("./bundlers/generateComponentPreload"),
generateStandaloneAppBundle: require("./bundlers/generateStandaloneAppBundle"),
generateBundle: require("./bundlers/generateBundle"),
generateLibraryPreload: require("./bundlers/generateLibraryPreload")
};
function getTask(taskName) {
const task = tasks[taskName];
if (!task) {
throw new Error(`taskRepository: Unknown Task ${taskName}`);
}
return task;
}
function addTask(name, task) {
if (tasks[name]) {
throw new Error(`taskRepository: Task ${name} already registered`);
}
tasks[name] = task;
}
function getAllTasks() {
return tasks;
}
module.exports = {
getTask: getTask,
addTask: addTask,
getAllTasks: getAllTasks
};