-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathplatform.d.ts
147 lines (132 loc) · 4.05 KB
/
platform.d.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import {
IBuildConfig,
IProjectData,
IBuildForDevice,
INativePrepare,
} from "./project";
import { IHasAndroidBundle, IDependencyData, IOptions } from "../declarations";
import { IControllerDataBase } from "./data";
import { IRelease } from "../common/declarations";
import { INotConfiguredEnvOptions } from "../common/definitions/commands";
/**
* Describes information about how to build the native project.
*/
interface IBuildPlatformAction {
/**
* Builds the native project for the specified platform for device or emulator.
* When finishes, build saves the .nsbuildinfo file in platform product folder.
* This file points to the prepare that was used to build the project and allows skipping unnecessary builds and deploys.
* @param {string} platform The platform to build.
* @param {IBuildConfig} buildConfig Indicates whether the build is for device or emulator.
* @param {IProjectData} projectData DTO with information about the project.
* @returns {Promise<string>} The path to the built file.
*/
buildPlatform(
platform: string,
buildConfig: IBuildConfig,
projectData: IProjectData
): Promise<string>;
}
interface IPlatformData {
frameworkPackageName: string;
platformProjectService: IPlatformProjectService;
projectRoot: string;
normalizedPlatformName: string;
platformNameLowerCase: string;
appDestinationDirectoryPath: string;
getBuildOutputPath(options: IBuildOutputOptions): string;
getValidBuildOutputData(
buildOptions: IBuildOutputOptions
): IValidBuildOutputData;
frameworkDirectoriesExtensions?: string[];
frameworkDirectoriesNames?: string[];
targetedOS?: string[];
configurationFileName?: string;
configurationFilePath?: string;
relativeToFrameworkConfigurationFilePath: string;
fastLivesyncFileExtensions: string[];
getFrameworkVersion?(projectData: IProjectData): string;
}
interface IValidBuildOutputData {
packageNames: string[];
regexes?: RegExp[];
}
interface IBuildOutputOptions
extends Partial<IBuildForDevice>,
IRelease,
Partial<IHasAndroidBundle> {
outputPath?: string;
}
interface IPlatformsDataService {
getPlatformData(platform: string, projectData: IProjectData): IPlatformData;
}
interface INodeModulesBuilder {
prepareNodeModules(
prepareNodeModulesData: IPrepareNodeModulesData
): Promise<void>;
}
interface IPrepareNodeModulesData {
platformData: IPlatformData;
projectData: IProjectData;
}
interface INodeModulesDependenciesBuilder {
getProductionDependencies(
projectPath: string,
ignore?: string[]
): IDependencyData[];
}
interface IBuildInfo {
prepareTime: string;
buildTime: string;
/**
* Currently it is used only for iOS.
* As `xcrun` command does not throw an error when IPHONEOS_DEPLOYMENT_TARGET is provided in `xcconfig` file and
* the simulator's version does not match IPHONEOS_DEPLOYMENT_TARGET's value, we need to save it to buildInfo file
* in order check it on livesync and throw an error to the user.
*/
deploymentTarget?: string;
}
interface IPlatformEnvironmentRequirements {
checkEnvironmentRequirements(
input: ICheckEnvironmentRequirementsInput
): Promise<ICheckEnvironmentRequirementsOutput>;
}
interface ICheckEnvironmentRequirementsInput {
platform?: string;
projectDir?: string;
runtimeVersion?: string;
options?: IOptions;
notConfiguredEnvOptions?: INotConfiguredEnvOptions;
forceCheck?: boolean;
}
interface ICheckEnvironmentRequirementsOutput {
canExecute: boolean;
selectedOption: string;
}
interface IAddPlatformData extends IControllerDataBase {
frameworkPath?: string;
hostProjectPath?: string;
}
interface IPlatformController {
addPlatform(
addPlatformData: IAddPlatformData,
projectData?: IProjectData
): Promise<void>;
addPlatformIfNeeded(
addPlatformData: IAddPlatformData,
projectData?: IProjectData
): Promise<void>;
}
interface IAddPlatformService {
addPlatformSafe(
projectData: IProjectData,
platformData: IPlatformData,
packageToInstall: string,
addPlatformData: IAddPlatformData
): Promise<string>;
setPlatformVersion(
platformData: IPlatformData,
projectData: IProjectData,
frameworkVersion: string
): Promise<void>;
}