nativescript 8.7.2 → 8.8.0-embed.0
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 +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- package/lib/commands/add-platform.js +1 -2
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +0 -4
- package/lib/commands/build.js +2 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -3
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +1 -6
- package/lib/commands/deploy.js +2 -3
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +2 -12
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +2 -3
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +2 -9
- package/lib/commands/typings.js +1 -2
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +2 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +1 -20
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +3 -91
- package/lib/controllers/platform-controller.js +1 -9
- package/lib/controllers/prepare-controller.js +10 -17
- package/lib/controllers/run-controller.js +1 -17
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +2 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +1 -1
- package/lib/data/run-data.js +0 -1
- package/lib/declarations.d.ts +12 -2
- package/lib/definitions/platform.d.ts +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +17 -10
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +2 -3
- package/lib/key-commands/index.js +4 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -10
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +123 -141
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +1 -2
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +0 -3
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +12 -34
- package/lib/services/android-project-service.js +22 -86
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
- package/lib/services/assets-generation/assets-generation-service.js +13 -17
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/cleanup-service.js +9 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +3 -3
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +1 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +0 -4
- package/lib/services/ios/spm-service.js +0 -9
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- package/lib/services/ios/xcodebuild-service.js +0 -1
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +4 -6
- package/lib/services/ios-project-service.js +24 -26
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -7
- package/lib/services/livesync/android-livesync-service.js +2 -3
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +2 -4
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +4 -8
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +3 -17
- package/lib/services/marking-mode-service.js +5 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +1 -3
- package/lib/services/platform/add-platform-service.js +9 -48
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +8 -8
- package/lib/services/platform-environment-requirements.js +6 -9
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +9 -19
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +11 -13
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +1 -18
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -1
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +2 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/webpack/webpack-compiler-service.js +15 -48
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +12 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- package/package.json +2 -2
- package/vendor/gradle-plugin/build.gradle +21 -6
- package/vendor/gradle-plugin/settings.gradle +13 -3
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +0 -15
- package/node_modules/rimraf/CHANGELOG.md +0 -65
- package/node_modules/stringify-package/CHANGELOG.md +0 -16
|
@@ -9,8 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
// NOTE: This file is used to track data in a separate process.
|
|
13
|
-
// The instances here are not shared with the ones in main CLI process.
|
|
14
12
|
const fs = require("fs");
|
|
15
13
|
const analytics_broker_1 = require("./analytics-broker");
|
|
16
14
|
const file_log_service_1 = require("../../detached-processes/file-log-service");
|
|
@@ -20,7 +18,6 @@ if (!pathToBootstrap || !fs.existsSync(pathToBootstrap)) {
|
|
|
20
18
|
throw new Error("Invalid path to bootstrap.");
|
|
21
19
|
}
|
|
22
20
|
const logFile = process.argv[3];
|
|
23
|
-
// After requiring the bootstrap we can use $injector
|
|
24
21
|
require(pathToBootstrap);
|
|
25
22
|
const analyticsLoggingService = yok_1.injector.resolve(file_log_service_1.FileLogService, { logFile });
|
|
26
23
|
analyticsLoggingService.logData({ message: "Initializing AnalyticsBroker." });
|
|
@@ -50,15 +47,15 @@ process.on("message", (data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
50
47
|
analyticsLoggingService.logData({
|
|
51
48
|
message: `analytics-broker-process received message of type: ${JSON.stringify(data)}`,
|
|
52
49
|
});
|
|
53
|
-
if (data.type === "FinishTracking"
|
|
50
|
+
if (data.type === "FinishTracking") {
|
|
54
51
|
yield finishTracking();
|
|
55
52
|
if (process.connected) {
|
|
56
53
|
analyticsLoggingService.logData({
|
|
57
|
-
message: `analytics-broker-process will send ${"ProcessFinishedTasks"
|
|
54
|
+
message: `analytics-broker-process will send ${"ProcessFinishedTasks"} message`,
|
|
58
55
|
});
|
|
59
|
-
process.send("ProcessFinishedTasks"
|
|
56
|
+
process.send("ProcessFinishedTasks", () => {
|
|
60
57
|
analyticsLoggingService.logData({
|
|
61
|
-
message: `analytics-broker-process sent ${"ProcessFinishedTasks"
|
|
58
|
+
message: `analytics-broker-process sent ${"ProcessFinishedTasks"} message and will exit gracefully now`,
|
|
62
59
|
});
|
|
63
60
|
killCurrentProcessGracefully();
|
|
64
61
|
});
|
|
@@ -75,7 +72,6 @@ process.on("disconnect", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
75
72
|
killCurrentProcessGracefully();
|
|
76
73
|
}));
|
|
77
74
|
analyticsLoggingService.logData({
|
|
78
|
-
message: `analytics-broker-process will send ${"ProcessReadyToReceive"
|
|
75
|
+
message: `analytics-broker-process will send ${"ProcessReadyToReceive"} message`,
|
|
79
76
|
});
|
|
80
|
-
process.send("ProcessReadyToReceive"
|
|
81
|
-
//# sourceMappingURL=analytics-broker-process.js.map
|
|
77
|
+
process.send("ProcessReadyToReceive");
|
|
@@ -41,7 +41,7 @@ class AnalyticsBroker {
|
|
|
41
41
|
catch (err) {
|
|
42
42
|
this.analyticsLoggingService.logData({
|
|
43
43
|
message: `AnalyticsBroker unable to execute action in sendDataForTracking: ${err}`,
|
|
44
|
-
type: "Error"
|
|
44
|
+
type: "Error",
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
});
|
|
@@ -51,4 +51,3 @@ __decorate([
|
|
|
51
51
|
(0, decorators_1.cache)()
|
|
52
52
|
], AnalyticsBroker.prototype, "getGoogleAnalyticsProvider", null);
|
|
53
53
|
exports.AnalyticsBroker = AnalyticsBroker;
|
|
54
|
-
//# sourceMappingURL=analytics-broker.js.map
|
|
@@ -44,7 +44,7 @@ class AnalyticsService {
|
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
if (yield this.$analyticsSettingsService.canDoRequest()) {
|
|
46
46
|
const initialTrackFeatureUsageStatus = yield this.getStatus(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME);
|
|
47
|
-
let trackFeatureUsage = initialTrackFeatureUsageStatus === "enabled"
|
|
47
|
+
let trackFeatureUsage = initialTrackFeatureUsageStatus === "enabled";
|
|
48
48
|
if ((yield this.isNotConfirmed(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME)) &&
|
|
49
49
|
(0, helpers_1.isInteractive)()) {
|
|
50
50
|
const message = `Do you want to help us improve ${this.$analyticsSettingsService.getClientName()} by automatically sending anonymous usage statistics? We will not use this information to identify or contact you.`;
|
|
@@ -65,15 +65,15 @@ class AnalyticsService {
|
|
|
65
65
|
setStatus(settingName, enabled) {
|
|
66
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
67
|
this.analyticsStatuses[settingName] = enabled
|
|
68
|
-
? "enabled"
|
|
69
|
-
: "disabled"
|
|
68
|
+
? "enabled"
|
|
69
|
+
: "disabled";
|
|
70
70
|
yield this.$userSettingsService.saveSetting(settingName, enabled.toString());
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
isEnabled(settingName) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
const analyticsStatus = yield this.getStatus(settingName);
|
|
76
|
-
return analyticsStatus === "enabled"
|
|
76
|
+
return analyticsStatus === "enabled";
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
getStatusMessage(settingName, jsonFormat, readableSettingName) {
|
|
@@ -86,8 +86,8 @@ class AnalyticsService {
|
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
const acceptTracking = !!(settings && settings.acceptTrackFeatureUsage);
|
|
88
88
|
const googleAnalyticsEventData = {
|
|
89
|
-
googleAnalyticsDataType: "event"
|
|
90
|
-
action: "Accept Tracking"
|
|
89
|
+
googleAnalyticsDataType: "event",
|
|
90
|
+
action: "Accept Tracking",
|
|
91
91
|
label: acceptTracking.toString(),
|
|
92
92
|
};
|
|
93
93
|
yield this.forcefullyTrackInGoogleAnalytics(googleAnalyticsEventData);
|
|
@@ -97,7 +97,7 @@ class AnalyticsService {
|
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
98
|
yield this.initAnalyticsStatuses();
|
|
99
99
|
if (!this.$staticConfig.disableAnalytics &&
|
|
100
|
-
this.analyticsStatuses[this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME] === "enabled"
|
|
100
|
+
this.analyticsStatuses[this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME] === "enabled") {
|
|
101
101
|
return this.forcefullyTrackInGoogleAnalytics(gaSettings);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -112,8 +112,6 @@ class AnalyticsService {
|
|
|
112
112
|
const isForDevice = device ? !device.isEmulator : data.isForDevice;
|
|
113
113
|
let label = "";
|
|
114
114
|
label = this.addDataToLabel(label, normalizedPlatform);
|
|
115
|
-
// In some cases (like in case action is Build and platform is Android), we do not know if the deviceType is emulator or device.
|
|
116
|
-
// Just exclude the device_type in this case.
|
|
117
115
|
if (isForDevice !== null && isForDevice !== undefined) {
|
|
118
116
|
const deviceType = isForDevice
|
|
119
117
|
? constants_1.DeviceTypes.Device
|
|
@@ -131,7 +129,7 @@ class AnalyticsService {
|
|
|
131
129
|
const customDimensions = {};
|
|
132
130
|
this.setProjectRelatedCustomDimensions(customDimensions, data.projectDir);
|
|
133
131
|
const googleAnalyticsEventData = {
|
|
134
|
-
googleAnalyticsDataType: "event"
|
|
132
|
+
googleAnalyticsDataType: "event",
|
|
135
133
|
action: data.action,
|
|
136
134
|
label,
|
|
137
135
|
customDimensions,
|
|
@@ -146,7 +144,7 @@ class AnalyticsService {
|
|
|
146
144
|
if (this.brokerProcess && this.brokerProcess.connected) {
|
|
147
145
|
let timer;
|
|
148
146
|
const handler = (data) => {
|
|
149
|
-
if (data === "ProcessFinishedTasks"
|
|
147
|
+
if (data === "ProcessFinishedTasks") {
|
|
150
148
|
this.brokerProcess.removeListener("message", handler);
|
|
151
149
|
clearTimeout(timer);
|
|
152
150
|
resolve();
|
|
@@ -157,7 +155,7 @@ class AnalyticsService {
|
|
|
157
155
|
resolve();
|
|
158
156
|
}, 3000);
|
|
159
157
|
this.brokerProcess.on("message", handler);
|
|
160
|
-
const msg = { type: "FinishTracking"
|
|
158
|
+
const msg = { type: "FinishTracking" };
|
|
161
159
|
this.brokerProcess.send(msg, (err) => this.$logger.trace(`Error while sending ${JSON.stringify(msg)}`));
|
|
162
160
|
}
|
|
163
161
|
else {
|
|
@@ -168,13 +166,13 @@ class AnalyticsService {
|
|
|
168
166
|
}
|
|
169
167
|
forcefullyTrackInGoogleAnalytics(gaSettings) {
|
|
170
168
|
gaSettings.customDimensions = gaSettings.customDimensions || {};
|
|
171
|
-
gaSettings.customDimensions["cd5"
|
|
169
|
+
gaSettings.customDimensions["cd5"] =
|
|
172
170
|
this.$options.analyticsClient ||
|
|
173
|
-
((0, helpers_1.isInteractive)() ? "CLI"
|
|
171
|
+
((0, helpers_1.isInteractive)() ? "CLI" : "Unknown");
|
|
174
172
|
this.setProjectRelatedCustomDimensions(gaSettings.customDimensions);
|
|
175
173
|
const googleAnalyticsData = _.merge({
|
|
176
|
-
type: "googleAnalyticsData"
|
|
177
|
-
category: "CLI"
|
|
174
|
+
type: "googleAnalyticsData",
|
|
175
|
+
category: "CLI",
|
|
178
176
|
}, gaSettings);
|
|
179
177
|
this.$logger.trace("Will send the following information to Google Analytics:", googleAnalyticsData);
|
|
180
178
|
return this.sendMessageToBroker(googleAnalyticsData);
|
|
@@ -185,15 +183,14 @@ class AnalyticsService {
|
|
|
185
183
|
projectDir = this.$projectHelper.projectDir;
|
|
186
184
|
}
|
|
187
185
|
catch (err) {
|
|
188
|
-
// In case there's no project dir here, the above getter will fail.
|
|
189
186
|
this.$logger.trace("Unable to get the projectDir from projectHelper", err);
|
|
190
187
|
}
|
|
191
188
|
}
|
|
192
189
|
if (projectDir) {
|
|
193
190
|
const projectData = this.$projectDataService.getProjectData(projectDir);
|
|
194
|
-
customDimensions["cd2"
|
|
191
|
+
customDimensions["cd2"] =
|
|
195
192
|
projectData.projectType;
|
|
196
|
-
customDimensions["cd9"
|
|
193
|
+
customDimensions["cd9"] = projectData.isShared.toString();
|
|
197
194
|
}
|
|
198
195
|
return customDimensions;
|
|
199
196
|
}
|
|
@@ -230,7 +227,7 @@ class AnalyticsService {
|
|
|
230
227
|
}
|
|
231
228
|
});
|
|
232
229
|
broker.on("message", (data) => {
|
|
233
|
-
if (data === "ProcessReadyToReceive"
|
|
230
|
+
if (data === "ProcessReadyToReceive") {
|
|
234
231
|
clearTimeout(timeoutId);
|
|
235
232
|
if (!isSettled) {
|
|
236
233
|
isSettled = true;
|
|
@@ -255,7 +252,7 @@ class AnalyticsService {
|
|
|
255
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
253
|
yield this.initAnalyticsStatuses();
|
|
257
254
|
if (!this.$staticConfig.disableAnalytics &&
|
|
258
|
-
this.analyticsStatuses[settingName] === "enabled"
|
|
255
|
+
this.analyticsStatuses[settingName] === "enabled") {
|
|
259
256
|
return this.sendMessageToBroker(trackingInfo);
|
|
260
257
|
}
|
|
261
258
|
});
|
|
@@ -309,14 +306,14 @@ class AnalyticsService {
|
|
|
309
306
|
if (settingValue) {
|
|
310
307
|
const isEnabled = (0, helpers_1.toBoolean)(settingValue);
|
|
311
308
|
if (isEnabled) {
|
|
312
|
-
this.analyticsStatuses[settingName] = "enabled"
|
|
309
|
+
this.analyticsStatuses[settingName] = "enabled";
|
|
313
310
|
}
|
|
314
311
|
else {
|
|
315
|
-
this.analyticsStatuses[settingName] = "disabled"
|
|
312
|
+
this.analyticsStatuses[settingName] = "disabled";
|
|
316
313
|
}
|
|
317
314
|
}
|
|
318
315
|
else {
|
|
319
|
-
this.analyticsStatuses[settingName] = "not confirmed"
|
|
316
|
+
this.analyticsStatuses[settingName] = "not confirmed";
|
|
320
317
|
}
|
|
321
318
|
}
|
|
322
319
|
return this.analyticsStatuses[settingName];
|
|
@@ -325,7 +322,7 @@ class AnalyticsService {
|
|
|
325
322
|
isNotConfirmed(settingName) {
|
|
326
323
|
return __awaiter(this, void 0, void 0, function* () {
|
|
327
324
|
const analyticsStatus = yield this.getStatus(settingName);
|
|
328
|
-
return analyticsStatus === "not confirmed"
|
|
325
|
+
return analyticsStatus === "not confirmed";
|
|
329
326
|
});
|
|
330
327
|
}
|
|
331
328
|
getHumanReadableStatusMessage(settingName, readableSettingName) {
|
|
@@ -343,15 +340,15 @@ class AnalyticsService {
|
|
|
343
340
|
getJsonStatusMessage(settingName) {
|
|
344
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
345
342
|
const status = yield this.getStatus(settingName);
|
|
346
|
-
const enabled = status === "not confirmed"
|
|
343
|
+
const enabled = status === "not confirmed"
|
|
347
344
|
? null
|
|
348
|
-
: status === "enabled"
|
|
345
|
+
: status === "enabled";
|
|
349
346
|
return JSON.stringify({ enabled });
|
|
350
347
|
});
|
|
351
348
|
}
|
|
352
349
|
trackException(exception, message) {
|
|
353
350
|
const data = {
|
|
354
|
-
type: "exception"
|
|
351
|
+
type: "exception",
|
|
355
352
|
exception,
|
|
356
353
|
message,
|
|
357
354
|
};
|
|
@@ -367,4 +364,3 @@ __decorate([
|
|
|
367
364
|
], AnalyticsService.prototype, "initAnalyticsStatuses", null);
|
|
368
365
|
exports.AnalyticsService = AnalyticsService;
|
|
369
366
|
yok_1.injector.register("analyticsService", AnalyticsService);
|
|
370
|
-
//# sourceMappingURL=analytics-service.js.map
|
|
@@ -39,7 +39,7 @@ class GoogleAnalyticsProvider {
|
|
|
39
39
|
}
|
|
40
40
|
catch (e) {
|
|
41
41
|
this.analyticsLoggingService.logData({
|
|
42
|
-
type: "Error"
|
|
42
|
+
type: "Error",
|
|
43
43
|
message: `Unable to track information ${JSON.stringify(trackInfo)}. Error is: ${e}`,
|
|
44
44
|
});
|
|
45
45
|
this.$logger.trace("Analytics exception: ", e);
|
|
@@ -73,10 +73,10 @@ class GoogleAnalyticsProvider {
|
|
|
73
73
|
const visitor = this.getVisitor(gaTrackingId, proxy);
|
|
74
74
|
yield this.setCustomDimensions(visitor, trackInfo.customDimensions, sessionId);
|
|
75
75
|
switch (trackInfo.googleAnalyticsDataType) {
|
|
76
|
-
case "pageview"
|
|
76
|
+
case "pageview":
|
|
77
77
|
yield this.trackPageView(visitor, trackInfo);
|
|
78
78
|
break;
|
|
79
|
-
case "event"
|
|
79
|
+
case "event":
|
|
80
80
|
yield this.trackEvent(visitor, trackInfo);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
@@ -85,13 +85,13 @@ class GoogleAnalyticsProvider {
|
|
|
85
85
|
setCustomDimensions(visitor, customDimensions, sessionId) {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
const defaultValues = {
|
|
88
|
-
["cd1"
|
|
89
|
-
["cd6"
|
|
90
|
-
["cd3"
|
|
91
|
-
["cd2"
|
|
92
|
-
["cd9"
|
|
93
|
-
["cd4"
|
|
94
|
-
["cd5"
|
|
88
|
+
["cd1"]: this.$staticConfig.version,
|
|
89
|
+
["cd6"]: process.version,
|
|
90
|
+
["cd3"]: this.clientId,
|
|
91
|
+
["cd2"]: null,
|
|
92
|
+
["cd9"]: null,
|
|
93
|
+
["cd4"]: sessionId,
|
|
94
|
+
["cd5"]: "Unknown",
|
|
95
95
|
};
|
|
96
96
|
customDimensions = _.merge(defaultValues, customDimensions);
|
|
97
97
|
_.each(customDimensions, (value, key) => {
|
|
@@ -109,7 +109,7 @@ class GoogleAnalyticsProvider {
|
|
|
109
109
|
this.analyticsLoggingService.logData({
|
|
110
110
|
message: `Unable to track event with category: '${trackInfo.category}', action: '${trackInfo.action}', label: '${trackInfo.label}', ` +
|
|
111
111
|
`value: '${trackInfo.value}' attached page: ${this.currentPage}. Error is: ${err}.`,
|
|
112
|
-
type: "Error"
|
|
112
|
+
type: "Error",
|
|
113
113
|
});
|
|
114
114
|
reject(err);
|
|
115
115
|
return;
|
|
@@ -132,7 +132,7 @@ class GoogleAnalyticsProvider {
|
|
|
132
132
|
if (err) {
|
|
133
133
|
this.analyticsLoggingService.logData({
|
|
134
134
|
message: `Unable to track pageview with path '${trackInfo.path}' and title: '${trackInfo.title}' Error is: ${err}.`,
|
|
135
|
-
type: "Error"
|
|
135
|
+
type: "Error",
|
|
136
136
|
});
|
|
137
137
|
reject(err);
|
|
138
138
|
return;
|
|
@@ -150,4 +150,3 @@ __decorate([
|
|
|
150
150
|
], GoogleAnalyticsProvider.prototype, "getVisitor", null);
|
|
151
151
|
exports.GoogleAnalyticsProvider = GoogleAnalyticsProvider;
|
|
152
152
|
yok_1.injector.register("googleAnalyticsProvider", GoogleAnalyticsProvider);
|
|
153
|
-
//# sourceMappingURL=google-analytics-provider.js.map
|
|
@@ -76,10 +76,6 @@ class AnalyticsSettingsService {
|
|
|
76
76
|
return userAgent;
|
|
77
77
|
}
|
|
78
78
|
getMacOSReleaseVersion(osRelease) {
|
|
79
|
-
// https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
|
|
80
|
-
// 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.
|
|
81
|
-
// So the version becomes "10.12" in this case.
|
|
82
|
-
// Could be improved by spawning `system_profiler SPSoftwareDataType` and getting the System Version line from the result.
|
|
83
79
|
const majorVersion = osRelease && _.first(osRelease.split("."));
|
|
84
80
|
return majorVersion && `10.${+majorVersion - 4}`;
|
|
85
81
|
}
|
|
@@ -106,4 +102,3 @@ __decorate([
|
|
|
106
102
|
(0, decorators_1.exported)("analyticsSettingsService")
|
|
107
103
|
], AnalyticsSettingsService.prototype, "getUserAgentString", null);
|
|
108
104
|
yok_1.injector.register("analyticsSettingsService", AnalyticsSettingsService);
|
|
109
|
-
//# sourceMappingURL=analytics-settings-service.js.map
|
|
@@ -29,7 +29,6 @@ class GradleBuildArgsService {
|
|
|
29
29
|
if (yield this.$analyticsService.isEnabled(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME)) {
|
|
30
30
|
args.push("-PgatherAnalyticsData=true");
|
|
31
31
|
}
|
|
32
|
-
// allow modifying gradle args from a `before-build-task-args` hook
|
|
33
32
|
yield this.$hooksService.executeBeforeHooks("build-task-args", {
|
|
34
33
|
hookArgs: { args },
|
|
35
34
|
});
|
|
@@ -46,7 +45,6 @@ class GradleBuildArgsService {
|
|
|
46
45
|
const toolsInfo = this.$androidToolsInfo.getToolsInfo({
|
|
47
46
|
projectDir: buildData.projectDir,
|
|
48
47
|
});
|
|
49
|
-
// ensure we initialize project data
|
|
50
48
|
this.$projectData.initializeProjectData(buildData.projectDir);
|
|
51
49
|
args.push(`-PcompileSdk=android-${toolsInfo.compileSdkVersion}`, `-PtargetSdk=${toolsInfo.targetSdkVersion}`, `-PbuildToolsVersion=${toolsInfo.buildToolsVersion}`, `-PgenerateTypings=${toolsInfo.generateTypings}`, `-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`);
|
|
52
50
|
if (buildData.gradleArgs) {
|
|
@@ -78,4 +76,3 @@ class GradleBuildArgsService {
|
|
|
78
76
|
}
|
|
79
77
|
exports.GradleBuildArgsService = GradleBuildArgsService;
|
|
80
78
|
yok_1.injector.register("gradleBuildArgsService", GradleBuildArgsService);
|
|
81
|
-
//# sourceMappingURL=gradle-build-args-service.js.map
|
|
@@ -43,7 +43,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
|
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
this._packageName = debugData.applicationIdentifier;
|
|
45
45
|
const result = yield this.debugCore(debugData.applicationIdentifier, debugOptions);
|
|
46
|
-
// TODO: extract this logic outside the debug service
|
|
47
46
|
if (debugOptions.start && !debugOptions.justlaunch) {
|
|
48
47
|
const pid = yield this.$androidProcessService.getAppProcessId(this.deviceIdentifier, debugData.applicationIdentifier);
|
|
49
48
|
if (pid) {
|
|
@@ -69,7 +68,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
|
|
|
69
68
|
]);
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
|
-
// TODO: Remove this method and reuse logic from androidProcessService
|
|
73
71
|
getForwardedDebugPort(deviceId, packageName) {
|
|
74
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
73
|
let port = -1;
|
|
@@ -78,7 +76,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
|
|
|
78
76
|
"--list",
|
|
79
77
|
]);
|
|
80
78
|
const unixSocketName = `${packageName}-inspectorServer`;
|
|
81
|
-
//matches 123a188909e6czzc tcp:40001 localabstract:org.nativescript.testUnixSockets-debug
|
|
82
79
|
const regexp = new RegExp(`(?:${deviceId} tcp:)([\\d]+)(?= localabstract:${unixSocketName})`, "g");
|
|
83
80
|
const match = regexp.exec(forwardsResult);
|
|
84
81
|
if (match) {
|
|
@@ -95,7 +92,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
|
|
|
95
92
|
return port;
|
|
96
93
|
});
|
|
97
94
|
}
|
|
98
|
-
// TODO: Remove this method and reuse logic from androidProcessService
|
|
99
95
|
unixSocketForward(local, remote) {
|
|
100
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
97
|
yield this.device.adb.executeCommand([
|
|
@@ -127,7 +123,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
|
|
|
127
123
|
this.$logger.info("device: " + deviceId + " debug port: " + port + "\n");
|
|
128
124
|
});
|
|
129
125
|
}
|
|
130
|
-
// TODO: extract this logic outside the debug service
|
|
131
126
|
validateRunningApp(deviceId, packageName) {
|
|
132
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
128
|
if (!(yield this.isAppRunning(packageName, deviceId))) {
|
|
@@ -176,4 +171,3 @@ __decorate([
|
|
|
176
171
|
], AndroidDeviceDebugService.prototype, "debugCore", null);
|
|
177
172
|
exports.AndroidDeviceDebugService = AndroidDeviceDebugService;
|
|
178
173
|
yok_1.injector.register("androidDeviceDebugService", AndroidDeviceDebugService, false);
|
|
179
|
-
//# sourceMappingURL=android-device-debug-service.js.map
|
|
@@ -23,14 +23,16 @@ const xml2js_1 = require("xml2js");
|
|
|
23
23
|
const yok_1 = require("../common/yok");
|
|
24
24
|
const _ = require("lodash");
|
|
25
25
|
const resolve_package_path_1 = require("@rigor789/resolve-package-path");
|
|
26
|
+
const process_1 = require("process");
|
|
26
27
|
class AndroidPluginBuildService {
|
|
27
28
|
get $platformsDataService() {
|
|
28
29
|
return this.$injector.resolve("platformsDataService");
|
|
29
30
|
}
|
|
30
|
-
constructor($fs, $childProcess, $hostInfo, $androidToolsInfo, $logger, $packageManager, $projectData, $projectDataService, $devicePlatformsConstants, $errors, $filesHashService, $hooksService, $injector, $watchIgnoreListService) {
|
|
31
|
+
constructor($fs, $childProcess, $hostInfo, $options, $androidToolsInfo, $logger, $packageManager, $projectData, $projectDataService, $devicePlatformsConstants, $errors, $filesHashService, $hooksService, $injector, $watchIgnoreListService) {
|
|
31
32
|
this.$fs = $fs;
|
|
32
33
|
this.$childProcess = $childProcess;
|
|
33
34
|
this.$hostInfo = $hostInfo;
|
|
35
|
+
this.$options = $options;
|
|
34
36
|
this.$androidToolsInfo = $androidToolsInfo;
|
|
35
37
|
this.$logger = $logger;
|
|
36
38
|
this.$packageManager = $packageManager;
|
|
@@ -63,15 +65,12 @@ class AndroidPluginBuildService {
|
|
|
63
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
66
|
let xml = yield this.getXml(oldManifestContent);
|
|
65
67
|
let packageName = defaultPackageName;
|
|
66
|
-
// if the manifest file is full-featured and declares settings inside the manifest scope
|
|
67
68
|
if (xml["manifest"]) {
|
|
68
69
|
if (xml["manifest"]["$"]["package"]) {
|
|
69
70
|
packageName = xml["manifest"]["$"]["package"];
|
|
70
71
|
}
|
|
71
|
-
// set the xml as the value to iterate over its properties
|
|
72
72
|
xml = xml["manifest"];
|
|
73
73
|
}
|
|
74
|
-
// if the manifest file doesn't have a <manifest> scope, only the first setting will be picked up
|
|
75
74
|
const newManifest = { manifest: {} };
|
|
76
75
|
for (const prop in xml) {
|
|
77
76
|
newManifest.manifest[prop] = xml[prop];
|
|
@@ -147,14 +146,6 @@ class AndroidPluginBuildService {
|
|
|
147
146
|
}
|
|
148
147
|
return result;
|
|
149
148
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Returns whether the build has completed or not
|
|
152
|
-
* @param {Object} options
|
|
153
|
-
* @param {string} options.pluginName - The name of the plugin. E.g. 'nativescript-barcodescanner'
|
|
154
|
-
* @param {string} options.platformsAndroidDirPath - The path to the 'plugin/src/platforms/android' directory.
|
|
155
|
-
* @param {string} options.aarOutputDir - The path where the aar should be copied after a successful build.
|
|
156
|
-
* @param {string} options.tempPluginDirPath - The path where the android plugin will be built.
|
|
157
|
-
*/
|
|
158
149
|
buildAar(options) {
|
|
159
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
151
|
this.validateOptions(options);
|
|
@@ -192,7 +183,6 @@ class AndroidPluginBuildService {
|
|
|
192
183
|
});
|
|
193
184
|
}
|
|
194
185
|
cleanPluginDir(pluginTempDir) {
|
|
195
|
-
// In case plugin was already built in the current process, we need to clean the old sources as they may break the new build.
|
|
196
186
|
this.$fs.deleteDirectory(pluginTempDir);
|
|
197
187
|
this.$fs.ensureDirectoryExists(pluginTempDir);
|
|
198
188
|
}
|
|
@@ -311,7 +301,6 @@ class AndroidPluginBuildService {
|
|
|
311
301
|
});
|
|
312
302
|
}
|
|
313
303
|
getLocalGradleVersions() {
|
|
314
|
-
// try reading from installed runtime first before reading from the npm registry...
|
|
315
304
|
const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(constants_1.SCOPED_ANDROID_RUNTIME_NAME, {
|
|
316
305
|
paths: [this.$projectData.projectDir],
|
|
317
306
|
});
|
|
@@ -346,23 +335,13 @@ class AndroidPluginBuildService {
|
|
|
346
335
|
if (localVersionInfo) {
|
|
347
336
|
return localVersionInfo;
|
|
348
337
|
}
|
|
349
|
-
// fallback to reading from npm...
|
|
350
338
|
try {
|
|
351
339
|
let output = yield this.$packageManager.view(`${constants_1.SCOPED_ANDROID_RUNTIME_NAME}@${runtimeVersion}`, { version_info: true });
|
|
352
340
|
output = (_a = output === null || output === void 0 ? void 0 : output["version_info"]) !== null && _a !== void 0 ? _a : output;
|
|
353
341
|
if (!output) {
|
|
354
|
-
/**
|
|
355
|
-
* fallback to the old 'gradle' key in package.json
|
|
356
|
-
*
|
|
357
|
-
* format:
|
|
358
|
-
*
|
|
359
|
-
* gradle: { version: '6.4', android: '3.6.4' }
|
|
360
|
-
*
|
|
361
|
-
*/
|
|
362
342
|
output = yield this.$packageManager.view(`${constants_1.SCOPED_ANDROID_RUNTIME_NAME}@${runtimeVersion}`, { gradle: true });
|
|
363
343
|
output = (_b = output === null || output === void 0 ? void 0 : output["gradle"]) !== null && _b !== void 0 ? _b : output;
|
|
364
344
|
const { version, android } = output;
|
|
365
|
-
// covert output to the new format...
|
|
366
345
|
output = {
|
|
367
346
|
gradle: version,
|
|
368
347
|
gradleAndroid: android,
|
|
@@ -435,10 +414,6 @@ class AndroidPluginBuildService {
|
|
|
435
414
|
this.$errors.fail(`No built aar found at ${pathToBuiltAar}`);
|
|
436
415
|
}
|
|
437
416
|
}
|
|
438
|
-
/**
|
|
439
|
-
* @param {Object} options
|
|
440
|
-
* @param {string} options.platformsAndroidDirPath - The path to the 'plugin/src/platforms/android' directory.
|
|
441
|
-
*/
|
|
442
417
|
migrateIncludeGradle(options) {
|
|
443
418
|
this.validatePlatformsAndroidDirPathOption(options);
|
|
444
419
|
const includeGradleFilePath = path.join(options.platformsAndroidDirPath, constants_1.INCLUDE_GRADLE_NAME);
|
|
@@ -498,12 +473,16 @@ class AndroidPluginBuildService {
|
|
|
498
473
|
if (this.$logger.getLevel() === "INFO") {
|
|
499
474
|
localArgs.push("--quiet");
|
|
500
475
|
}
|
|
476
|
+
const opts = {
|
|
477
|
+
cwd: pluginBuildSettings.pluginDir,
|
|
478
|
+
stdio: "inherit",
|
|
479
|
+
shell: this.$hostInfo.isWindows,
|
|
480
|
+
};
|
|
481
|
+
if (this.$options.nativeHost) {
|
|
482
|
+
opts.env = Object.assign({ USER_PROJECT_PLATFORMS_ANDROID: path.resolve((0, process_1.cwd)(), this.$options.nativeHost) }, process.env);
|
|
483
|
+
}
|
|
501
484
|
try {
|
|
502
|
-
yield this.$childProcess.spawnFromEvent(gradlew, localArgs, "close",
|
|
503
|
-
cwd: pluginBuildSettings.pluginDir,
|
|
504
|
-
stdio: "inherit",
|
|
505
|
-
shell: this.$hostInfo.isWindows,
|
|
506
|
-
});
|
|
485
|
+
yield this.$childProcess.spawnFromEvent(gradlew, localArgs, "close", opts);
|
|
507
486
|
}
|
|
508
487
|
catch (err) {
|
|
509
488
|
this.$errors.fail(`Failed to build plugin ${pluginBuildSettings.pluginName} : \n${err}`);
|
|
@@ -544,4 +523,3 @@ __decorate([
|
|
|
544
523
|
], AndroidPluginBuildService.prototype, "buildPlugin", null);
|
|
545
524
|
exports.AndroidPluginBuildService = AndroidPluginBuildService;
|
|
546
525
|
yok_1.injector.register("androidPluginBuildService", AndroidPluginBuildService);
|
|
547
|
-
//# sourceMappingURL=android-plugin-build-service.js.map
|