-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectManager.ts
More file actions
108 lines (96 loc) · 2.89 KB
/
projectManager.ts
File metadata and controls
108 lines (96 loc) · 2.89 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import type { IPlatform } from "./platform";
import * as TestConfig from "./testConfig";
export class ProjectManager {
public static readonly DEFAULT_APP_VERSION = "Store version";
private static readonly NOT_IMPLEMENTED_ERROR_MSG =
"This method is unimplemented. Extend ProjectManager and override it in your plugin repo.";
public getPluginName(): string {
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public setupProject(
projectDirectory: string,
templatePath: string,
appName: string,
appNamespace: string,
version = ProjectManager.DEFAULT_APP_VERSION,
): Promise<void> {
void projectDirectory;
void templatePath;
void appName;
void appNamespace;
void version;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public setupScenario(
projectDirectory: string,
appId: string,
templatePath: string,
jsPath: string,
targetPlatform: IPlatform,
version = ProjectManager.DEFAULT_APP_VERSION,
): Promise<void> {
void projectDirectory;
void appId;
void templatePath;
void jsPath;
void targetPlatform;
void version;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public createUpdateArchive(
projectDirectory: string,
targetPlatform: IPlatform,
isDiff = false,
): Promise<string> {
void projectDirectory;
void targetPlatform;
void isDiff;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public preparePlatform(projectDirectory: string, targetPlatform: IPlatform): Promise<void> {
void projectDirectory;
void targetPlatform;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public cleanupAfterPlatform(projectDirectory: string, targetPlatform: IPlatform): Promise<void> {
void projectDirectory;
void targetPlatform;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
public runApplication(projectDirectory: string, targetPlatform: IPlatform): Promise<void> {
void projectDirectory;
void targetPlatform;
throw new Error(ProjectManager.NOT_IMPLEMENTED_ERROR_MSG);
}
}
export function setupTestRunScenario(
projectManager: ProjectManager,
targetPlatform: IPlatform,
scenarioJsPath: string,
version?: string,
): Promise<void> {
return projectManager.setupScenario(
TestConfig.testRunDirectory,
TestConfig.TestNamespace,
TestConfig.templatePath,
scenarioJsPath,
targetPlatform,
version,
);
}
export async function setupUpdateScenario(
projectManager: ProjectManager,
targetPlatform: IPlatform,
scenarioJsPath: string,
version: string,
): Promise<string> {
await projectManager.setupScenario(
TestConfig.updatesDirectory,
TestConfig.TestNamespace,
TestConfig.templatePath,
scenarioJsPath,
targetPlatform,
version,
);
return projectManager.createUpdateArchive(TestConfig.updatesDirectory, targetPlatform);
}