nativescript 8.1.5 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +2 -2
- package/lib/base-package-manager.js +3 -2
- package/lib/commands/appstore-list.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/clean.js +7 -3
- package/lib/commands/create-project.js +2 -2
- package/lib/commands/debug.js +3 -3
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/fonts.js +1 -1
- package/lib/commands/generate.js +1 -1
- package/lib/commands/plugin/build-plugin.js +2 -0
- package/lib/commands/plugin/create-plugin.js +4 -4
- package/lib/commands/plugin/list-plugins.js +2 -2
- package/lib/commands/post-install.js +1 -1
- package/lib/commands/run.js +3 -3
- package/lib/commands/test-init.js +1 -1
- package/lib/commands/test.js +2 -1
- package/lib/commands/typings.js +35 -27
- package/lib/common/commands/device/list-devices.js +18 -7
- package/lib/common/commands/preuninstall.js +2 -2
- package/lib/common/commands/proxy/proxy-set.js +6 -6
- package/lib/common/dispatchers.js +1 -1
- package/lib/common/errors.js +2 -2
- package/lib/common/file-system.js +17 -17
- package/lib/common/helpers.js +6 -5
- package/lib/common/host-info.js +1 -1
- package/lib/common/http-client.js +1 -1
- package/lib/common/logger/layouts/cli-layout.js +1 -1
- package/lib/common/logger/logger.js +1 -1
- package/lib/common/mobile/android/android-application-manager.js +6 -6
- package/lib/common/mobile/android/android-debug-bridge.js +4 -4
- package/lib/common/mobile/android/android-device-file-system.js +3 -3
- package/lib/common/mobile/android/android-device-hash-service.js +4 -4
- package/lib/common/mobile/android/android-device.js +1 -1
- package/lib/common/mobile/android/android-emulator-services.js +6 -6
- package/lib/common/mobile/android/android-virtual-device-service.js +7 -7
- package/lib/common/mobile/android/genymotion/genymotion-service.js +3 -3
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +2 -2
- package/lib/common/mobile/device-log-provider-base.js +1 -1
- package/lib/common/mobile/ios/device/ios-application-manager.js +2 -2
- package/lib/common/mobile/ios/device/ios-device-operations.js +2 -2
- package/lib/common/mobile/ios/device/ios-device.js +1 -1
- package/lib/common/mobile/ios/ios-device-base.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +3 -3
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +1 -1
- package/lib/common/mobile/mobile-core/android-process-service.js +1 -1
- package/lib/common/mobile/mobile-core/devices-service.js +22 -20
- package/lib/common/services/auto-completion-service.js +3 -3
- package/lib/common/services/hooks-service.js +2 -2
- package/lib/common/services/json-file-settings-service.js +1 -1
- package/lib/common/services/lock-service.js +2 -2
- package/lib/common/services/messages-service.js +1 -1
- package/lib/common/services/net-service.js +1 -1
- package/lib/common/services/qr.js +2 -2
- package/lib/common/services/settings-service.js +1 -1
- package/lib/common/services/xcode-select-service.js +1 -1
- package/lib/common/yok.js +2 -2
- package/lib/constants.js +8 -6
- package/lib/controllers/build-controller.js +6 -1
- package/lib/controllers/company-insights-controller.js +1 -1
- package/lib/controllers/debug-controller.js +3 -3
- package/lib/controllers/migrate-controller.js +16 -16
- package/lib/controllers/platform-controller.js +32 -6
- package/lib/controllers/prepare-controller.js +6 -6
- package/lib/controllers/preview-app-controller.js +3 -3
- package/lib/controllers/run-controller.js +4 -3
- package/lib/data/build-data.js +2 -0
- package/lib/declarations.d.ts +6 -0
- package/lib/definitions/android-plugin-migrator.d.ts +12 -0
- package/lib/definitions/build.d.ts +4 -1
- package/lib/definitions/gradle.d.ts +1 -0
- package/lib/definitions/platform.d.ts +12 -3
- package/lib/detached-processes/cleanup-js-subprocess.js +1 -1
- package/lib/detached-processes/file-log-service.js +1 -1
- package/lib/device-path-provider.js +1 -1
- package/lib/nativescript-cli.js +2 -2
- package/lib/node-package-manager.js +15 -10
- package/lib/options.js +4 -1
- package/lib/package-manager.js +17 -17
- package/lib/pnpm-package-manager.js +12 -8
- package/lib/project-data.js +3 -3
- package/lib/services/analytics/analytics-broker.js +1 -1
- package/lib/services/analytics/analytics-service.js +5 -5
- package/lib/services/analytics/google-analytics-provider.js +2 -2
- package/lib/services/analytics-settings-service.js +4 -4
- package/lib/services/android/android-bundle-tool-service.js +2 -2
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +3 -1
- package/lib/services/android/gradle-command-service.js +2 -3
- package/lib/services/android-device-debug-service.js +3 -3
- package/lib/services/android-plugin-build-service.js +33 -13
- package/lib/services/android-project-service.js +35 -10
- package/lib/services/apple-portal/apple-portal-session-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +2 -2
- package/lib/services/cleanup-service.js +2 -2
- package/lib/services/cocoapods-service.js +2 -1
- package/lib/services/doctor-service.js +3 -3
- package/lib/services/extensibility-service.js +4 -4
- package/lib/services/files-hash-service.js +1 -1
- package/lib/services/hmr-status-service.js +1 -1
- package/lib/services/ios-debugger-port-service.js +2 -2
- package/lib/services/ios-device-debug-service.js +4 -4
- package/lib/services/ios-project-service.js +6 -6
- package/lib/services/ios-provision-service.js +3 -3
- package/lib/services/ip-service.js +1 -1
- package/lib/services/itmstransporter-service.js +3 -3
- package/lib/services/karma-execution.js +1 -1
- package/lib/services/livesync/android-device-livesync-service.js +2 -2
- package/lib/services/livesync/android-livesync-service.js +2 -2
- package/lib/services/livesync/device-livesync-service-base.js +2 -2
- package/lib/services/livesync/ios-device-livesync-service.js +1 -1
- package/lib/services/livesync/ios-livesync-service.js +1 -1
- package/lib/services/livesync/platform-livesync-service-base.js +2 -2
- package/lib/services/livesync/playground/preview-app-files-service.js +1 -1
- package/lib/services/livesync/playground/preview-qr-code-service.js +1 -1
- package/lib/services/log-parser-service.js +1 -1
- package/lib/services/log-source-map-service.js +1 -1
- package/lib/services/pacote-service.js +1 -1
- package/lib/services/performance-service.js +1 -1
- package/lib/services/platform/add-platform-service.js +1 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -2
- package/lib/services/platform-environment-requirements.js +1 -1
- package/lib/services/plugins-service.js +2 -2
- package/lib/services/project-changes-service.js +2 -2
- package/lib/services/project-cleanup-service.js +3 -1
- package/lib/services/project-config-service.js +6 -6
- package/lib/services/project-data-service.js +9 -9
- package/lib/services/project-name-service.js +1 -1
- package/lib/services/project-service.js +7 -7
- package/lib/services/project-templates-service.js +1 -1
- package/lib/services/test-execution-service.js +1 -1
- package/lib/services/test-initialization-service.js +2 -2
- package/lib/services/webpack/webpack-compiler-service.js +6 -5
- package/lib/services/webpack/webpack.d.ts +1 -1
- package/lib/sys-info.js +5 -5
- package/lib/tools/node-modules/node-modules-builder.js +2 -2
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +13 -6
- package/lib/yarn-package-manager.js +13 -8
- package/package.json +6 -6
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +127 -34
- package/vendor/gradle-plugin/gradle.properties +2 -0
|
@@ -82,7 +82,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
82
82
|
? !d.isEmulator
|
|
83
83
|
: true);
|
|
84
84
|
if (selectedDevices.length > 1) {
|
|
85
|
-
if (helpers_2.isInteractive()) {
|
|
85
|
+
if ((0, helpers_2.isInteractive)()) {
|
|
86
86
|
const choices = selectedDevices.map((e) => `${e.deviceInfo.identifier} - ${e.deviceInfo.displayName}`);
|
|
87
87
|
const selectedDeviceString = yield this.$prompter.promptForChoice("Select device for debugging", choices);
|
|
88
88
|
const selectedDevice = _.find(selectedDevices, (d) => `${d.deviceInfo.identifier} - ${d.deviceInfo.displayName}` ===
|
|
@@ -300,7 +300,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
300
300
|
yield this.detectCurrentlyAttachedDevices(deviceInitOpts);
|
|
301
301
|
try {
|
|
302
302
|
const trustedDevices = _.filter(this._devices, (device) => device.deviceInfo.status === constants.CONNECTED_STATUS);
|
|
303
|
-
yield helpers_1.settlePromises(_.map(trustedDevices, (device) => device.applicationManager.checkForApplicationUpdates()));
|
|
303
|
+
yield (0, helpers_1.settlePromises)(_.map(trustedDevices, (device) => device.applicationManager.checkForApplicationUpdates()));
|
|
304
304
|
}
|
|
305
305
|
catch (err) {
|
|
306
306
|
this.$logger.trace("Error checking for application updates on devices.", err);
|
|
@@ -562,7 +562,9 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
562
562
|
if (this._isInitialized) {
|
|
563
563
|
return;
|
|
564
564
|
}
|
|
565
|
-
this.$
|
|
565
|
+
if (!this.$options.json) {
|
|
566
|
+
this.$logger.info("Searching for devices...");
|
|
567
|
+
}
|
|
566
568
|
deviceInitOpts = deviceInitOpts || {};
|
|
567
569
|
this._data = deviceInitOpts;
|
|
568
570
|
if (!deviceInitOpts.skipEmulatorStart) {
|
|
@@ -787,55 +789,55 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
787
789
|
DevicesService.DEVICE_LOOKING_INTERVAL = 200;
|
|
788
790
|
DevicesService.EMULATOR_IMAGES_DETECTION_INTERVAL = 60 * 1000;
|
|
789
791
|
__decorate([
|
|
790
|
-
decorators_2.performanceLog()
|
|
792
|
+
(0, decorators_2.performanceLog)()
|
|
791
793
|
], DevicesService.prototype, "pickSingleDevice", null);
|
|
792
794
|
__decorate([
|
|
793
|
-
decorators_1.exported("devicesService")
|
|
795
|
+
(0, decorators_1.exported)("devicesService")
|
|
794
796
|
], DevicesService.prototype, "getEmulatorImages", null);
|
|
795
797
|
__decorate([
|
|
796
|
-
decorators_1.exported("devicesService")
|
|
798
|
+
(0, decorators_1.exported)("devicesService")
|
|
797
799
|
], DevicesService.prototype, "startEmulator", null);
|
|
798
800
|
__decorate([
|
|
799
|
-
decorators_1.exported("devicesService")
|
|
801
|
+
(0, decorators_1.exported)("devicesService")
|
|
800
802
|
], DevicesService.prototype, "getDevices", null);
|
|
801
803
|
__decorate([
|
|
802
|
-
decorators_1.exported("devicesService")
|
|
804
|
+
(0, decorators_1.exported)("devicesService")
|
|
803
805
|
], DevicesService.prototype, "setLogLevel", null);
|
|
804
806
|
__decorate([
|
|
805
|
-
decorators_1.exported("devicesService")
|
|
807
|
+
(0, decorators_1.exported)("devicesService")
|
|
806
808
|
], DevicesService.prototype, "isAppInstalledOnDevices", null);
|
|
807
809
|
__decorate([
|
|
808
|
-
decorators_1.exported("devicesService")
|
|
810
|
+
(0, decorators_1.exported)("devicesService")
|
|
809
811
|
], DevicesService.prototype, "getInstalledApplications", null);
|
|
810
812
|
__decorate([
|
|
811
|
-
decorators_1.exported("devicesService")
|
|
813
|
+
(0, decorators_1.exported)("devicesService")
|
|
812
814
|
], DevicesService.prototype, "addDeviceDiscovery", null);
|
|
813
815
|
__decorate([
|
|
814
|
-
decorators_1.exported("devicesService")
|
|
816
|
+
(0, decorators_1.exported)("devicesService")
|
|
815
817
|
], DevicesService.prototype, "startDeviceDetectionInterval", null);
|
|
816
818
|
__decorate([
|
|
817
|
-
decorators_1.exported("devicesService")
|
|
819
|
+
(0, decorators_1.exported)("devicesService")
|
|
818
820
|
], DevicesService.prototype, "startEmulatorDetectionInterval", null);
|
|
819
821
|
__decorate([
|
|
820
|
-
decorators_1.exported("devicesService")
|
|
822
|
+
(0, decorators_1.exported)("devicesService")
|
|
821
823
|
], DevicesService.prototype, "stopDeviceDetectionInterval", null);
|
|
822
824
|
__decorate([
|
|
823
|
-
decorators_1.exported("devicesService")
|
|
825
|
+
(0, decorators_1.exported)("devicesService")
|
|
824
826
|
], DevicesService.prototype, "stopEmulatorDetectionInterval", null);
|
|
825
827
|
__decorate([
|
|
826
|
-
decorators_1.exported("devicesService")
|
|
828
|
+
(0, decorators_1.exported)("devicesService")
|
|
827
829
|
], DevicesService.prototype, "deployOnDevices", null);
|
|
828
830
|
__decorate([
|
|
829
|
-
decorators_1.exported("devicesService")
|
|
831
|
+
(0, decorators_1.exported)("devicesService")
|
|
830
832
|
], DevicesService.prototype, "initialize", null);
|
|
831
833
|
__decorate([
|
|
832
|
-
decorators_1.exported("devicesService")
|
|
834
|
+
(0, decorators_1.exported)("devicesService")
|
|
833
835
|
], DevicesService.prototype, "mapAbstractToTcpPort", null);
|
|
834
836
|
__decorate([
|
|
835
|
-
decorators_1.exported("devicesService")
|
|
837
|
+
(0, decorators_1.exported)("devicesService")
|
|
836
838
|
], DevicesService.prototype, "getDebuggableApps", null);
|
|
837
839
|
__decorate([
|
|
838
|
-
decorators_1.exported("devicesService")
|
|
840
|
+
(0, decorators_1.exported)("devicesService")
|
|
839
841
|
], DevicesService.prototype, "getDebuggableViews", null);
|
|
840
842
|
exports.DevicesService = DevicesService;
|
|
841
843
|
yok_1.injector.register("devicesService", DevicesService);
|
|
@@ -220,13 +220,13 @@ AutoCompletionService.COMPLETION_END_COMMENT_PATTERN = "###-%s-completion-end-##
|
|
|
220
220
|
AutoCompletionService.TABTAB_COMPLETION_START_REGEX_PATTERN = "###-begin-%s-completion-###";
|
|
221
221
|
AutoCompletionService.TABTAB_COMPLETION_END_REGEX_PATTERN = "###-end-%s-completion-###";
|
|
222
222
|
__decorate([
|
|
223
|
-
decorators_1.cache()
|
|
223
|
+
(0, decorators_1.cache)()
|
|
224
224
|
], AutoCompletionService.prototype, "shellProfiles", null);
|
|
225
225
|
__decorate([
|
|
226
|
-
decorators_1.cache()
|
|
226
|
+
(0, decorators_1.cache)()
|
|
227
227
|
], AutoCompletionService.prototype, "cliRunCommandsFile", null);
|
|
228
228
|
__decorate([
|
|
229
|
-
decorators_1.cache()
|
|
229
|
+
(0, decorators_1.cache)()
|
|
230
230
|
], AutoCompletionService.prototype, "completionShellScriptContent", null);
|
|
231
231
|
exports.AutoCompletionService = AutoCompletionService;
|
|
232
232
|
yok_1.injector.register("autoCompletionService", AutoCompletionService);
|
|
@@ -73,7 +73,7 @@ class HooksService {
|
|
|
73
73
|
const hookArgs = hookArguments && hookArguments[this.hookArgsName];
|
|
74
74
|
let projectDir = hookArgs && hookArgs.projectDir;
|
|
75
75
|
if (!projectDir && hookArgs) {
|
|
76
|
-
const candidate = helpers_1.getValueFromNestedObject(hookArgs, "projectDir");
|
|
76
|
+
const candidate = (0, helpers_1.getValueFromNestedObject)(hookArgs, "projectDir");
|
|
77
77
|
projectDir = candidate && candidate.projectDir;
|
|
78
78
|
}
|
|
79
79
|
this.$logger.trace(`Project dir from hooksArgs is: ${projectDir}.`);
|
|
@@ -283,7 +283,7 @@ class HooksService {
|
|
|
283
283
|
}
|
|
284
284
|
validateHookArguments(hookConstructor, hookFullPath) {
|
|
285
285
|
const invalidArguments = [];
|
|
286
|
-
helpers_1.annotate(hookConstructor);
|
|
286
|
+
(0, helpers_1.annotate)(hookConstructor);
|
|
287
287
|
_.each(hookConstructor.$inject.args, (argument) => {
|
|
288
288
|
try {
|
|
289
289
|
if (argument !== this.hookArgsName) {
|
|
@@ -108,7 +108,7 @@ class JsonFileSettingsService {
|
|
|
108
108
|
}
|
|
109
109
|
const data = this.$fs.readText(this.jsonSettingsFilePath);
|
|
110
110
|
try {
|
|
111
|
-
this.jsonSettingsData = helpers_1.parseJson(data);
|
|
111
|
+
this.jsonSettingsData = (0, helpers_1.parseJson)(data);
|
|
112
112
|
}
|
|
113
113
|
catch (err) {
|
|
114
114
|
this.$logger.trace(`Error while trying to parseJson ${data} data from ${this.jsonSettingsFilePath} file. Err is: ${err}`);
|
|
@@ -116,13 +116,13 @@ class LockService {
|
|
|
116
116
|
getShortFileLock(filePath) {
|
|
117
117
|
const dirPath = path.dirname(filePath);
|
|
118
118
|
const fileName = path.basename(filePath);
|
|
119
|
-
const hashedFileName = helpers_1.getHash(fileName, { algorithm: "MD5" });
|
|
119
|
+
const hashedFileName = (0, helpers_1.getHash)(fileName, { algorithm: "MD5" });
|
|
120
120
|
filePath = path.join(dirPath, hashedFileName);
|
|
121
121
|
return filePath;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
__decorate([
|
|
125
|
-
decorators_1.cache()
|
|
125
|
+
(0, decorators_1.cache)()
|
|
126
126
|
], LockService.prototype, "defaultLockFilePath", null);
|
|
127
127
|
exports.LockService = LockService;
|
|
128
128
|
yok_1.injector.register("lockService", LockService);
|
|
@@ -13,7 +13,7 @@ class MessagesService {
|
|
|
13
13
|
this._pathsToMessageJsonFiles = [this.pathToDefaultMessageJson];
|
|
14
14
|
}
|
|
15
15
|
get pathToDefaultMessageJson() {
|
|
16
|
-
return path_1.join(__dirname, "..", "resources", "messages", "errorMessages.json");
|
|
16
|
+
return (0, path_1.join)(__dirname, "..", "resources", "messages", "errorMessages.json");
|
|
17
17
|
}
|
|
18
18
|
get messageJsonFilesContents() {
|
|
19
19
|
if (!this._messageJsonFilesContentsCache ||
|
|
@@ -22,11 +22,11 @@ class QrCodeGenerator {
|
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
let result = null;
|
|
24
24
|
try {
|
|
25
|
-
const qrSvg = qr_image_1.imageSync(data, {
|
|
25
|
+
const qrSvg = (0, qr_image_1.imageSync)(data, {
|
|
26
26
|
size: this.$staticConfig.QR_SIZE,
|
|
27
27
|
type: "svg",
|
|
28
28
|
}).toString();
|
|
29
|
-
result = `data:image/svg+xml;utf-8,${querystring_1.escape(qrSvg)}`;
|
|
29
|
+
result = `data:image/svg+xml;utf-8,${(0, querystring_1.escape)(qrSvg)}`;
|
|
30
30
|
}
|
|
31
31
|
catch (err) {
|
|
32
32
|
this.$logger.trace(`Failed to generate QR code for ${data}`, err);
|
|
@@ -36,7 +36,7 @@ class SettingsService {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
__decorate([
|
|
39
|
-
decorators_1.exported("settingsService")
|
|
39
|
+
(0, decorators_1.exported)("settingsService")
|
|
40
40
|
], SettingsService.prototype, "setSettings", null);
|
|
41
41
|
exports.SettingsService = SettingsService;
|
|
42
42
|
yok_1.injector.register("settingsService", SettingsService);
|
|
@@ -56,7 +56,7 @@ class XcodeSelectService {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
__decorate([
|
|
59
|
-
decorators_1.cache()
|
|
59
|
+
(0, decorators_1.cache)()
|
|
60
60
|
], XcodeSelectService.prototype, "getXcodeVersion", null);
|
|
61
61
|
exports.XcodeSelectService = XcodeSelectService;
|
|
62
62
|
yok_1.injector.register("xcodeSelectService", XcodeSelectService);
|
package/lib/common/yok.js
CHANGED
|
@@ -292,14 +292,14 @@ class Yok {
|
|
|
292
292
|
dynamicCall(call, args) {
|
|
293
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
294
294
|
const data = this.getDynamicCallData(call, args);
|
|
295
|
-
if (helpers_1.isPromise(data)) {
|
|
295
|
+
if ((0, helpers_1.isPromise)(data)) {
|
|
296
296
|
return yield data;
|
|
297
297
|
}
|
|
298
298
|
return data;
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
resolveConstructor(ctor, ctorArguments) {
|
|
302
|
-
helpers_1.annotate(ctor);
|
|
302
|
+
(0, helpers_1.annotate)(ctor);
|
|
303
303
|
const resolvedArgs = ctor.$inject.args.map((paramName) => {
|
|
304
304
|
if (ctorArguments && ctorArguments.hasOwnProperty(paramName)) {
|
|
305
305
|
return ctorArguments[paramName];
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.APK_DIR = exports.OUTPUTS_DIR = exports.BUILD_DIR = exports.BUILD_XCCONFIG_FILE_NAME = exports.INCLUDE_GRADLE_NAME = exports.INFO_PLIST_FILE_NAME = exports.APP_GRADLE_FILE_NAME = exports.MANIFEST_FILE_NAME = exports.ANDROID_ANALYTICS_DATA_FILE = exports.ANDROID_ANALYTICS_DATA_DIR = exports.FONTS_DIR = exports.ASSETS_DIR = exports.MAIN_DIR = exports.SRC_DIR = exports.AWAIT_NOTIFICATION_TIMEOUT_SECONDS = exports.CODE_SIGN_ENTITLEMENTS = exports.LIB_DIR_NAME = exports.KARMA_CONFIG_NAME = exports.TSCCONFIG_TNS_JSON_NAME = exports.WEBPACK_CONFIG_NAME = exports.HOOKS_DIR_NAME = exports.PLATFORMS_DIR_NAME = exports.XML_FILE_EXTENSION = exports.LIVESYNC_EXCLUDED_FILE_PATTERNS = exports.TEST_RUNNER_NAME = exports.TESTING_FRAMEWORKS = exports.LIVESYNC_EXCLUDED_DIRECTORIES = exports.DEFAULT_APP_IDENTIFIER_PREFIX = exports.NODE_MODULE_CACHE_PATH_KEY_NAME = exports.ANDROID_DEVICE_APP_ROOT_TEMPLATE = exports.PACKAGE_LOCK_JSON_FILE_NAME = exports.PACKAGE_JSON_FILE_NAME = exports.SCOPED_IOS_RUNTIME_NAME = exports.SCOPED_ANDROID_RUNTIME_NAME = exports.TNS_IOS_RUNTIME_NAME = exports.TNS_ANDROID_RUNTIME_NAME = exports.UI_MOBILE_BASE_NAME = exports.TNS_CORE_MODULES_WIDGETS_NAME = exports.WEBPACK_PLUGIN_NAME = exports.SCOPED_TNS_CORE_THEME_NAME = exports.TNS_CORE_THEME_NAME = exports.SCOPED_TNS_CORE_MODULES = exports.TNS_CORE_MODULES_NAME = exports.TNS_MODULES_FOLDER_NAME = exports.NODE_MODULES_FOLDER_NAME = exports.NATIVESCRIPT_KEY_NAME = exports.NS_BASE_PODFILE = exports.PROJECT_FRAMEWORK_FOLDER_NAME = exports.APP_RESOURCES_FOLDER_NAME = exports.APP_FOLDER_NAME = void 0;
|
|
4
|
+
exports.DEBUGGER_DETACHED_EVENT_NAME = exports.DEBUGGER_ATTACHED_EVENT_NAME = exports.USER_INTERACTION_NEEDED_EVENT_NAME = exports.CONNECTION_ERROR_EVENT_NAME = exports.BUILD_OUTPUT_EVENT_NAME = exports.ProjectTypes = exports.JsFlavorName = exports.TsFlavorName = exports.SvelteFlavorName = exports.ReactFlavorName = exports.VueFlavorName = exports.NgFlavorName = exports.SVELTE_NAME = exports.REACT_NAME = exports.TYPESCRIPT_NAME = exports.JAVASCRIPT_NAME = exports.ANGULAR_NAME = exports.VUE_NAME = exports.ItunesConnectApplicationTypes = exports.androidAppResourcesFolderName = exports.iOSAppResourcesFolderName = exports.ITMSConstants = exports.ANALYTICS_LOCAL_TEMPLATE_PREFIX = exports.RESERVED_TEMPLATE_NAMES = exports.ReleaseType = exports.SaveOptions = exports.TemplatesV2PackageJsonKeysToRemove = exports.PackageJsonKeysToKeep = exports.LiveSyncTrackActionNames = exports.PackageVersion = exports.MetadataFilteringConstants = exports.IOS_WATCHAPP_EXTENSION_FOLDER = exports.IOS_WATCHAPP_FOLDER = exports.NATIVE_EXTENSION_FOLDER = exports.APPLICATION_RESPONSE_TIMEOUT_SECONDS = exports.NATIVE_SOURCE_FOLDER = exports.TNS_NATIVE_SOURCE_GROUP_NAME = exports.HASHES_FILE_NAME = exports.APKS_EXTENSION_NAME = exports.AAB_EXTENSION_NAME = exports.APK_EXTENSION_NAME = exports.DEPENDENCIES_JSON_NAME = exports.CONFIG_FILE_NAME_TS = exports.CONFIG_FILE_NAME_JS = exports.CONFIG_FILE_NAME_DISPLAY = exports.CONFIG_NS_APP_ENTRY = exports.CONFIG_NS_APP_RESOURCES_ENTRY = exports.CONFIG_NS_FILE_NAME = exports.RESOURCES_DIR = exports.BUNDLE_DIR = void 0;
|
|
5
|
+
exports.PackageManagers = exports.EMIT_APPENDER_EVENT_NAME = exports.LoggerConfigData = exports.LoggerLevel = exports.DeviceConnectionType = exports.LoggerAppenders = exports.IOSNativeTargetTypes = exports.IOSNativeTargetProductTypes = exports.IOSDeviceTargets = exports.RunOnDeviceEvents = exports.AndroidAppBundleMessages = exports.AndroidBundleValidatorMessages = exports.BundleValidatorMessages = exports.IosProjectConstants = exports.PODFILE_NAME = exports.PLUGINS_BUILD_DATA_FILENAME = exports.PLUGIN_BUILD_DATA_FILENAME = exports.AddPlaformErrors = exports.PACKAGE_PLACEHOLDER_NAME = exports.AndroidBuildDefaults = exports.Hooks = exports.SubscribeForNewsletterMessages = exports.PROGRESS_PRIVACY_POLICY_URL = exports.XcodeDeprecationStringFormat = exports.MacOSDeprecationStringFormat = exports.MacOSVersions = exports.AssetConstants = exports.CLI_RESOURCES_DIR_NAME = exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = exports.AnalyticsEventLabelDelimiter = exports.DebugCommandErrors = exports.WEBPACK_COMPILATION_COMPLETE = exports.PREPARE_READY_EVENT_NAME = exports.INITIAL_SYNC_EVENT_NAME = exports.FILES_CHANGE_EVENT_NAME = exports.CACACHE_DIRECTORY_NAME = exports.ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE = exports.ANDROID_RELEASE_BUILD_ERROR_MESSAGE = exports.POST_INSTALL_COMMAND_NAME = exports.INSPECTOR_CACHE_DIRNAME = exports.VERSION_STRING = void 0;
|
|
4
6
|
require("colors");
|
|
5
7
|
const preview_app_constants_1 = require("./services/livesync/playground/preview-app-constants");
|
|
6
8
|
const path_1 = require("path");
|
|
@@ -251,8 +253,8 @@ Hooks.createProject = "createProject";
|
|
|
251
253
|
class AndroidBuildDefaults {
|
|
252
254
|
}
|
|
253
255
|
exports.AndroidBuildDefaults = AndroidBuildDefaults;
|
|
254
|
-
AndroidBuildDefaults.GradleVersion = "4.
|
|
255
|
-
AndroidBuildDefaults.GradleAndroidPluginVersion = "
|
|
256
|
+
AndroidBuildDefaults.GradleVersion = "7.4.0";
|
|
257
|
+
AndroidBuildDefaults.GradleAndroidPluginVersion = "7.1.2";
|
|
256
258
|
exports.PACKAGE_PLACEHOLDER_NAME = "__PACKAGE__";
|
|
257
259
|
class AddPlaformErrors {
|
|
258
260
|
}
|
|
@@ -306,10 +308,10 @@ var IOSNativeTargetTypes;
|
|
|
306
308
|
IOSNativeTargetTypes["watchExtension"] = "watch_extension";
|
|
307
309
|
IOSNativeTargetTypes["appExtension"] = "app_extension";
|
|
308
310
|
})(IOSNativeTargetTypes = exports.IOSNativeTargetTypes || (exports.IOSNativeTargetTypes = {}));
|
|
309
|
-
const pathToLoggerAppendersDir = path_1.join(__dirname, "common", "logger", "appenders");
|
|
311
|
+
const pathToLoggerAppendersDir = (0, path_1.join)(__dirname, "common", "logger", "appenders");
|
|
310
312
|
exports.LoggerAppenders = {
|
|
311
|
-
emitAppender: path_1.join(pathToLoggerAppendersDir, "emit-appender"),
|
|
312
|
-
cliAppender: path_1.join(pathToLoggerAppendersDir, "cli-appender"),
|
|
313
|
+
emitAppender: (0, path_1.join)(pathToLoggerAppendersDir, "emit-appender"),
|
|
314
|
+
cliAppender: (0, path_1.join)(pathToLoggerAppendersDir, "cli-appender"),
|
|
313
315
|
};
|
|
314
316
|
var DeviceConnectionType;
|
|
315
317
|
(function (DeviceConnectionType) {
|
|
@@ -15,6 +15,7 @@ const constants_1 = require("../common/constants");
|
|
|
15
15
|
const events_1 = require("events");
|
|
16
16
|
const helpers_1 = require("../common/helpers");
|
|
17
17
|
const yok_1 = require("../common/yok");
|
|
18
|
+
const perf_hooks_1 = require("perf_hooks");
|
|
18
19
|
class BuildController extends events_1.EventEmitter {
|
|
19
20
|
constructor($analyticsService, $buildArtefactsService, $buildInfoFileService, $fs, $logger, $injector, $mobileHelper, $projectDataService, $projectChangesService, $prepareController) {
|
|
20
21
|
super();
|
|
@@ -42,6 +43,7 @@ class BuildController extends events_1.EventEmitter {
|
|
|
42
43
|
build(buildData) {
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
this.$logger.info("Building project...");
|
|
46
|
+
const startTime = perf_hooks_1.performance.now();
|
|
45
47
|
const platform = buildData.platform.toLowerCase();
|
|
46
48
|
const projectData = this.$projectDataService.getProjectData(buildData.projectDir);
|
|
47
49
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
@@ -67,10 +69,13 @@ class BuildController extends events_1.EventEmitter {
|
|
|
67
69
|
[constants.LoggerConfigData.skipNewLine]: true,
|
|
68
70
|
});
|
|
69
71
|
};
|
|
70
|
-
yield helpers_1.attachAwaitDetach(constants.BUILD_OUTPUT_EVENT_NAME, platformData.platformProjectService, handler, platformData.platformProjectService.buildProject(platformData.projectRoot, projectData, buildData));
|
|
72
|
+
yield (0, helpers_1.attachAwaitDetach)(constants.BUILD_OUTPUT_EVENT_NAME, platformData.platformProjectService, handler, platformData.platformProjectService.buildProject(platformData.projectRoot, projectData, buildData));
|
|
71
73
|
const buildInfoFileDir = platformData.getBuildOutputPath(buildData);
|
|
72
74
|
this.$buildInfoFileService.saveLocalBuildInfo(platformData, buildInfoFileDir);
|
|
75
|
+
const endTime = perf_hooks_1.performance.now();
|
|
76
|
+
const buildTime = (endTime - startTime) / 1000;
|
|
73
77
|
this.$logger.info("Project successfully built.");
|
|
78
|
+
this.$logger.info(`Build time: ${buildTime.toFixed(3)} s.`);
|
|
74
79
|
const result = yield this.$buildArtefactsService.getLatestAppPackagePath(platformData, buildData);
|
|
75
80
|
if (buildData.copyTo) {
|
|
76
81
|
this.$buildArtefactsService.copyLatestAppPackage(buildData.copyTo, platformData, buildData);
|
|
@@ -72,7 +72,7 @@ class CompanyInsightsController {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
__decorate([
|
|
75
|
-
decorators_1.cache()
|
|
75
|
+
(0, decorators_1.cache)()
|
|
76
76
|
], CompanyInsightsController.prototype, "getCompanyDataFromPlaygroundInsightsEndpoint", null);
|
|
77
77
|
exports.CompanyInsightsController = CompanyInsightsController;
|
|
78
78
|
yok_1.injector.register("companyInsightsController", CompanyInsightsController);
|
|
@@ -209,7 +209,7 @@ class DebugController extends events_1.EventEmitter {
|
|
|
209
209
|
};
|
|
210
210
|
if (debugResultInfo.debugUrl) {
|
|
211
211
|
const parseQueryString = true;
|
|
212
|
-
const wsQueryParam = (url_1.parse(debugResultInfo.debugUrl, parseQueryString).query.ws);
|
|
212
|
+
const wsQueryParam = ((0, url_1.parse)(debugResultInfo.debugUrl, parseQueryString).query.ws);
|
|
213
213
|
const hostPortSplit = wsQueryParam && wsQueryParam.split(":");
|
|
214
214
|
debugInfo.port = hostPortSplit && +hostPortSplit[1];
|
|
215
215
|
}
|
|
@@ -226,10 +226,10 @@ class DebugController extends events_1.EventEmitter {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
__decorate([
|
|
229
|
-
decorators_1.performanceLog()
|
|
229
|
+
(0, decorators_1.performanceLog)()
|
|
230
230
|
], DebugController.prototype, "startDebug", null);
|
|
231
231
|
__decorate([
|
|
232
|
-
decorators_1.performanceLog()
|
|
232
|
+
(0, decorators_1.performanceLog)()
|
|
233
233
|
], DebugController.prototype, "enableDebuggingCoreWithoutWaitingCurrentAction", null);
|
|
234
234
|
exports.DebugController = DebugController;
|
|
235
235
|
yok_1.injector.register("debugController", DebugController);
|
|
@@ -47,7 +47,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
47
47
|
{
|
|
48
48
|
packageName: "@nativescript/core",
|
|
49
49
|
minVersion: "6.5.0",
|
|
50
|
-
desiredVersion: "~8.
|
|
50
|
+
desiredVersion: "~8.2.0",
|
|
51
51
|
shouldAddIfMissing: true,
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -57,7 +57,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
57
57
|
{
|
|
58
58
|
packageName: "@nativescript/types",
|
|
59
59
|
minVersion: "7.0.0",
|
|
60
|
-
desiredVersion: "~8.
|
|
60
|
+
desiredVersion: "~8.2.0",
|
|
61
61
|
isDev: true,
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -92,7 +92,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
92
92
|
{
|
|
93
93
|
packageName: "nativescript-vue",
|
|
94
94
|
minVersion: "2.7.0",
|
|
95
|
-
desiredVersion: "~2.9.
|
|
95
|
+
desiredVersion: "~2.9.1",
|
|
96
96
|
shouldMigrateAction(dependency, projectData, loose) {
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
98
|
if (!this.hasDependency(dependency, projectData)) {
|
|
@@ -111,7 +111,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
111
111
|
{
|
|
112
112
|
packageName: "@nativescript/angular",
|
|
113
113
|
minVersion: "10.0.0",
|
|
114
|
-
desiredVersion: "^
|
|
114
|
+
desiredVersion: "^13.0.0",
|
|
115
115
|
shouldMigrateAction(dependency, projectData, loose) {
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
if (!this.hasDependency(dependency, projectData)) {
|
|
@@ -166,7 +166,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
166
166
|
packageName: "typescript",
|
|
167
167
|
isDev: true,
|
|
168
168
|
minVersion: "3.7.0",
|
|
169
|
-
desiredVersion: "~4.
|
|
169
|
+
desiredVersion: "~4.5.5",
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
packageName: "node-sass",
|
|
@@ -177,7 +177,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
177
177
|
{
|
|
178
178
|
packageName: "sass",
|
|
179
179
|
minVersion: "0.0.0",
|
|
180
|
-
desiredVersion: "~1.
|
|
180
|
+
desiredVersion: "~1.49.9",
|
|
181
181
|
isDev: true,
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -195,13 +195,13 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
195
195
|
{
|
|
196
196
|
packageName: "@nativescript/ios",
|
|
197
197
|
minVersion: "6.5.3",
|
|
198
|
-
desiredVersion: "~8.
|
|
198
|
+
desiredVersion: "~8.2.0",
|
|
199
199
|
isDev: true,
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
packageName: "@nativescript/android",
|
|
203
203
|
minVersion: "7.0.0",
|
|
204
|
-
desiredVersion: "~8.
|
|
204
|
+
desiredVersion: "~8.2.0",
|
|
205
205
|
isDev: true,
|
|
206
206
|
},
|
|
207
207
|
];
|
|
@@ -376,7 +376,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
376
376
|
getCachedShouldMigrate(projectDir, platform) {
|
|
377
377
|
return __awaiter(this, void 0, void 0, function* () {
|
|
378
378
|
let cachedShouldMigrateValue = null;
|
|
379
|
-
const cachedHash = yield this.$jsonFileSettingsService.getSettingValue(helpers_1.getHash(`${projectDir}${platform.toLowerCase()}`));
|
|
379
|
+
const cachedHash = yield this.$jsonFileSettingsService.getSettingValue((0, helpers_1.getHash)(`${projectDir}${platform.toLowerCase()}`));
|
|
380
380
|
const packageJsonHash = yield this.getPackageJsonHash(projectDir);
|
|
381
381
|
if (cachedHash === packageJsonHash) {
|
|
382
382
|
cachedShouldMigrateValue = false;
|
|
@@ -388,7 +388,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
388
388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
389
389
|
this.$logger.trace(`Caching shouldMigrate result for platform ${platform}.`);
|
|
390
390
|
const packageJsonHash = yield this.getPackageJsonHash(projectDir);
|
|
391
|
-
yield this.$jsonFileSettingsService.saveSetting(helpers_1.getHash(`${projectDir}${platform.toLowerCase()}`), packageJsonHash);
|
|
391
|
+
yield this.$jsonFileSettingsService.saveSetting((0, helpers_1.getHash)(`${projectDir}${platform.toLowerCase()}`), packageJsonHash);
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
getPackageJsonHash(projectDir) {
|
|
@@ -399,7 +399,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
399
399
|
}
|
|
400
400
|
ensureGitCleanOrForce(projectDir) {
|
|
401
401
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
-
const git = simple_git_1.default(projectDir);
|
|
402
|
+
const git = (0, simple_git_1.default)(projectDir);
|
|
403
403
|
const isGit = yield git.checkIsRepo();
|
|
404
404
|
const isForce = this.$options.force;
|
|
405
405
|
if (!isGit) {
|
|
@@ -673,7 +673,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
673
673
|
const frameworks = (matches && matches[1] && matches[1].trim()) || '["jasmine"]';
|
|
674
674
|
const testsDir = path.join(projectData.appDirectoryPath, "tests");
|
|
675
675
|
const relativeTestsDir = path.relative(projectData.projectDir, testsDir);
|
|
676
|
-
const testFiles = `'${helpers_1.fromWindowsRelativePathToUnix(relativeTestsDir)}/**/*.*'`;
|
|
676
|
+
const testFiles = `'${(0, helpers_1.fromWindowsRelativePathToUnix)(relativeTestsDir)}/**/*.*'`;
|
|
677
677
|
const karmaConfTemplate = this.$resources.readText("test/karma.conf.js");
|
|
678
678
|
const karmaConf = _.template(karmaConfTemplate)({
|
|
679
679
|
frameworks,
|
|
@@ -780,7 +780,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
780
780
|
migrateNativeScriptAngular() {
|
|
781
781
|
return __awaiter(this, void 0, void 0, function* () {
|
|
782
782
|
const minVersion = "10.0.0";
|
|
783
|
-
const desiredVersion = "
|
|
783
|
+
const desiredVersion = "~13.2.0";
|
|
784
784
|
const dependencies = [
|
|
785
785
|
{
|
|
786
786
|
packageName: "@angular/animations",
|
|
@@ -833,13 +833,13 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
833
833
|
{
|
|
834
834
|
packageName: "rxjs",
|
|
835
835
|
minVersion: "6.6.0",
|
|
836
|
-
desiredVersion: "~7.
|
|
836
|
+
desiredVersion: "~7.5.0",
|
|
837
837
|
shouldAddIfMissing: true,
|
|
838
838
|
},
|
|
839
839
|
{
|
|
840
840
|
packageName: "zone.js",
|
|
841
841
|
minVersion: "0.11.1",
|
|
842
|
-
desiredVersion: "~0.11.
|
|
842
|
+
desiredVersion: "~0.11.5",
|
|
843
843
|
shouldAddIfMissing: true,
|
|
844
844
|
},
|
|
845
845
|
{
|
|
@@ -874,7 +874,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
874
874
|
{
|
|
875
875
|
packageName: "nativescript-vue-template-compiler",
|
|
876
876
|
minVersion: "2.7.0",
|
|
877
|
-
desiredVersion: "~2.9.
|
|
877
|
+
desiredVersion: "~2.9.1",
|
|
878
878
|
isDev: true,
|
|
879
879
|
shouldAddIfMissing: true,
|
|
880
880
|
},
|
|
@@ -13,7 +13,7 @@ exports.PlatformController = void 0;
|
|
|
13
13
|
const path = require("path");
|
|
14
14
|
const yok_1 = require("../common/yok");
|
|
15
15
|
class PlatformController {
|
|
16
|
-
constructor($addPlatformService, $errors, $fs, $logger, $packageInstallationManager, $projectDataService, $platformsDataService, $projectChangesService) {
|
|
16
|
+
constructor($addPlatformService, $errors, $fs, $logger, $packageInstallationManager, $projectDataService, $platformsDataService, $projectChangesService, $mobileHelper) {
|
|
17
17
|
this.$addPlatformService = $addPlatformService;
|
|
18
18
|
this.$errors = $errors;
|
|
19
19
|
this.$fs = $fs;
|
|
@@ -22,13 +22,14 @@ class PlatformController {
|
|
|
22
22
|
this.$projectDataService = $projectDataService;
|
|
23
23
|
this.$platformsDataService = $platformsDataService;
|
|
24
24
|
this.$projectChangesService = $projectChangesService;
|
|
25
|
+
this.$mobileHelper = $mobileHelper;
|
|
25
26
|
}
|
|
26
|
-
addPlatform(addPlatformData) {
|
|
27
|
+
addPlatform(addPlatformData, projectData) {
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
29
|
const [platform, version] = addPlatformData.platform
|
|
29
30
|
.toLowerCase()
|
|
30
31
|
.split("@");
|
|
31
|
-
|
|
32
|
+
projectData !== null && projectData !== void 0 ? projectData : (projectData = this.$projectDataService.getProjectData(addPlatformData.projectDir));
|
|
32
33
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
33
34
|
this.$logger.trace(`Creating NativeScript project for the ${platform} platform`);
|
|
34
35
|
this.$logger.trace(`Path: ${platformData.projectRoot}`);
|
|
@@ -39,17 +40,42 @@ class PlatformController {
|
|
|
39
40
|
this.$logger.trace("Determined package to install is", packageToInstall);
|
|
40
41
|
const installedPlatformVersion = yield this.$addPlatformService.addPlatformSafe(projectData, platformData, packageToInstall, addPlatformData);
|
|
41
42
|
this.$fs.ensureDirectoryExists(path.join(projectData.platformsDir, platform));
|
|
43
|
+
if (this.$mobileHelper.isAndroidPlatform(platform)) {
|
|
44
|
+
const gradlePropertiesPath = path.resolve(platformData.projectRoot, "gradle.properties");
|
|
45
|
+
const commentHeader = "# App configuration";
|
|
46
|
+
const appPath = projectData.getAppDirectoryRelativePath();
|
|
47
|
+
const appResourcesPath = projectData.getAppResourcesRelativeDirectoryPath();
|
|
48
|
+
let gradlePropertiesContents = "";
|
|
49
|
+
if (this.$fs.exists(gradlePropertiesPath)) {
|
|
50
|
+
gradlePropertiesContents = this.$fs
|
|
51
|
+
.readFile(gradlePropertiesPath)
|
|
52
|
+
.toString();
|
|
53
|
+
}
|
|
54
|
+
if (!gradlePropertiesContents.includes(commentHeader)) {
|
|
55
|
+
const dataToWrite = [
|
|
56
|
+
"",
|
|
57
|
+
"",
|
|
58
|
+
commentHeader,
|
|
59
|
+
`appPath = ${appPath}`,
|
|
60
|
+
`appResourcesPath = ${appResourcesPath}`,
|
|
61
|
+
"",
|
|
62
|
+
].join("\n");
|
|
63
|
+
gradlePropertiesContents += dataToWrite;
|
|
64
|
+
this.$logger.trace("Updated gradle.properties with project data...");
|
|
65
|
+
this.$fs.writeFile(gradlePropertiesPath, gradlePropertiesContents);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
42
68
|
this.$logger.info(`Platform ${platform} successfully added. v${installedPlatformVersion}`);
|
|
43
69
|
});
|
|
44
70
|
}
|
|
45
|
-
addPlatformIfNeeded(addPlatformData) {
|
|
71
|
+
addPlatformIfNeeded(addPlatformData, projectData) {
|
|
46
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
73
|
const [platform] = addPlatformData.platform.toLowerCase().split("@");
|
|
48
|
-
|
|
74
|
+
projectData !== null && projectData !== void 0 ? projectData : (projectData = this.$projectDataService.getProjectData(addPlatformData.projectDir));
|
|
49
75
|
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
50
76
|
const shouldAddPlatform = this.shouldAddPlatform(platformData, projectData, addPlatformData.nativePrepare);
|
|
51
77
|
if (shouldAddPlatform) {
|
|
52
|
-
yield this.addPlatform(addPlatformData);
|
|
78
|
+
yield this.addPlatform(addPlatformData, projectData);
|
|
53
79
|
}
|
|
54
80
|
});
|
|
55
81
|
}
|
|
@@ -82,7 +82,7 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
82
82
|
}
|
|
83
83
|
prepareCore(prepareData, projectData) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
yield this.$platformController.addPlatformIfNeeded(prepareData);
|
|
85
|
+
yield this.$platformController.addPlatformIfNeeded(prepareData, projectData);
|
|
86
86
|
yield this.trackRuntimeVersion(prepareData.platform, projectData);
|
|
87
87
|
this.$logger.info("Preparing project...");
|
|
88
88
|
prepareData.env = prepareData.env || {};
|
|
@@ -295,17 +295,17 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
__decorate([
|
|
298
|
-
decorators_1.performanceLog(),
|
|
299
|
-
helpers_1.hook("prepare")
|
|
298
|
+
(0, decorators_1.performanceLog)(),
|
|
299
|
+
(0, helpers_1.hook)("prepare")
|
|
300
300
|
], PrepareController.prototype, "prepareCore", null);
|
|
301
301
|
__decorate([
|
|
302
|
-
helpers_1.hook("watch")
|
|
302
|
+
(0, helpers_1.hook)("watch")
|
|
303
303
|
], PrepareController.prototype, "startWatchersWithPrepare", null);
|
|
304
304
|
__decorate([
|
|
305
|
-
helpers_1.hook("watchPatterns")
|
|
305
|
+
(0, helpers_1.hook)("watchPatterns")
|
|
306
306
|
], PrepareController.prototype, "getWatcherPatterns", null);
|
|
307
307
|
__decorate([
|
|
308
|
-
decorators_1.cache()
|
|
308
|
+
(0, decorators_1.cache)()
|
|
309
309
|
], PrepareController.prototype, "trackRuntimeVersion", null);
|
|
310
310
|
exports.PrepareController = PrepareController;
|
|
311
311
|
yok_1.injector.register("prepareController", PrepareController);
|
|
@@ -144,7 +144,7 @@ class PreviewAppController extends events_1.EventEmitter {
|
|
|
144
144
|
}
|
|
145
145
|
yield Promise.all(_.map(connectedDevices, (device) => __awaiter(this, void 0, void 0, function* () {
|
|
146
146
|
const previousSync = this.devicesLiveSyncChain[device.id] || Promise.resolve();
|
|
147
|
-
const currentSyncDeferPromise = helpers_1.deferPromise();
|
|
147
|
+
const currentSyncDeferPromise = (0, helpers_1.deferPromise)();
|
|
148
148
|
this.devicesLiveSyncChain[device.id] = currentSyncDeferPromise.promise;
|
|
149
149
|
this.devicesCurrentHmrHash[device.id] =
|
|
150
150
|
this.devicesCurrentHmrHash[device.id] || platformHmrData.hash;
|
|
@@ -217,7 +217,7 @@ class PreviewAppController extends events_1.EventEmitter {
|
|
|
217
217
|
return payloads;
|
|
218
218
|
}
|
|
219
219
|
catch (err) {
|
|
220
|
-
this.$logger.warn(`Unable to apply changes for device ${this.getDeviceDisplayName(device)}. Error is: ${err}, ${helpers_1.stringify(err)}`);
|
|
220
|
+
this.$logger.warn(`Unable to apply changes for device ${this.getDeviceDisplayName(device)}. Error is: ${err}, ${(0, helpers_1.stringify)(err)}`);
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
}
|
|
@@ -245,7 +245,7 @@ class PreviewAppController extends events_1.EventEmitter {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
__decorate([
|
|
248
|
-
decorators_1.performanceLog()
|
|
248
|
+
(0, decorators_1.performanceLog)()
|
|
249
249
|
], PreviewAppController.prototype, "handlePrepareReadyEvent", null);
|
|
250
250
|
exports.PreviewAppController = PreviewAppController;
|
|
251
251
|
yok_1.injector.register("previewAppController", PreviewAppController);
|