nativescript 9.0.4-dev.1 → 9.0.4-dev.2
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/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +7 -0
- package/lib/bootstrap.js +5 -1
- package/lib/bun-package-manager.js +14 -1
- package/lib/color.js +4 -0
- package/lib/commands/add-platform.js +1 -0
- package/lib/commands/apple-login.js +1 -0
- package/lib/commands/appstore-list.js +1 -0
- package/lib/commands/appstore-upload.js +3 -0
- package/lib/commands/build.js +3 -2
- package/lib/commands/clean.js +22 -1
- package/lib/commands/command-base.js +1 -0
- package/lib/commands/config.js +5 -0
- package/lib/commands/create-project.js +6 -0
- package/lib/commands/debug.js +6 -1
- package/lib/commands/deploy.js +3 -2
- package/lib/commands/embedding/embed.js +7 -0
- package/lib/commands/extensibility/install-extension.js +1 -0
- package/lib/commands/extensibility/list-extensions.js +1 -0
- package/lib/commands/extensibility/uninstall-extension.js +1 -0
- package/lib/commands/fonts.js +1 -0
- package/lib/commands/generate-assets.js +1 -0
- package/lib/commands/generate-help.js +1 -0
- package/lib/commands/generate.js +48 -1
- package/lib/commands/hooks/common.js +2 -1
- package/lib/commands/hooks/hooks-lock.js +1 -0
- package/lib/commands/hooks/hooks.js +1 -0
- package/lib/commands/info.js +1 -0
- package/lib/commands/install.js +1 -0
- package/lib/commands/list-platforms.js +1 -0
- package/lib/commands/migrate.js +1 -0
- package/lib/commands/native-add.js +5 -0
- package/lib/commands/platform-clean.js +1 -0
- package/lib/commands/plugin/add-plugin.js +1 -0
- package/lib/commands/plugin/build-plugin.js +1 -0
- package/lib/commands/plugin/create-plugin.js +5 -0
- package/lib/commands/plugin/list-plugins.js +1 -0
- package/lib/commands/plugin/remove-plugin.js +2 -0
- package/lib/commands/plugin/update-plugin.js +1 -0
- package/lib/commands/post-install.js +6 -0
- package/lib/commands/prepare.js +4 -3
- package/lib/commands/preview.js +2 -0
- package/lib/commands/remove-platform.js +1 -0
- package/lib/commands/resources/resources-update.js +2 -0
- package/lib/commands/run.js +1 -0
- package/lib/commands/setup.js +1 -0
- package/lib/commands/start.js +1 -0
- package/lib/commands/test-init.js +4 -0
- package/lib/commands/test.js +9 -2
- package/lib/commands/typings.js +2 -1
- package/lib/commands/update-platform.js +5 -0
- package/lib/commands/update.js +2 -0
- package/lib/commands/widget.js +20 -1
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -0
- package/lib/common/codeGeneration/code-entity.js +1 -0
- package/lib/common/codeGeneration/code-printer.js +1 -0
- package/lib/common/command-params.js +1 -0
- package/lib/common/commands/analytics.js +3 -0
- package/lib/common/commands/autocompletion.js +3 -0
- package/lib/common/commands/device/device-log-stream.js +1 -0
- package/lib/common/commands/device/get-file.js +2 -0
- package/lib/common/commands/device/list-applications.js +1 -0
- package/lib/common/commands/device/list-devices.js +3 -0
- package/lib/common/commands/device/list-files.js +2 -0
- package/lib/common/commands/device/put-file.js +2 -0
- package/lib/common/commands/device/run-application.js +1 -0
- package/lib/common/commands/device/stop-application.js +1 -0
- package/lib/common/commands/device/uninstall-application.js +1 -0
- package/lib/common/commands/doctor.js +3 -2
- package/lib/common/commands/generate-messages.js +1 -0
- package/lib/common/commands/help.js +1 -0
- package/lib/common/commands/package-manager-get.js +1 -0
- package/lib/common/commands/package-manager-set.js +1 -0
- package/lib/common/commands/post-install.js +1 -0
- package/lib/common/commands/preuninstall.js +11 -2
- package/lib/common/commands/proxy/proxy-base.js +4 -0
- package/lib/common/commands/proxy/proxy-clear.js +1 -0
- package/lib/common/commands/proxy/proxy-get.js +1 -0
- package/lib/common/commands/proxy/proxy-set.js +1 -0
- package/lib/common/common-lib.js +1 -0
- package/lib/common/constants.js +11 -0
- package/lib/common/decorators.js +48 -0
- package/lib/common/dispatchers.js +10 -1
- package/lib/common/errors.js +13 -3
- package/lib/common/file-system.js +13 -2
- package/lib/common/header.js +3 -0
- package/lib/common/helpers.js +89 -3
- package/lib/common/host-info.js +4 -0
- package/lib/common/http-client.js +20 -0
- package/lib/common/logger/appenders/cli-appender.js +4 -0
- package/lib/common/logger/appenders/emit-appender.js +4 -0
- package/lib/common/logger/layouts/cli-layout.js +1 -0
- package/lib/common/logger/logger.js +5 -0
- package/lib/common/messages/messages.js +6 -0
- package/lib/common/mobile/android/android-application-manager.js +20 -1
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
- package/lib/common/mobile/android/android-debug-bridge.js +6 -0
- package/lib/common/mobile/android/android-device-file-system.js +4 -0
- package/lib/common/mobile/android/android-device-hash-service.js +3 -0
- package/lib/common/mobile/android/android-device.js +8 -0
- package/lib/common/mobile/android/android-emulator-services.js +2 -1
- package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
- package/lib/common/mobile/android/android-log-filter.js +4 -0
- package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
- package/lib/common/mobile/android/logcat-helper.js +13 -0
- package/lib/common/mobile/application-manager-base.js +6 -0
- package/lib/common/mobile/device-emitter.js +4 -0
- package/lib/common/mobile/device-log-emitter.js +1 -0
- package/lib/common/mobile/device-log-provider-base.js +1 -0
- package/lib/common/mobile/device-log-provider.js +23 -0
- package/lib/common/mobile/device-platforms-constants.js +1 -0
- package/lib/common/mobile/emulator-helper.js +3 -0
- package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
- package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
- package/lib/common/mobile/ios/device/ios-device.js +4 -0
- package/lib/common/mobile/ios/ios-device-base.js +1 -0
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
- package/lib/common/mobile/ios/ios-log-filter.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
- package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
- package/lib/common/mobile/log-filter.js +2 -0
- package/lib/common/mobile/logging-levels.js +1 -0
- package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
- package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +69 -0
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-helper.js +1 -0
- package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
- package/lib/common/opener.js +1 -0
- package/lib/common/os-info.js +1 -0
- package/lib/common/plist-parser.js +1 -0
- package/lib/common/project-helper.js +1 -0
- package/lib/common/prompter.js +9 -1
- package/lib/common/queue.js +1 -0
- package/lib/common/resource-loader.js +1 -0
- package/lib/common/services/auto-completion-service.js +13 -1
- package/lib/common/services/cancellation.js +2 -1
- package/lib/common/services/commands-service.js +17 -6
- package/lib/common/services/help-service.js +11 -3
- package/lib/common/services/hooks-service.js +13 -0
- package/lib/common/services/ios-notification-service.js +1 -0
- package/lib/common/services/json-file-settings-service.js +6 -0
- package/lib/common/services/lock-service.js +6 -0
- package/lib/common/services/message-contract-generator.js +1 -0
- package/lib/common/services/messages-service.js +1 -0
- package/lib/common/services/micro-templating-service.js +6 -0
- package/lib/common/services/net-service.js +3 -0
- package/lib/common/services/project-files-manager.js +5 -0
- package/lib/common/services/project-files-provider-base.js +1 -0
- package/lib/common/services/proxy-service.js +1 -0
- package/lib/common/services/qr.js +1 -0
- package/lib/common/services/settings-service.js +1 -0
- package/lib/common/services/xcode-select-service.js +1 -0
- package/lib/common/utils.js +1 -0
- package/lib/common/validators/project-name-validator.js +1 -0
- package/lib/common/validators/validation-result.js +1 -0
- package/lib/common/verify-node-version.js +8 -1
- package/lib/common/yok.js +32 -11
- package/lib/config.js +22 -1
- package/lib/constants-provider.js +1 -0
- package/lib/constants.js +53 -0
- package/lib/controllers/build-controller.js +4 -3
- package/lib/controllers/debug-controller.js +8 -3
- package/lib/controllers/deploy-controller.js +1 -0
- package/lib/controllers/migrate-controller.js +90 -4
- package/lib/controllers/platform-controller.js +9 -1
- package/lib/controllers/prepare-controller.js +17 -4
- package/lib/controllers/run-controller.js +17 -1
- package/lib/controllers/update-controller-base.js +1 -0
- package/lib/controllers/update-controller.js +11 -0
- package/lib/data/build-data.js +1 -0
- package/lib/data/controller-data-base.js +1 -0
- package/lib/data/debug-data.js +1 -0
- package/lib/data/platform-data.js +1 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/data/run-data.js +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
- package/lib/detached-processes/cleanup-process.js +18 -14
- package/lib/detached-processes/file-log-service.js +2 -1
- package/lib/device-path-provider.js +1 -0
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
- package/lib/device-sockets/ios/notification.js +3 -0
- package/lib/device-sockets/ios/socket-request-executor.js +3 -0
- package/lib/helpers/android-bundle-validator-helper.js +2 -1
- package/lib/helpers/deploy-command-helper.js +1 -0
- package/lib/helpers/key-command-helper.js +4 -2
- package/lib/helpers/livesync-command-helper.js +4 -1
- package/lib/helpers/network-connectivity-validator.js +1 -0
- package/lib/helpers/options-track-helper.js +3 -2
- package/lib/helpers/package-path-helper.js +1 -0
- package/lib/helpers/platform-command-helper.js +7 -2
- package/lib/helpers/version-validator-helper.js +1 -0
- package/lib/key-commands/bootstrap.js +3 -2
- package/lib/key-commands/index.js +5 -4
- package/lib/nativescript-cli-lib-bootstrap.js +4 -0
- package/lib/nativescript-cli-lib.js +1 -0
- package/lib/nativescript-cli.js +11 -1
- package/lib/node/pbxproj-dom-xcode.js +1 -0
- package/lib/node/xcode.js +1 -0
- package/lib/node-package-manager.js +11 -1
- package/lib/options.js +144 -119
- package/lib/package-installation-manager.js +8 -1
- package/lib/package-manager.js +2 -0
- package/lib/platform-command-param.js +1 -0
- package/lib/pnpm-package-manager.js +4 -1
- package/lib/project-data.js +12 -0
- package/lib/providers/project-files-provider.js +1 -0
- package/lib/resolvers/livesync-service-resolver.js +1 -0
- package/lib/services/analytics/analytics-broker-process.js +10 -6
- package/lib/services/analytics/analytics-broker.js +2 -1
- package/lib/services/analytics/analytics-service.js +29 -25
- package/lib/services/analytics/google-analytics-provider.js +13 -12
- package/lib/services/analytics-settings-service.js +5 -0
- package/lib/services/android/android-bundle-tool-service.js +1 -0
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +1 -0
- package/lib/services/android/gradle-command-service.js +1 -0
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +31 -2
- package/lib/services/android-project-service.js +71 -4
- package/lib/services/android-resources-migration-service.js +7 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
- package/lib/services/apple-portal/srp/srp-wrapper.js +4 -1
- package/lib/services/assets-generation/assets-generation-service.js +10 -5
- package/lib/services/build-artifacts-service.js +2 -1
- package/lib/services/build-data-service.js +1 -0
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/bundler/bundler-compiler-service.js +68 -1
- package/lib/services/bundler/bundler.js +1 -0
- package/lib/services/cleanup-service.js +13 -9
- package/lib/services/cocoapods-platform-manager.js +9 -0
- package/lib/services/cocoapods-service.js +21 -1
- package/lib/services/debug-data-service.js +1 -0
- package/lib/services/debug-service-base.js +7 -0
- package/lib/services/device/device-install-app-service.js +2 -1
- package/lib/services/doctor-service.js +21 -6
- package/lib/services/extensibility-service.js +8 -0
- package/lib/services/files-hash-service.js +1 -0
- package/lib/services/hmr-status-service.js +2 -0
- package/lib/services/info-service.js +1 -0
- package/lib/services/initialize-service.js +5 -1
- package/lib/services/ios/export-options-plist-service.js +4 -0
- package/lib/services/ios/ios-signing-service.js +4 -0
- package/lib/services/ios/spm-service.js +18 -0
- package/lib/services/ios/xcodebuild-args-service.js +11 -0
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +2 -1
- package/lib/services/ios-debugger-port-service.js +1 -0
- package/lib/services/ios-device-debug-service.js +1 -0
- package/lib/services/ios-entitlements-service.js +1 -0
- package/lib/services/ios-extensions-service.js +1 -0
- package/lib/services/ios-log-filter.js +20 -0
- package/lib/services/ios-native-target-service.js +6 -4
- package/lib/services/ios-project-service.js +100 -1
- package/lib/services/ios-provision-service.js +3 -0
- package/lib/services/ios-watch-app-service.js +1 -0
- package/lib/services/ip-service.js +2 -0
- package/lib/services/itmstransporter-service.js +1 -0
- package/lib/services/karma-execution.js +2 -0
- package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
- package/lib/services/livesync/android-device-livesync-service.js +2 -0
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
- package/lib/services/livesync/android-livesync-service.js +1 -0
- package/lib/services/livesync/android-livesync-tool.js +4 -0
- package/lib/services/livesync/device-livesync-service-base.js +2 -0
- package/lib/services/livesync/ios-device-livesync-service.js +7 -0
- package/lib/services/livesync/ios-livesync-service.js +2 -0
- package/lib/services/livesync/livesync-socket.js +1 -0
- package/lib/services/livesync/platform-livesync-service-base.js +5 -0
- package/lib/services/livesync-process-data-service.js +1 -0
- package/lib/services/log-parser-service.js +1 -0
- package/lib/services/log-source-map-service.js +15 -0
- package/lib/services/marking-mode-service.js +8 -5
- package/lib/services/metadata-filtering-service.js +1 -0
- package/lib/services/npm-config-service.js +4 -0
- package/lib/services/pacote-service.js +7 -0
- package/lib/services/performance-service.js +3 -1
- package/lib/services/platform/add-platform-service.js +49 -2
- package/lib/services/platform/platform-validation-service.js +1 -0
- package/lib/services/platform/prepare-native-platform-service.js +5 -2
- package/lib/services/platform-environment-requirements.js +8 -3
- package/lib/services/platform-project-service-base.js +1 -0
- package/lib/services/platforms-data-service.js +1 -0
- package/lib/services/plugins-service.js +20 -2
- package/lib/services/prepare-data-service.js +1 -0
- package/lib/services/project-backup-service.js +4 -0
- package/lib/services/project-changes-service.js +14 -3
- package/lib/services/project-cleanup-service.js +2 -0
- package/lib/services/project-config-service.js +21 -2
- package/lib/services/project-data-service.js +36 -7
- package/lib/services/project-name-service.js +1 -0
- package/lib/services/project-service.js +10 -0
- package/lib/services/project-templates-service.js +3 -2
- package/lib/services/qr-code-terminal-service.js +1 -0
- package/lib/services/require-service.js +1 -0
- package/lib/services/start-service.js +1 -0
- package/lib/services/temp-service.js +3 -0
- package/lib/services/terminal-spinner-service.js +2 -0
- package/lib/services/test-execution-service.js +9 -2
- package/lib/services/test-initialization-service.js +4 -0
- package/lib/services/timeline-profiler-service.js +1 -0
- package/lib/services/user-settings-service.js +1 -0
- package/lib/services/versions-service.js +6 -4
- package/lib/services/watch-ignore-list-service.js +1 -0
- package/lib/services/xcconfig-service.js +2 -0
- package/lib/services/xcproj-service.js +1 -0
- package/lib/shared-event-bus.js +6 -0
- package/lib/sys-info.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +12 -0
- package/lib/tools/node-modules/node-modules-builder.js +1 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
- package/lib/yarn-package-manager.js +1 -0
- package/lib/yarn2-package-manager.js +3 -0
- package/package.json +1 -1
package/lib/common/helpers.js
CHANGED
|
@@ -71,6 +71,13 @@ function doesCurrentNpmCommandMatch(patterns) {
|
|
|
71
71
|
}
|
|
72
72
|
return result;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Equivalent of lodash's some, but instead of lambda, just pass array of Regular Expressions.
|
|
76
|
+
* If any of them matches any of the given elements, true is returned.
|
|
77
|
+
* @param {string[]} array Elements to be checked.
|
|
78
|
+
* @param {RegExp[]} patterns Regular expressions to be tested
|
|
79
|
+
* @returns {boolean} True in case any element of the array matches any of the patterns. False otherwise.
|
|
80
|
+
*/
|
|
74
81
|
function someWithRegExps(array, patterns) {
|
|
75
82
|
return _.some(array, (item) => _.some(patterns, (pattern) => !!item.match(pattern)));
|
|
76
83
|
}
|
|
@@ -82,6 +89,7 @@ function getCurrentNpmCommandArgv() {
|
|
|
82
89
|
result = npmConfigArgv.original || [];
|
|
83
90
|
}
|
|
84
91
|
catch (error) {
|
|
92
|
+
// ignore
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
95
|
return result;
|
|
@@ -100,6 +108,7 @@ function isInstallingNativeScriptGloballyWithNpm() {
|
|
|
100
108
|
return isInstallCommand && isGlobalCommand && hasNativeScriptPackage;
|
|
101
109
|
}
|
|
102
110
|
function isInstallingNativeScriptGloballyWithYarn() {
|
|
111
|
+
// yarn populates the same env used by npm - npm_config_argv, so check it for yarn specific command
|
|
103
112
|
const isInstallCommand = doesCurrentNpmCommandMatch([/^add$/]);
|
|
104
113
|
const isGlobalCommand = doesCurrentNpmCommandMatch([/^global$/]);
|
|
105
114
|
const hasNativeScriptPackage = doesCurrentNpmCommandMatch([
|
|
@@ -108,6 +117,13 @@ function isInstallingNativeScriptGloballyWithYarn() {
|
|
|
108
117
|
]);
|
|
109
118
|
return isInstallCommand && isGlobalCommand && hasNativeScriptPackage;
|
|
110
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Creates regular expression from input string.
|
|
122
|
+
* The method replaces all occurences of RegExp special symbols in the input string with \<symbol>.
|
|
123
|
+
* @param {string} input The string from which a regular expression should be created.
|
|
124
|
+
* @param {string} opts RegExp options, for example "gm" - global and multiline.
|
|
125
|
+
* @returns {RegExp} The regular expression created from the input string.
|
|
126
|
+
*/
|
|
111
127
|
function createRegExp(input, opts) {
|
|
112
128
|
if (!input || !_.isString(input)) {
|
|
113
129
|
throw new Error("Input must be a string.");
|
|
@@ -115,13 +131,20 @@ function createRegExp(input, opts) {
|
|
|
115
131
|
const escapedSource = regExpEscape(input);
|
|
116
132
|
return new RegExp(escapedSource, opts);
|
|
117
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Escapes all special symbols used in regex.
|
|
136
|
+
* @param {string} input The string in which to replace the special regexp symbols.
|
|
137
|
+
* @returns {string} A string in which all regex symbols are escaped.
|
|
138
|
+
*/
|
|
118
139
|
function regExpEscape(input) {
|
|
140
|
+
// https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
|
119
141
|
return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
120
142
|
}
|
|
121
143
|
function getShortPluginName(pluginName) {
|
|
122
144
|
return sanitizePluginName(pluginName).replace(/[\-]/g, "_");
|
|
123
145
|
}
|
|
124
146
|
function sanitizePluginName(pluginName) {
|
|
147
|
+
// avoid long plugin names, exclude the npm module scope (@scope/nativescript-plugin) from the android plugin name
|
|
125
148
|
return pluginName.split("/").pop();
|
|
126
149
|
}
|
|
127
150
|
async function executeActionByChunks(initialData, chunkSize, elementAction) {
|
|
@@ -168,6 +191,13 @@ function deferPromise() {
|
|
|
168
191
|
getResult: () => result,
|
|
169
192
|
};
|
|
170
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Executes all promises and does not stop in case any of them throws.
|
|
196
|
+
* Returns the results of all promises in array when all are successfully resolved.
|
|
197
|
+
* In case any of the promises is rejected, rejects the resulted promise with all accumulated errors.
|
|
198
|
+
* @param {Promise<T>[]} promises Promises to be resolved.
|
|
199
|
+
* @returns {Promise<T[]>} New promise which will be resolved with the results of all promises.
|
|
200
|
+
*/
|
|
171
201
|
function settlePromises(promises) {
|
|
172
202
|
return new Promise((resolve, reject) => {
|
|
173
203
|
let settledPromisesCount = 0;
|
|
@@ -183,6 +213,7 @@ function settlePromises(promises) {
|
|
|
183
213
|
results[index] = result;
|
|
184
214
|
})
|
|
185
215
|
.catch((err) => {
|
|
216
|
+
// Accumulate all errors.
|
|
186
217
|
errors.push(err);
|
|
187
218
|
})
|
|
188
219
|
.then(() => {
|
|
@@ -214,12 +245,14 @@ function bashQuote(s) {
|
|
|
214
245
|
if (s[0] === "'" && s[s.length - 1] === "'") {
|
|
215
246
|
return s;
|
|
216
247
|
}
|
|
248
|
+
// replace ' with '"'"' and wrap in ''
|
|
217
249
|
return "'" + s.replace(/'/g, "'\"'\"'") + "'";
|
|
218
250
|
}
|
|
219
251
|
function cmdQuote(s) {
|
|
220
252
|
if (s[0] === '"' && s[s.length - 1] === '"') {
|
|
221
253
|
return s;
|
|
222
254
|
}
|
|
255
|
+
// replace " with \" and wrap in ""
|
|
223
256
|
return '"' + s.replace(/"/g, '\\"') + '"';
|
|
224
257
|
}
|
|
225
258
|
function quoteString(s) {
|
|
@@ -276,6 +309,9 @@ function isInteractive() {
|
|
|
276
309
|
const result = isRunningInTTY() && !isCIEnvironment();
|
|
277
310
|
return result;
|
|
278
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Checks if current process is running in Text Terminal (TTY)
|
|
314
|
+
*/
|
|
279
315
|
function isRunningInTTY() {
|
|
280
316
|
return (process.stdout &&
|
|
281
317
|
process.stdout.isTTY &&
|
|
@@ -283,6 +319,10 @@ function isRunningInTTY() {
|
|
|
283
319
|
process.stdin.isTTY);
|
|
284
320
|
}
|
|
285
321
|
function isCIEnvironment() {
|
|
322
|
+
// The following CI environments set their own environment variables that we respect:
|
|
323
|
+
// travis: "CI",
|
|
324
|
+
// circleCI: "CI",
|
|
325
|
+
// jenkins: "JENKINS_HOME"
|
|
286
326
|
return !!(process.env && (process.env.CI || process.env.JENKINS_HOME));
|
|
287
327
|
}
|
|
288
328
|
function toBoolean(str) {
|
|
@@ -337,11 +377,11 @@ function getMessageWithBorders(message, spanLength = 3) {
|
|
|
337
377
|
const longestRowLength = message.split("\n").sort((a, b) => {
|
|
338
378
|
return b.length - a.length;
|
|
339
379
|
})[0].length;
|
|
340
|
-
let border = "*".repeat(longestRowLength + 2 * spanLength);
|
|
380
|
+
let border = "*".repeat(longestRowLength + 2 * spanLength); // * 2 for both sides
|
|
341
381
|
if (border.length % 2 === 0) {
|
|
342
|
-
border += "*";
|
|
382
|
+
border += "*"; // the * should always be an odd number in order to get * in each edge (we will remove the even *s below)
|
|
343
383
|
}
|
|
344
|
-
border = border.replace(/\*\*/g, "* ");
|
|
384
|
+
border = border.replace(/\*\*/g, "* "); // ***** => * * * in order to have similar padding to the side borders
|
|
345
385
|
const formatRow = function (row) {
|
|
346
386
|
return (_.padEnd("*", spanLength) +
|
|
347
387
|
_.padEnd(row, border.length - 2 * spanLength) +
|
|
@@ -371,12 +411,20 @@ function trimSymbol(str, symbol) {
|
|
|
371
411
|
return str;
|
|
372
412
|
}
|
|
373
413
|
function parseJson(data) {
|
|
414
|
+
// Replace BOM from the header of the file if it exists
|
|
374
415
|
return JSON.parse(data.replace(/^\uFEFF/, ""));
|
|
375
416
|
}
|
|
417
|
+
// TODO: Use generic for predicatе predicate: (element: T|T[]) when TypeScript support this.
|
|
376
418
|
async function getFuturesResults(promises, predicate) {
|
|
377
419
|
const results = await Promise.all(promises);
|
|
378
420
|
return _(results).filter(predicate).flatten().value();
|
|
379
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* Appends zeroes to a version string until it reaches a specified length.
|
|
424
|
+
* @param {string} version The version on which to append zeroes.
|
|
425
|
+
* @param requiredVersionLength The required length of the version string.
|
|
426
|
+
* @returns {string} Appended version string. In case input is null, undefined or empty string, it is returned immediately without appending anything.
|
|
427
|
+
*/
|
|
380
428
|
function appendZeroesToVersion(version, requiredVersionLength) {
|
|
381
429
|
if (version) {
|
|
382
430
|
const zeroesToAppend = requiredVersionLength - version.split(".").length;
|
|
@@ -521,6 +569,14 @@ function getProjectFilesConfig(opts) {
|
|
|
521
569
|
};
|
|
522
570
|
return projectFilesConfig;
|
|
523
571
|
}
|
|
572
|
+
/**
|
|
573
|
+
* Tries to find the process id (PID) of the specified application identifier.
|
|
574
|
+
* This is specific implementation for iOS Simulator, where the running applications are real processes.
|
|
575
|
+
* Their PIDs are printed in a specific format in the the logs, once the application is started.
|
|
576
|
+
* @param {string} applicationIdentifier Application Identifier of the app for which we try to get the PID.
|
|
577
|
+
* @param {string} logLine Line that may contain the PID of the process.
|
|
578
|
+
* @returns {string} The PID of the searched application identifier in case it's found in the current line, null otherwise.
|
|
579
|
+
*/
|
|
524
580
|
function getPidFromiOSSimulatorLogs(applicationIdentifier, logLine) {
|
|
525
581
|
if (logLine) {
|
|
526
582
|
const pidRegExp = new RegExp(`${applicationIdentifier}:\\s?(\\d+)`);
|
|
@@ -568,6 +624,7 @@ function getWinRegPropertyValue(key, propertyName) {
|
|
|
568
624
|
function stringify(value, replacer, space) {
|
|
569
625
|
return JSON.stringify(value, replacer, space || 2);
|
|
570
626
|
}
|
|
627
|
+
//2019-01-07 18:29:50.745
|
|
571
628
|
function getFixedLengthDateString() {
|
|
572
629
|
const currentDate = new Date();
|
|
573
630
|
const year = currentDate.getFullYear();
|
|
@@ -590,6 +647,28 @@ function getFormattedMilliseconds(date) {
|
|
|
590
647
|
}
|
|
591
648
|
return milliseconds;
|
|
592
649
|
}
|
|
650
|
+
//--- begin part copied from AngularJS
|
|
651
|
+
//The MIT License
|
|
652
|
+
//
|
|
653
|
+
//Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
|
|
654
|
+
//
|
|
655
|
+
//Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
656
|
+
//of this software and associated documentation files (the "Software"), to deal
|
|
657
|
+
//in the Software without restriction, including without limitation the rights
|
|
658
|
+
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
659
|
+
//copies of the Software, and to permit persons to whom the Software is
|
|
660
|
+
//furnished to do so, subject to the following conditions:
|
|
661
|
+
//
|
|
662
|
+
// The above copyright notice and this permission notice shall be included in
|
|
663
|
+
//all copies or substantial portions of the Software.
|
|
664
|
+
//
|
|
665
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
666
|
+
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
667
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
668
|
+
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
669
|
+
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
670
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
671
|
+
//THE SOFTWARE.
|
|
593
672
|
const CLASS_NAME = /class\s+([A-Z].+?)(?:\s+.*?)?\{/;
|
|
594
673
|
const CONSTRUCTOR_ARGS = /constructor\s*([^\(]*)\(\s*([^\)]*)\)/m;
|
|
595
674
|
const FN_NAME_AND_ARGS = /^(?:function)?\s*([^\(]*)\(\s*([^\)]*)\)\s*(=>)?\s*[{_]/m;
|
|
@@ -619,6 +698,11 @@ function annotate(fn) {
|
|
|
619
698
|
}
|
|
620
699
|
return $inject;
|
|
621
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* Returns true if all Android signing options are provided, false otherwise.
|
|
703
|
+
* @param {IAndroidSigningData} signingData The signing data to be validated.
|
|
704
|
+
* @return {void}
|
|
705
|
+
*/
|
|
622
706
|
function hasValidAndroidSigning(signingData) {
|
|
623
707
|
const isValid = signingData &&
|
|
624
708
|
signingData.keyStorePath &&
|
|
@@ -627,3 +711,5 @@ function hasValidAndroidSigning(signingData) {
|
|
|
627
711
|
signingData.keyStoreAliasPassword;
|
|
628
712
|
return !!isValid;
|
|
629
713
|
}
|
|
714
|
+
//--- end part copied from AngularJS
|
|
715
|
+
//# sourceMappingURL=helpers.js.map
|
package/lib/common/host-info.js
CHANGED
|
@@ -65,6 +65,9 @@ class HostInfo {
|
|
|
65
65
|
catch (err) {
|
|
66
66
|
this.$logger.trace(`Unable to get macOS version from ${systemProfileCommand}. Error is: ${err}`);
|
|
67
67
|
}
|
|
68
|
+
// https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
|
|
69
|
+
// Each macOS version is labeled 10.<version>, where it looks like <versions> is taken from the major version returned by os.release() (16.x.x for example) and subtracting 4 from it.
|
|
70
|
+
// So the version becomes "10.12" in this case.
|
|
68
71
|
const osRelease = this.$osInfo.release();
|
|
69
72
|
const majorVersion = osRelease && _.first(osRelease.split("."));
|
|
70
73
|
macOSVersion = majorVersion && `10.${+majorVersion - 4}`;
|
|
@@ -118,3 +121,4 @@ __decorate([
|
|
|
118
121
|
(0, decorators_1.cache)()
|
|
119
122
|
], HostInfo.prototype, "getMacOSVersion", null);
|
|
120
123
|
yok_1.injector.register("hostInfo", HostInfo);
|
|
124
|
+
//# sourceMappingURL=host-info.js.map
|
|
@@ -26,6 +26,9 @@ class HttpClient {
|
|
|
26
26
|
catch (err) {
|
|
27
27
|
if (err.message === HttpClient.STUCK_REQUEST_ERROR_MESSAGE ||
|
|
28
28
|
err.message === HttpClient.STUCK_RESPONSE_ERROR_MESSAGE) {
|
|
29
|
+
// Retry the request immediately because there are at least 10 seconds between the two requests.
|
|
30
|
+
// We have to retry only once the sporadically stuck requests/responses.
|
|
31
|
+
// We can add exponential backoff retry here if we decide that we need to workaround bigger network issues on the client side.
|
|
29
32
|
this.$logger.warn("%s Retrying request to %s...", err.message, options.url || options);
|
|
30
33
|
const retryResult = await this.httpRequestCore(options, proxySettings);
|
|
31
34
|
return {
|
|
@@ -51,6 +54,7 @@ class HttpClient {
|
|
|
51
54
|
await this.useProxySettings(proxySettings, cliProxySettings, options, headers, requestProto);
|
|
52
55
|
if (!headers["User-Agent"]) {
|
|
53
56
|
if (!this.defaultUserAgent) {
|
|
57
|
+
//TODO: the user agent client name is also passed explicitly during login and should be kept in sync
|
|
54
58
|
this.defaultUserAgent = `${this.$staticConfig.USER_AGENT_NAME}/${this.$staticConfig.version} (Node.js ${process.versions.node}; ${process.platform}; ${process.arch})`;
|
|
55
59
|
this.$logger.trace("User-Agent: %s", this.defaultUserAgent);
|
|
56
60
|
}
|
|
@@ -79,14 +83,19 @@ class HttpClient {
|
|
|
79
83
|
}).catch((err) => {
|
|
80
84
|
this.$logger.trace("An error occurred while sending the request:", err);
|
|
81
85
|
if (err.response) {
|
|
86
|
+
// The request was made and the server responded with a status code
|
|
87
|
+
// that falls out of the range of 2xx
|
|
82
88
|
const errorMessage = this.getErrorMessage(err.response.status, null);
|
|
83
89
|
err.proxyAuthenticationRequired =
|
|
84
90
|
err.response.status === constants_1.HttpStatusCodes.PROXY_AUTHENTICATION_REQUIRED;
|
|
85
91
|
err.message = errorMessage || err.message;
|
|
86
92
|
}
|
|
87
93
|
else if (err.request) {
|
|
94
|
+
// The request was made but no response was received
|
|
95
|
+
// `err.request` is an instance of XMLHttpRequest in the browser and an instance of
|
|
88
96
|
}
|
|
89
97
|
else {
|
|
98
|
+
// Something happened in setting up the request that triggered an Error
|
|
90
99
|
}
|
|
91
100
|
throw err;
|
|
92
101
|
});
|
|
@@ -132,8 +141,17 @@ class HttpClient {
|
|
|
132
141
|
return body;
|
|
133
142
|
}
|
|
134
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* This method respects the proxySettings (or proxyCache) by modifying headers and options passed to http(s) module.
|
|
146
|
+
* @param {IProxySettings} proxySettings The settings passed for this specific call.
|
|
147
|
+
* @param {IProxySettings} cliProxySettings The globally set proxy for this CLI.
|
|
148
|
+
* @param {any}options The object that will be passed to http(s) module.
|
|
149
|
+
* @param {any} headers Headers of the current request.
|
|
150
|
+
* @param {string} requestProto The protocol used for the current request - http or https.
|
|
151
|
+
*/
|
|
135
152
|
async useProxySettings(proxySettings, cliProxySettings, options, headers, requestProto) {
|
|
136
153
|
const isLocalRequest = options.host === "localhost" || options.host === "127.0.0.1";
|
|
154
|
+
// don't use the proxy for requests to localhost
|
|
137
155
|
if (!isLocalRequest && (proxySettings || cliProxySettings)) {
|
|
138
156
|
const proto = (proxySettings && proxySettings.protocol) ||
|
|
139
157
|
cliProxySettings.protocol ||
|
|
@@ -144,6 +162,7 @@ class HttpClient {
|
|
|
144
162
|
if (cliProxySettings.username && cliProxySettings.password) {
|
|
145
163
|
credentialsPart = `${cliProxySettings.username}:${cliProxySettings.password}@`;
|
|
146
164
|
}
|
|
165
|
+
// Note that proto ends with :
|
|
147
166
|
options.proxy = `${proto}//${credentialsPart}${host}:${port}`;
|
|
148
167
|
options.rejectUnauthorized = proxySettings
|
|
149
168
|
? proxySettings.rejectUnauthorized
|
|
@@ -156,3 +175,4 @@ exports.HttpClient = HttpClient;
|
|
|
156
175
|
HttpClient.STUCK_REQUEST_ERROR_MESSAGE = "The request can't receive any response.";
|
|
157
176
|
HttpClient.STUCK_RESPONSE_ERROR_MESSAGE = "Can't receive all parts of the response.";
|
|
158
177
|
yok_1.injector.register("httpClient", HttpClient);
|
|
178
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -15,9 +15,13 @@ function cliAppender(layout) {
|
|
|
15
15
|
return appender;
|
|
16
16
|
}
|
|
17
17
|
function configure(config, layouts) {
|
|
18
|
+
// the default layout for the appender
|
|
18
19
|
let layout = layouts.messagePassThroughLayout;
|
|
20
|
+
// check if there is another layout specified
|
|
19
21
|
if (config.layout) {
|
|
20
22
|
layout = layouts.layout(config.layout.type, config.layout);
|
|
21
23
|
}
|
|
24
|
+
// create a new appender instance
|
|
22
25
|
return cliAppender(layout);
|
|
23
26
|
}
|
|
27
|
+
//# sourceMappingURL=cli-appender.js.map
|
|
@@ -21,9 +21,13 @@ function configure(config, layouts) {
|
|
|
21
21
|
if (!config.emitter.emit || typeof config.emitter.emit !== "function") {
|
|
22
22
|
throw new Error("The passed emitter must be instance of EventEmitter");
|
|
23
23
|
}
|
|
24
|
+
// the default layout for the appender
|
|
24
25
|
let layout = layouts.messagePassThroughLayout;
|
|
26
|
+
// check if there is another layout specified
|
|
25
27
|
if (config.layout) {
|
|
26
28
|
layout = layouts.layout(config.layout.type, config.layout);
|
|
27
29
|
}
|
|
30
|
+
// create a new appender instance
|
|
28
31
|
return emitAppender(layout, config.emitter);
|
|
29
32
|
}
|
|
33
|
+
//# sourceMappingURL=emit-appender.js.map
|
|
@@ -98,9 +98,11 @@ class Logger {
|
|
|
98
98
|
if (typeof item === "string") {
|
|
99
99
|
return item;
|
|
100
100
|
}
|
|
101
|
+
// do not try to read streams, because they may not be rewindable
|
|
101
102
|
if (item instanceof stream.Readable) {
|
|
102
103
|
return "[ReadableStream]";
|
|
103
104
|
}
|
|
105
|
+
// There's no point in printing buffers
|
|
104
106
|
if (item instanceof Buffer) {
|
|
105
107
|
return "[Buffer]";
|
|
106
108
|
}
|
|
@@ -153,12 +155,14 @@ class Logger {
|
|
|
153
155
|
getLogOptionsForMessage(data) {
|
|
154
156
|
const loggerOptionKeys = _.keys(constants_1.LoggerConfigData);
|
|
155
157
|
const dataToCheck = data.filter((el) => {
|
|
158
|
+
// objects created with Object.create(null) do not have `hasOwnProperty` function
|
|
156
159
|
if (!!el &&
|
|
157
160
|
typeof el === "object" &&
|
|
158
161
|
el.hasOwnProperty &&
|
|
159
162
|
typeof el.hasOwnProperty === "function") {
|
|
160
163
|
for (const key of loggerOptionKeys) {
|
|
161
164
|
if (el.hasOwnProperty(key)) {
|
|
165
|
+
// include only the elements which have one of the keys we've specified as logger options
|
|
162
166
|
return true;
|
|
163
167
|
}
|
|
164
168
|
}
|
|
@@ -197,3 +201,4 @@ __decorate([
|
|
|
197
201
|
(0, decorators_1.cache)()
|
|
198
202
|
], Logger.prototype, "initialize", null);
|
|
199
203
|
yok_1.injector.register("logger", Logger);
|
|
204
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// automatically generated code; do not edit manually!
|
|
4
|
+
//
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Messages = void 0;
|
|
4
7
|
const yok_1 = require("../yok");
|
|
8
|
+
/* tslint:disable:all */
|
|
5
9
|
class Messages {
|
|
6
10
|
constructor() {
|
|
7
11
|
this.Devices = {
|
|
@@ -13,3 +17,5 @@ class Messages {
|
|
|
13
17
|
}
|
|
14
18
|
exports.Messages = Messages;
|
|
15
19
|
yok_1.injector.register("messages", Messages);
|
|
20
|
+
/* tslint:enable */
|
|
21
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -29,7 +29,7 @@ class AndroidApplicationManager extends application_manager_base_1.ApplicationMa
|
|
|
29
29
|
this.$deviceLogProvider = $deviceLogProvider;
|
|
30
30
|
this.$errors = $errors;
|
|
31
31
|
this.PID_CHECK_INTERVAL = 100;
|
|
32
|
-
this.PID_CHECK_TIMEOUT = 10000;
|
|
32
|
+
this.PID_CHECK_TIMEOUT = 10000; // 10 secs
|
|
33
33
|
}
|
|
34
34
|
async getInstalledApplications() {
|
|
35
35
|
const result = (await this.adb.executeShellCommand(["pm", "list", "packages"])) || "";
|
|
@@ -67,6 +67,7 @@ class AndroidApplicationManager extends application_manager_base_1.ApplicationMa
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
uninstallApplication(appIdentifier) {
|
|
70
|
+
// Need to set the treatErrorsAsWarnings to true because when using `ns run` command if the application is not installed on the device it will throw error
|
|
70
71
|
return this.adb.executeShellCommand(["pm", "uninstall", `${appIdentifier}`], { treatErrorsAsWarnings: true });
|
|
71
72
|
}
|
|
72
73
|
async startApplication(appData) {
|
|
@@ -75,9 +76,24 @@ class AndroidApplicationManager extends application_manager_base_1.ApplicationMa
|
|
|
75
76
|
`cat /dev/null > ${constants_1.LiveSyncPaths.ANDROID_TMP_DIR_NAME}/${appData.appId}-debugbreak`,
|
|
76
77
|
]);
|
|
77
78
|
}
|
|
79
|
+
// If the app is debuggable, the Runtime will update the file when its ready for debugging
|
|
80
|
+
// and we will be able to take decisions and synchronize the debug experience based on the content
|
|
78
81
|
await this.adb.executeShellCommand([
|
|
79
82
|
`cat /dev/null > ${constants_1.LiveSyncPaths.ANDROID_TMP_DIR_NAME}/${appData.appId}-debugger-started`,
|
|
80
83
|
]);
|
|
84
|
+
/*
|
|
85
|
+
Example "pm dump <app_identifier> | grep -A 1 MAIN" output"
|
|
86
|
+
android.intent.action.MAIN:
|
|
87
|
+
3b2df03 org.nativescript.cliapp/com.tns.NativeScriptActivity filter 50dd82e
|
|
88
|
+
Action: "android.intent.action.MAIN"
|
|
89
|
+
Category: "android.intent.category.LAUNCHER"
|
|
90
|
+
--
|
|
91
|
+
intent={act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.nativescript.cliapp/com.tns.NativeScriptActivity}
|
|
92
|
+
realActivity=org.nativescript.cliapp/com.tns.NativeScriptActivity
|
|
93
|
+
--
|
|
94
|
+
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.nativescript.cliapp/com.tns.NativeScriptActivity }
|
|
95
|
+
frontOfTask=true task=TaskRecord{fe592ac #449 A=org.nativescript.cliapp U=0 StackId=1 sz=1}
|
|
96
|
+
*/
|
|
81
97
|
const appIdentifier = appData.appId;
|
|
82
98
|
const pmDumpOutput = await this.adb.executeShellCommand([
|
|
83
99
|
"pm",
|
|
@@ -127,6 +143,8 @@ class AndroidApplicationManager extends application_manager_base_1.ApplicationMa
|
|
|
127
143
|
pid: processIdentifier,
|
|
128
144
|
appId: appIdentifier,
|
|
129
145
|
onAppRestarted: () => {
|
|
146
|
+
// If the app restarts, we update the PID and
|
|
147
|
+
// restart log helper.
|
|
130
148
|
this.onAppLaunch(appData);
|
|
131
149
|
},
|
|
132
150
|
});
|
|
@@ -205,3 +223,4 @@ __decorate([
|
|
|
205
223
|
__decorate([
|
|
206
224
|
(0, decorators_1.cache)()
|
|
207
225
|
], AndroidApplicationManager.prototype, "getFullyQualifiedActivityRegex", null);
|
|
226
|
+
//# sourceMappingURL=android-application-manager.js.map
|
|
@@ -38,11 +38,15 @@ class AndroidDebugBridge {
|
|
|
38
38
|
return this.$childProcess.spawn(command.command, command.args);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
// If adb -s <invalid device id> install <smth> is executed the childProcess won't get any response
|
|
42
|
+
// because the adb will be waiting for valid device and will not send close or exit event.
|
|
43
|
+
// For example `adb -s <invalid device id> install <smth>` throws error 'error: device \'030939f508e6c773\' not found\r\n' exitCode 4294967295
|
|
41
44
|
const result = await this.$childProcess.spawnFromEvent(command.command, command.args, event, childProcessOptions, { throwError: false });
|
|
42
45
|
const errors = this.$androidDebugBridgeResultHandler.checkForErrors(result);
|
|
43
46
|
if (errors && errors.length > 0) {
|
|
44
47
|
this.$androidDebugBridgeResultHandler.handleErrors(errors, treatErrorsAsWarnings);
|
|
45
48
|
}
|
|
49
|
+
// Some adb commands returns array of strings instead of object with stdout and stderr. (adb start-server)
|
|
46
50
|
return result.stdout === undefined || result.stdout === null
|
|
47
51
|
? result
|
|
48
52
|
: result.stdout;
|
|
@@ -121,6 +125,7 @@ class AndroidDebugBridge {
|
|
|
121
125
|
}
|
|
122
126
|
async pushFile(localFilePath, deviceFilePath) {
|
|
123
127
|
const fileDirectory = (0, helpers_1.fromWindowsRelativePathToUnix)(path.dirname(deviceFilePath));
|
|
128
|
+
// starting from API level 28, the push command is returning an error if the directory does not exist
|
|
124
129
|
await this.executeShellCommand(["mkdir", "-p", fileDirectory]);
|
|
125
130
|
await this.executeCommand(["push", localFilePath, deviceFilePath]);
|
|
126
131
|
await this.executeShellCommand(["chmod", "0777", fileDirectory]);
|
|
@@ -140,3 +145,4 @@ __decorate([
|
|
|
140
145
|
(0, decorators_1.invokeInit)()
|
|
141
146
|
], AndroidDebugBridge.prototype, "getDevices", null);
|
|
142
147
|
yok_1.injector.register("adb", AndroidDebugBridge);
|
|
148
|
+
//# sourceMappingURL=android-debug-bridge.js.map
|
|
@@ -74,6 +74,8 @@ class AndroidDeviceFileSystem {
|
|
|
74
74
|
return transferredFiles;
|
|
75
75
|
}
|
|
76
76
|
async transferDirectory(deviceAppData, localToDevicePaths, projectFilesPath) {
|
|
77
|
+
// starting from Android 9, adb push is throwing an exception when there are subfolders
|
|
78
|
+
// the check could be removed when we start supporting only runtime versions with sockets
|
|
77
79
|
const minAndroidWithoutAdbPushDir = "9.0.0";
|
|
78
80
|
const isAdbPushDirSupported = semver.lt(semver.coerce(deviceAppData.device.deviceInfo.version), minAndroidWithoutAdbPushDir);
|
|
79
81
|
const deviceProjectDir = await deviceAppData.getDeviceProjectRootPath();
|
|
@@ -120,6 +122,7 @@ class AndroidDeviceFileSystem {
|
|
|
120
122
|
const hostTmpDir = await this.$tempService.mkdirSync("application-");
|
|
121
123
|
const commandsFileHostPath = path.join(hostTmpDir, "temp.commands.file");
|
|
122
124
|
this.$fs.writeFile(commandsFileHostPath, fileContent);
|
|
125
|
+
// copy it to the device
|
|
123
126
|
await this.transferFile(commandsFileHostPath, deviceFilePath);
|
|
124
127
|
await this.adb.executeShellCommand(["chmod", "0777", deviceFilePath]);
|
|
125
128
|
}
|
|
@@ -141,3 +144,4 @@ class AndroidDeviceFileSystem {
|
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
exports.AndroidDeviceFileSystem = AndroidDeviceFileSystem;
|
|
147
|
+
//# sourceMappingURL=android-device-file-system.js.map
|
|
@@ -51,6 +51,8 @@ class AndroidDeviceHashService {
|
|
|
51
51
|
const action = async (localToDevicePathData) => {
|
|
52
52
|
const localPath = localToDevicePathData.getLocalPath();
|
|
53
53
|
if (this.$fs.getFsStats(localPath).isFile()) {
|
|
54
|
+
// TODO: Use relative to project path for key
|
|
55
|
+
// This will speed up livesync on the same device for the same project on different PCs.
|
|
54
56
|
initialShasums[localPath] = await this.$fs.getFileShasum(localPath);
|
|
55
57
|
}
|
|
56
58
|
};
|
|
@@ -106,3 +108,4 @@ __decorate([
|
|
|
106
108
|
__decorate([
|
|
107
109
|
(0, decorators_1.cache)()
|
|
108
110
|
], AndroidDeviceHashService.prototype, "getTempDir", null);
|
|
111
|
+
//# sourceMappingURL=android-device-hash-service.js.map
|
|
@@ -32,6 +32,8 @@ class AndroidDevice {
|
|
|
32
32
|
this.fileSystem = this.$injector.resolve(fileSystemPath.AndroidDeviceFileSystem, { adb: this.adb });
|
|
33
33
|
let details = await this.getDeviceDetails(["getprop"]);
|
|
34
34
|
if (!details || !details.name) {
|
|
35
|
+
// In older CLI versions we are calling cat /system/build.prop to get details.
|
|
36
|
+
// Keep this logic for compatibility and possibly for devices for which getprop is not working
|
|
35
37
|
details = await this.getDeviceDetails(["cat", "/system/build.prop"]);
|
|
36
38
|
}
|
|
37
39
|
this.$logger.trace(details);
|
|
@@ -88,6 +90,9 @@ class AndroidDevice {
|
|
|
88
90
|
try {
|
|
89
91
|
const details = await this.adb.executeShellCommand(shellCommandArgs);
|
|
90
92
|
details.split(/\r?\n|\r/).forEach((value) => {
|
|
93
|
+
// sample line is "ro.build.version.release=4.4" in /system/build.prop
|
|
94
|
+
// sample line from getprop is: [ro.build.version.release]: [6.0]
|
|
95
|
+
// NOTE: some props do not have value: [ro.build.version.base_os]: []
|
|
91
96
|
const match = /(?:\[?ro\.build\.version|ro\.product|ro\.build)\.(.+?)]?(?:\:|=)(?:\s*?\[)?(.*?)]?$/.exec(value);
|
|
92
97
|
if (match) {
|
|
93
98
|
parsedDetails[match[1]] = match[2];
|
|
@@ -101,6 +106,7 @@ class AndroidDevice {
|
|
|
101
106
|
return parsedDetails;
|
|
102
107
|
}
|
|
103
108
|
getIsTablet(details) {
|
|
109
|
+
//version 3.x.x (also known as Honeycomb) is a tablet only version
|
|
104
110
|
return (details &&
|
|
105
111
|
(_.startsWith(details.release, "3.") ||
|
|
106
112
|
_.includes((details.characteristics || "").toLowerCase(), "tablet")));
|
|
@@ -114,6 +120,7 @@ class AndroidDevice {
|
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
exports.AndroidDevice = AndroidDevice;
|
|
123
|
+
// http://stackoverflow.com/questions/31178195/what-does-adb-device-status-mean
|
|
117
124
|
AndroidDevice.ADB_DEVICE_STATUS_INFO = {
|
|
118
125
|
device: {
|
|
119
126
|
errorHelp: null,
|
|
@@ -139,3 +146,4 @@ AndroidDevice.ADB_DEVICE_STATUS_INFO = {
|
|
|
139
146
|
__decorate([
|
|
140
147
|
(0, decorators_1.cache)()
|
|
141
148
|
], AndroidDevice.prototype, "init", null);
|
|
149
|
+
//# sourceMappingURL=android-device.js.map
|
|
@@ -103,7 +103,7 @@ class AndroidEmulatorServices {
|
|
|
103
103
|
endTimeEpoch,
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
await (0, helpers_1.sleep)(10000);
|
|
106
|
+
await (0, helpers_1.sleep)(10000); // the emulator definitely takes its time to wake up
|
|
107
107
|
hasTimeLeft = (0, helpers_1.getCurrentEpochTime)() < endTimeEpoch;
|
|
108
108
|
}
|
|
109
109
|
if (!hasTimeLeft && !isInfiniteWait) {
|
|
@@ -180,3 +180,4 @@ class AndroidEmulatorServices {
|
|
|
180
180
|
}
|
|
181
181
|
exports.AndroidEmulatorServices = AndroidEmulatorServices;
|
|
182
182
|
yok_1.injector.register("androidEmulatorServices", AndroidEmulatorServices);
|
|
183
|
+
//# sourceMappingURL=android-emulator-services.js.map
|
|
@@ -12,6 +12,8 @@ class AndroidIniFileParser {
|
|
|
12
12
|
if (!this.$fs.exists(iniFilePath)) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
+
// avd files can have different encoding, defined on the first line.
|
|
16
|
+
// find which one it is (if any) and use it to correctly read the file contents
|
|
15
17
|
const encoding = this.getAvdEncoding(iniFilePath);
|
|
16
18
|
const contents = this.$fs.readText(iniFilePath, encoding).split("\n");
|
|
17
19
|
return _.reduce(contents, (result, line) => {
|
|
@@ -44,6 +46,8 @@ class AndroidIniFileParser {
|
|
|
44
46
|
}, Object.create(null));
|
|
45
47
|
}
|
|
46
48
|
getAvdEncoding(avdName) {
|
|
49
|
+
// avd files can have different encoding, defined on the first line.
|
|
50
|
+
// find which one it is (if any) and use it to correctly read the file contents
|
|
47
51
|
let encoding = "utf8";
|
|
48
52
|
let contents = this.$fs.readText(avdName, "ascii");
|
|
49
53
|
if (contents.length > 0) {
|
|
@@ -57,18 +61,22 @@ class AndroidIniFileParser {
|
|
|
57
61
|
}
|
|
58
62
|
return encoding;
|
|
59
63
|
}
|
|
64
|
+
// Android L is not written as a number in the .ini files, and we need to convert it
|
|
60
65
|
readTargetNum(target) {
|
|
61
66
|
const platform = target.replace("android-", "");
|
|
62
67
|
let platformNumber = +platform;
|
|
63
68
|
if (isNaN(platformNumber)) {
|
|
69
|
+
// this may be a google image
|
|
64
70
|
const googlePlatform = target.split(":")[2];
|
|
65
71
|
if (googlePlatform) {
|
|
66
72
|
platformNumber = +googlePlatform;
|
|
67
73
|
}
|
|
68
74
|
else if (platform === "L") {
|
|
75
|
+
// Android SDK 20 preview
|
|
69
76
|
platformNumber = 20;
|
|
70
77
|
}
|
|
71
78
|
else if (platform === "MNC") {
|
|
79
|
+
// Android M preview
|
|
72
80
|
platformNumber = 22;
|
|
73
81
|
}
|
|
74
82
|
}
|
|
@@ -77,3 +85,4 @@ class AndroidIniFileParser {
|
|
|
77
85
|
}
|
|
78
86
|
exports.AndroidIniFileParser = AndroidIniFileParser;
|
|
79
87
|
yok_1.injector.register("androidIniFileParser", AndroidIniFileParser);
|
|
88
|
+
//# sourceMappingURL=android-ini-file-parser.js.map
|
|
@@ -37,6 +37,10 @@ class AndroidLogFilter {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.AndroidLogFilter = AndroidLogFilter;
|
|
40
|
+
//sample line is "I/Web Console( 4438): Received Event: deviceready at file:///storage/emulated/0/Icenium/com.telerik.TestApp/js/index.js:48"
|
|
40
41
|
AndroidLogFilter.LINE_REGEX = /.\/(.+?)\s*\(\s*\d+?\): (.*)/;
|
|
42
|
+
// sample line is "11-23 12:39:07.310 1584 1597 I art : Background sticky concurrent mark sweep GC freed 21966(1780KB) AllocSpace objects, 4(80KB) LOS objects, 77% free, 840KB/3MB, paused 4.018ms total 158.629ms"
|
|
43
|
+
// or '12-28 10:45:08.020 3329 3329 W chromium: [WARNING:data_reduction_proxy_settings.cc(328)] SPDY proxy OFF at startup'
|
|
41
44
|
AndroidLogFilter.API_LEVEL_23_LINE_REGEX = /.+?\s+?(?:[A-Z]\s+?)([A-Za-z \.]+?)\s*?\: (.*)/;
|
|
42
45
|
yok_1.injector.register("androidLogFilter", AndroidLogFilter);
|
|
46
|
+
//# sourceMappingURL=android-log-filter.js.map
|