@@ -27,11 +27,78 @@ interface IPlatformService {
27
27
removePlatforms ( platforms : string [ ] ) : void ;
28
28
29
29
updatePlatforms ( platforms : string [ ] ) : IFuture < void > ;
30
- preparePlatform ( platform : string , force ?: boolean , skipModulesAndResources ?: boolean ) : IFuture < boolean > ;
31
- buildPlatform ( platform : string , buildConfig ?: IBuildConfig , forceBuild ?: boolean ) : IFuture < void > ;
32
- deployPlatform ( platform : string ) : IFuture < void > ;
30
+
31
+ /**
32
+ * Ensures that the specified platform and its dependencies are installed.
33
+ * When there are changes to be prepared, it prepares the native project for the specified platform.
34
+ * When finishes, prepare saves the .nsprepareinfo file in platform folder.
35
+ * This file contains information about current project configuration and allows skipping unnecessary build, deploy and livesync steps.
36
+ * @param {string } platform The platform to be prepared.
37
+ * @returns {boolean } true indicates that the platform was prepared.
38
+ */
39
+ preparePlatform ( platform : string , changesInfo ?: IProjectChangesInfo ) : IFuture < boolean > ;
40
+
41
+ /**
42
+ * Determines whether a build is necessary. A build is necessary when one of the following is true:
43
+ * - there is no previous build.
44
+ * - the .nsbuildinfo file in product folder points to an old prepare.
45
+ * @param {string } platform The platform to build.
46
+ * @param {IBuildConfig } buildConfig Indicates whether the build is for device or emulator.
47
+ * @returns {boolean } true indicates that the platform should be build.
48
+ */
49
+ shouldBuild ( platform : string , buildConfig ?: IBuildConfig ) : IFuture < boolean > ;
50
+
51
+ /**
52
+ * Builds the native project for the specified platform for device or emulator.
53
+ * When finishes, build saves the .nsbuildinfo file in platform product folder.
54
+ * This file points to the prepare that was used to build the project and allows skipping unnecessary builds and deploys.
55
+ * @param {string } platform The platform to build.
56
+ * @param {IBuildConfig } buildConfig Indicates whether the build is for device or emulator.
57
+ * @returns {void }
58
+ */
59
+ buildPlatform ( platform : string , buildConfig ?: IBuildConfig ) : IFuture < void > ;
60
+
61
+ /**
62
+ * Determines whether installation is necessary. It is necessary when one of the following is true:
63
+ * - the application is not installed.
64
+ * - the .nsbuildinfo file located in application root folder is different than the local .nsbuildinfo file
65
+ * @param {Mobile.IDevice } device The device where the application should be installed.
66
+ * @returns {boolean } true indicates that the application should be installed.
67
+ */
68
+ shouldInstall ( device : Mobile . IDevice ) : boolean ;
69
+
70
+ /**
71
+ * Installs the application on specified device.
72
+ * When finishes, saves .nsbuildinfo in application root folder to indicate the prepare that was used to build the app.
73
+ * * .nsbuildinfo is not persisted when building for release.
74
+ * @param {Mobile.IDevice } device The device where the application should be installed.
75
+ * @returns {void }
76
+ */
77
+ installApplication ( device : Mobile . IDevice ) : IFuture < void > ;
78
+
79
+ /**
80
+ * Executes prepare, build and installOnPlatform when necessary to ensure that the latest version of the app is installed on specified platform.
81
+ * - When --clean option is specified it builds the app on every change. If not, build is executed only when there are native changes.
82
+ * @param {string } platform The platform to deploy.
83
+ * @param {boolean } forceInstall When true, installs the application unconditionally.
84
+ * @returns {void }
85
+ */
86
+ deployPlatform ( platform : string , forceInstall ?: boolean ) : IFuture < void > ;
87
+
88
+ /**
89
+ * Runs the application on specified platform. Assumes that the application is already build and installed. Fails if this is not true.
90
+ * @param {string } platform The platform where to start the application.
91
+ * @returns {void }
92
+ */
33
93
runPlatform ( platform : string ) : IFuture < void > ;
94
+
95
+ /**
96
+ * The emulate command. In addition to `run --emulator` command, it handles the `--available-devices` option to show the available devices.
97
+ * @param {string } platform The platform to emulate.
98
+ * @returns {void }
99
+ */
34
100
emulatePlatform ( platform : string ) : IFuture < void > ;
101
+
35
102
cleanDestinationApp ( platform : string ) : IFuture < void > ;
36
103
validatePlatformInstalled ( platform : string ) : void ;
37
104
validatePlatform ( platform : string ) : void ;
@@ -60,7 +127,14 @@ interface IPlatformService {
60
127
copyLastOutput ( platform : string , targetPath : string , settings : { isForDevice : boolean } ) : void ;
61
128
62
129
lastOutputPath ( platform : string , settings : { isForDevice : boolean } ) : string ;
63
- ensurePlatformInstalled ( platform : string ) : IFuture < void > ;
130
+
131
+ /**
132
+ * Reads contents of a file on device.
133
+ * @param {Mobile.IDevice } device The device to read from.
134
+ * @param {string } deviceFilePath The file path.
135
+ * @returns {string } The contents of the file or null when there is no such file.
136
+ */
137
+ readFile ( device : Mobile . IDevice , deviceFilePath : string ) : IFuture < string > ;
64
138
}
65
139
66
140
interface IPlatformData {
@@ -97,4 +171,9 @@ interface INodeModulesBuilder {
97
171
98
172
interface INodeModulesDependenciesBuilder {
99
173
getProductionDependencies ( projectPath : string ) : void ;
174
+ }
175
+
176
+ interface IBuildInfo {
177
+ prepareTime : string ;
178
+ buildTime : string ;
100
179
}
0 commit comments