|
1 | 1 | import * as path from "path"; |
2 | 2 | import * as util from "util"; |
3 | 3 | import { AppBuilderDeviceAppDataBase } from "../mobile/appbuilder-device-app-data-base"; |
4 | | -import { AppBuilderCompanionDeviceAppDataBase } from "../mobile/appbuilder-companion-device-app-data-base"; |
5 | | -import { LiveSyncConstants, TARGET_FRAMEWORK_IDENTIFIERS } from "../../constants"; |
| 4 | +import { LiveSyncConstants } from "../../constants"; |
6 | 5 | import { cache } from "../../decorators"; |
7 | 6 |
|
8 | 7 | export class AndroidAppIdentifier extends AppBuilderDeviceAppDataBase implements ILiveSyncDeviceAppData { |
@@ -45,50 +44,6 @@ export class AndroidAppIdentifier extends AppBuilderDeviceAppDataBase implements |
45 | 44 | } |
46 | 45 | } |
47 | 46 |
|
48 | | -export class AndroidCompanionAppIdentifier extends AppBuilderCompanionDeviceAppDataBase implements ILiveSyncDeviceAppData { |
49 | | - constructor(device: Mobile.IDevice, |
50 | | - platform: string, |
51 | | - $deployHelper: IDeployHelper, |
52 | | - $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
53 | | - $companionAppsService: ICompanionAppsService) { |
54 | | - super($companionAppsService.getCompanionAppIdentifier(TARGET_FRAMEWORK_IDENTIFIERS.Cordova, platform), device, platform, $deployHelper); |
55 | | - } |
56 | | - |
57 | | - public async getDeviceProjectRootPath(): Promise<string> { |
58 | | - return this._getDeviceProjectRootPath(util.format(LiveSyncConstants.DEVICE_TMP_DIR_FORMAT_V3, this.appIdentifier)); |
59 | | - } |
60 | | - |
61 | | - public get liveSyncFormat(): string { |
62 | | - return "icenium://%s?token=%s&appId=%s&configuration=%s"; |
63 | | - } |
64 | | - |
65 | | - protected getCompanionAppName(): string { |
66 | | - return "companion app"; |
67 | | - } |
68 | | -} |
69 | | - |
70 | | -export class AndroidNativeScriptCompanionAppIdentifier extends AppBuilderCompanionDeviceAppDataBase implements ILiveSyncDeviceAppData { |
71 | | - constructor(device: Mobile.IDevice, |
72 | | - platform: string, |
73 | | - $deployHelper: IDeployHelper, |
74 | | - $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
75 | | - $companionAppsService: ICompanionAppsService) { |
76 | | - super($companionAppsService.getCompanionAppIdentifier(TARGET_FRAMEWORK_IDENTIFIERS.NativeScript, platform), device, platform, $deployHelper); |
77 | | - } |
78 | | - |
79 | | - public async getDeviceProjectRootPath(): Promise<string> { |
80 | | - return util.format(LiveSyncConstants.DEVICE_TMP_DIR_FORMAT_V3, this.appIdentifier); |
81 | | - } |
82 | | - |
83 | | - public get liveSyncFormat(): string { |
84 | | - return "nativescript://%s?token=%s&appId=%s&configuration=%s"; |
85 | | - } |
86 | | - |
87 | | - protected getCompanionAppName(): string { |
88 | | - return "NativeScript companion app"; |
89 | | - } |
90 | | -} |
91 | | - |
92 | 47 | export class IOSAppIdentifier extends AppBuilderDeviceAppDataBase implements ILiveSyncDeviceAppData { |
93 | 48 | constructor(_appIdentifier: string, |
94 | 49 | device: Mobile.IDevice, |
@@ -135,111 +90,25 @@ export class IOSNativeScriptAppIdentifier extends AppBuilderDeviceAppDataBase im |
135 | 90 | } |
136 | 91 | } |
137 | 92 |
|
138 | | -export class IOSCompanionAppIdentifier extends AppBuilderCompanionDeviceAppDataBase implements ILiveSyncDeviceAppData { |
139 | | - constructor(device: Mobile.IDevice, |
140 | | - platform: string, |
141 | | - $deployHelper: IDeployHelper, |
142 | | - $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
143 | | - $companionAppsService: ICompanionAppsService) { |
144 | | - super($companionAppsService.getCompanionAppIdentifier(TARGET_FRAMEWORK_IDENTIFIERS.Cordova, platform), device, platform, $deployHelper); |
145 | | - } |
146 | | - |
147 | | - public async getDeviceProjectRootPath(): Promise<string> { |
148 | | - return LiveSyncConstants.IOS_PROJECT_PATH; |
149 | | - } |
150 | | - |
151 | | - public get liveSyncFormat(): string { |
152 | | - return "icenium://%s?LiveSyncToken=%s&appId=%s&configuration=%s"; |
153 | | - } |
154 | | - |
155 | | - protected getCompanionAppName(): string { |
156 | | - return "companion app"; |
157 | | - } |
158 | | -} |
159 | | - |
160 | | -export class IOSNativeScriptCompanionAppIdentifier extends AppBuilderCompanionDeviceAppDataBase implements ILiveSyncDeviceAppData { |
161 | | - constructor(device: Mobile.IDevice, |
162 | | - platform: string, |
163 | | - $deployHelper: IDeployHelper, |
164 | | - $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
165 | | - $companionAppsService: ICompanionAppsService) { |
166 | | - super($companionAppsService.getCompanionAppIdentifier(TARGET_FRAMEWORK_IDENTIFIERS.NativeScript, platform), device, platform, $deployHelper); |
167 | | - } |
168 | | - |
169 | | - public async getDeviceProjectRootPath(): Promise<string> { |
170 | | - return LiveSyncConstants.IOS_PROJECT_PATH; |
171 | | - } |
172 | | - |
173 | | - public get liveSyncFormat(): string { |
174 | | - return "nativescript://%s?LiveSyncToken=%s&appId=%s&configuration=%s"; |
175 | | - } |
176 | | - |
177 | | - protected getCompanionAppName(): string { |
178 | | - return "NativeScript companion app"; |
179 | | - } |
180 | | -} |
181 | | - |
182 | | -export class WP8CompanionAppIdentifier extends AppBuilderCompanionDeviceAppDataBase implements ILiveSyncDeviceAppData { |
183 | | - constructor(device: Mobile.IDevice, |
184 | | - $deployHelper: IDeployHelper, |
185 | | - $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, |
186 | | - public platform: string, |
187 | | - $companionAppsService: ICompanionAppsService) { |
188 | | - super($companionAppsService.getCompanionAppIdentifier(TARGET_FRAMEWORK_IDENTIFIERS.Cordova, platform), device, platform, $deployHelper); |
189 | | - } |
190 | | - |
191 | | - public async getDeviceProjectRootPath(): Promise<string> { |
192 | | - return ""; // this is used only on Android for Lollipop |
193 | | - } |
194 | | - |
195 | | - public get liveSyncFormat(): string { |
196 | | - return "%s/Mist/MobilePackage/redirect?token=%s&appId=%s&configuration=%s"; |
197 | | - } |
198 | | - |
199 | | - public encodeLiveSyncHostUri(hostUri: string): string { |
200 | | - return hostUri; |
201 | | - } |
202 | | - |
203 | | - public async isLiveSyncSupported(): Promise<boolean> { |
204 | | - return true; |
205 | | - } |
206 | | - |
207 | | - public getLiveSyncNotSupportedError(): string { |
208 | | - return ""; |
209 | | - } |
210 | | - |
211 | | - protected getCompanionAppName(): string { |
212 | | - return "companion app"; |
213 | | - } |
214 | | -} |
215 | | - |
216 | 93 | export class DeviceAppDataProvider implements Mobile.IDeviceAppDataProvider { |
217 | 94 | constructor(private $project: any) { } |
218 | 95 |
|
219 | 96 | public createFactoryRules(): IDictionary<Mobile.IDeviceAppDataFactoryRule> { |
220 | 97 | const rules: IDictionary<IDictionary<Mobile.IDeviceAppDataFactoryRule>> = { |
221 | 98 | Cordova: { |
222 | 99 | Android: { |
223 | | - vanilla: AndroidAppIdentifier, |
224 | | - companion: AndroidCompanionAppIdentifier |
| 100 | + vanilla: AndroidAppIdentifier |
225 | 101 | }, |
226 | 102 | iOS: { |
227 | | - vanilla: IOSAppIdentifier, |
228 | | - companion: IOSCompanionAppIdentifier |
229 | | - }, |
230 | | - WP8: { |
231 | | - vanilla: "", |
232 | | - companion: WP8CompanionAppIdentifier |
| 103 | + vanilla: IOSAppIdentifier |
233 | 104 | } |
234 | 105 | }, |
235 | 106 | NativeScript: { |
236 | 107 | Android: { |
237 | | - vanilla: AndroidAppIdentifier, |
238 | | - companion: AndroidNativeScriptCompanionAppIdentifier |
| 108 | + vanilla: AndroidAppIdentifier |
239 | 109 | }, |
240 | 110 | iOS: { |
241 | | - vanilla: IOSNativeScriptAppIdentifier, |
242 | | - companion: IOSNativeScriptCompanionAppIdentifier |
| 111 | + vanilla: IOSNativeScriptAppIdentifier |
243 | 112 | } |
244 | 113 | } |
245 | 114 | }; |
|
0 commit comments