-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathplatform-project-service-base.ts
32 lines (26 loc) · 1.31 KB
/
platform-project-service-base.ts
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
import * as constants from "../constants";
export class PlatformProjectServiceBase implements IPlatformProjectServiceBase {
constructor(protected $fs: IFileSystem,
protected $projectData: IProjectData,
protected $projectDataService: IProjectDataService) {
}
public getPluginPlatformsFolderPath(pluginData: IPluginData, platform: string): string {
return pluginData.pluginPlatformsFolderPath(platform);
}
protected getAllNativeLibrariesForPlugin(pluginData: IPluginData, platform: string, filter: (fileName: string, _pluginPlatformsFolderPath: string) => boolean): string[] {
let pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, platform),
nativeLibraries: string[] = [];
if (pluginPlatformsFolderPath && this.$fs.exists(pluginPlatformsFolderPath)) {
let platformsContents = this.$fs.readDirectory(pluginPlatformsFolderPath);
nativeLibraries = _(platformsContents)
.filter(platformItemName => filter(platformItemName, pluginPlatformsFolderPath))
.value();
}
return nativeLibraries;
}
protected getFrameworkVersion(runtimePackageName: string): string {
this.$projectDataService.initialize(this.$projectData.projectDir);
let frameworkVersion = this.$projectDataService.getValue(runtimePackageName, constants.DEV_DEPENDENCIES).version;
return frameworkVersion;
}
}