nativescript 8.8.0 → 8.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +11 -1
- package/lib/bootstrap.js +5 -1
- package/lib/bun-package-manager.js +17 -1
- package/lib/color.js +3 -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 +4 -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 +3 -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 +12 -2
- 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/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 +30 -1
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
- 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 +4 -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 +91 -3
- 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 +10 -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 +143 -118
- 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 +6 -1
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +33 -1
- 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/assets-generation/assets-generation-service.js +16 -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/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 +9 -0
- package/lib/services/ios/xcodebuild-args-service.js +9 -0
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +1 -0
- 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 +94 -2
- 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 +22 -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 +1 -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/webpack/webpack-compiler-service.js +42 -1
- 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/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/package.json +2 -2
|
@@ -27,7 +27,40 @@ const constants_1 = require("../common/constants");
|
|
|
27
27
|
const helpers_1 = require("../common/helpers");
|
|
28
28
|
const decorators_1 = require(".././common/decorators");
|
|
29
29
|
const yok_1 = require("../common/yok");
|
|
30
|
-
|
|
30
|
+
//
|
|
31
|
+
// we sort the native dependencies topologically to make sure they are processed in the right order
|
|
32
|
+
// native dependenciess need to be sorted so the deepst dependencies are built before it's parents
|
|
33
|
+
//
|
|
34
|
+
// for example, given this dep structure (assuming these are all native dependencies that need to be built)
|
|
35
|
+
// (note: we list all dependencies at the root level, so the leaf nodes are essentially references to the root nodes)
|
|
36
|
+
//
|
|
37
|
+
// |- dep1
|
|
38
|
+
// |- dep2
|
|
39
|
+
// |- |- dep3
|
|
40
|
+
// |- |- dep4
|
|
41
|
+
// |- |- |- dep5
|
|
42
|
+
// |- dep3
|
|
43
|
+
// |- dep4
|
|
44
|
+
// |- |- dep5
|
|
45
|
+
// |- dep5
|
|
46
|
+
//
|
|
47
|
+
// It is sorted:
|
|
48
|
+
//
|
|
49
|
+
// |- dep1
|
|
50
|
+
// |- dep3
|
|
51
|
+
// |- dep5
|
|
52
|
+
// |- dep4 # depends on dep5, so dep5 must be built first, ie above ^
|
|
53
|
+
// |- |- dep5
|
|
54
|
+
// |- dep2 # depends on dep3, dep4 (and dep5 through dep4) so all of them must be built first before dep2 is built
|
|
55
|
+
// |- |- dep3
|
|
56
|
+
// |- |- dep4
|
|
57
|
+
// |- |- |- dep5
|
|
58
|
+
//
|
|
59
|
+
// for more details see: https://wikiless.org/wiki/Topological_sorting?lang=en
|
|
60
|
+
//
|
|
61
|
+
function topologicalSortNativeDependencies(dependencies, start = [], depth = 0, total = 0 // do not pass in, we calculate it in the initial run!
|
|
62
|
+
) {
|
|
63
|
+
// we set the total on the initial call - and never increment it, as it's used for esacaping the recursion
|
|
31
64
|
if (total === 0) {
|
|
32
65
|
total = dependencies.length;
|
|
33
66
|
}
|
|
@@ -41,6 +74,8 @@ function topologicalSortNativeDependencies(dependencies, start = [], depth = 0,
|
|
|
41
74
|
return sortedDeps;
|
|
42
75
|
}, start);
|
|
43
76
|
const remainingDeps = dependencies.filter((nativeDep) => !sortedDeps.includes(nativeDep));
|
|
77
|
+
// recurse if we still have remaining deps
|
|
78
|
+
// the second condition here prevents infinite recursion
|
|
44
79
|
if (remainingDeps.length && sortedDeps.length < total) {
|
|
45
80
|
return topologicalSortNativeDependencies(remainingDeps, sortedDeps, depth + 1, total);
|
|
46
81
|
}
|
|
@@ -94,7 +129,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
94
129
|
constants.APK_DIR,
|
|
95
130
|
];
|
|
96
131
|
const packageName = this.getProjectNameFromId(projectData);
|
|
97
|
-
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android");
|
|
132
|
+
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android" /* constants.PlatformTypes.android */);
|
|
98
133
|
this._platformData = {
|
|
99
134
|
frameworkPackageName: runtimePackage.name,
|
|
100
135
|
normalizedPlatformName: "Android",
|
|
@@ -135,7 +170,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
135
170
|
configurationFileName: constants.MANIFEST_FILE_NAME,
|
|
136
171
|
configurationFilePath: path.join(...configurationsDirectoryArr),
|
|
137
172
|
relativeToFrameworkConfigurationFilePath: path.join(constants.SRC_DIR, constants.MAIN_DIR, constants.MANIFEST_FILE_NAME),
|
|
138
|
-
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
|
|
173
|
+
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"], // http://developer.android.com/guide/appendix/media-formats.html
|
|
139
174
|
};
|
|
140
175
|
}
|
|
141
176
|
return this._platformData;
|
|
@@ -190,6 +225,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
190
225
|
const targetSdkVersion = androidToolsInfo && androidToolsInfo.targetSdkVersion;
|
|
191
226
|
this.$logger.trace(`Using Android SDK '${targetSdkVersion}'.`);
|
|
192
227
|
this.copy(this.getPlatformData(projectData).projectRoot, frameworkDir, "*", "-R");
|
|
228
|
+
// TODO: Check if we actually need this and if it should be targetSdk or compileSdk
|
|
193
229
|
this.cleanResValues(targetSdkVersion, projectData);
|
|
194
230
|
});
|
|
195
231
|
}
|
|
@@ -223,6 +259,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
223
259
|
}
|
|
224
260
|
interpolateData(projectData) {
|
|
225
261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
// Interpolate the apilevel and package
|
|
226
263
|
this.interpolateConfigurationFile(projectData);
|
|
227
264
|
const appResourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
|
|
228
265
|
let stringsFilePath;
|
|
@@ -238,8 +275,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
238
275
|
const gradleSettingsFilePath = path.join(this.getPlatformData(projectData).projectRoot, "settings.gradle");
|
|
239
276
|
shell.sed("-i", /__PROJECT_NAME__/, this.getProjectNameFromId(projectData), gradleSettingsFilePath);
|
|
240
277
|
try {
|
|
278
|
+
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
|
|
241
279
|
const appGradleContent = this.$fs.readText(projectData.appGradlePath);
|
|
242
280
|
if (appGradleContent.indexOf(constants.PACKAGE_PLACEHOLDER_NAME) !== -1) {
|
|
281
|
+
//TODO: For compatibility with old templates. Once all templates are updated should delete.
|
|
243
282
|
shell.sed("-i", new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectIdentifiers.android, projectData.appGradlePath);
|
|
244
283
|
}
|
|
245
284
|
}
|
|
@@ -298,6 +337,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
298
337
|
}
|
|
299
338
|
prepareProject() {
|
|
300
339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
// Intentionally left empty.
|
|
301
341
|
});
|
|
302
342
|
}
|
|
303
343
|
ensureConfigurationFileInAppResources(projectData) {
|
|
@@ -315,6 +355,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
315
355
|
this.$logger.warn("No manifest found in " + originalAndroidManifestFilePath);
|
|
316
356
|
return;
|
|
317
357
|
}
|
|
358
|
+
// Overwrite the AndroidManifest from runtime.
|
|
318
359
|
if (!appResourcesDirStructureHasMigrated) {
|
|
319
360
|
this.$fs.copyFile(originalAndroidManifestFilePath, this.getPlatformData(projectData).configurationFilePath);
|
|
320
361
|
}
|
|
@@ -331,6 +372,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
331
372
|
}
|
|
332
373
|
else {
|
|
333
374
|
this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), platformsAppResourcesPath);
|
|
375
|
+
// https://github.com/NativeScript/android-runtime/issues/899
|
|
376
|
+
// App_Resources/Android/libs is reserved to user's aars and jars, but they should not be copied as resources
|
|
334
377
|
this.$fs.deleteDirectory(path.join(platformsAppResourcesPath, "libs"));
|
|
335
378
|
}
|
|
336
379
|
const androidToolsInfo = this.$androidToolsInfo.getToolsInfo({
|
|
@@ -341,6 +384,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
341
384
|
}
|
|
342
385
|
preparePluginNativeCode(pluginData, projectData) {
|
|
343
386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
+
// build Android plugins which contain AndroidManifest.xml and/or resources
|
|
344
388
|
const pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
345
389
|
if (this.$fs.exists(pluginPlatformsFolderPath)) {
|
|
346
390
|
const options = {
|
|
@@ -366,6 +410,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
366
410
|
}
|
|
367
411
|
removePluginNativeCode(pluginData, projectData) {
|
|
368
412
|
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
// not implemented
|
|
369
414
|
});
|
|
370
415
|
}
|
|
371
416
|
beforePrepareAllPlugins(projectData, dependencies) {
|
|
@@ -384,6 +429,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
384
429
|
filterUniqueDependencies(dependencies) {
|
|
385
430
|
const depsDictionary = dependencies.reduce((dict, dep) => {
|
|
386
431
|
const collision = dict[dep.name];
|
|
432
|
+
// in case there are multiple dependencies to the same module, the one declared in the package.json takes precedence
|
|
387
433
|
if (!collision || collision.depth > dep.depth) {
|
|
388
434
|
dict[dep.name] = dep;
|
|
389
435
|
}
|
|
@@ -402,6 +448,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
402
448
|
name,
|
|
403
449
|
directory: path.relative(platformDir, directory),
|
|
404
450
|
dependencies: dependencies.filter((dep) => {
|
|
451
|
+
// filter out transient dependencies that don't have native dependencies
|
|
405
452
|
return (nativeDependencyData.findIndex((nativeDep) => nativeDep.name === dep) !== -1);
|
|
406
453
|
}),
|
|
407
454
|
};
|
|
@@ -409,6 +456,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
409
456
|
nativeDependencies = topologicalSortNativeDependencies(nativeDependencies);
|
|
410
457
|
const jsonContent = JSON.stringify(nativeDependencies, null, 4);
|
|
411
458
|
this.$fs.writeFile(dependenciesJsonPath, jsonContent);
|
|
459
|
+
// we sort all the dependencies to respect the topological sorting of the native dependencies
|
|
412
460
|
return dependencies.sort(function (a, b) {
|
|
413
461
|
return (nativeDependencies.findIndex((n) => n.name === a.name) -
|
|
414
462
|
nativeDependencies.findIndex((n) => n.name === b.name));
|
|
@@ -447,6 +495,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
447
495
|
}
|
|
448
496
|
checkForChanges() {
|
|
449
497
|
return __awaiter(this, void 0, void 0, function* () {
|
|
498
|
+
// Nothing android specific to check yet.
|
|
450
499
|
});
|
|
451
500
|
}
|
|
452
501
|
getDeploymentTarget(projectData) {
|
|
@@ -457,9 +506,12 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
457
506
|
shell.cp(cpArg, paths, projectRoot);
|
|
458
507
|
}
|
|
459
508
|
validatePackageName(packageName) {
|
|
509
|
+
//Make the package conform to Java package types
|
|
510
|
+
//Enforce underscore limitation
|
|
460
511
|
if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(packageName)) {
|
|
461
512
|
this.$errors.fail(`Package name must look like: com.company.Name. Got: ${packageName}`);
|
|
462
513
|
}
|
|
514
|
+
//Class is a reserved word
|
|
463
515
|
if (/\b[Cc]lass\b/.test(packageName)) {
|
|
464
516
|
this.$errors.fail("class is a reserved word");
|
|
465
517
|
}
|
|
@@ -468,6 +520,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
468
520
|
if (projectName === "") {
|
|
469
521
|
this.$errors.fail("Project name cannot be empty");
|
|
470
522
|
}
|
|
523
|
+
//Classes in Java don't begin with numbers
|
|
471
524
|
if (/^[0-9]/.test(projectName)) {
|
|
472
525
|
this.$errors.fail("Project name must not begin with a number");
|
|
473
526
|
}
|
|
@@ -488,6 +541,19 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
488
541
|
];
|
|
489
542
|
return path.join(this.getPlatformData(projectData).projectRoot, ...resourcePath);
|
|
490
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* The purpose of this method is to delete the previously prepared user resources.
|
|
546
|
+
* The content of the `<platforms>/android/.../res` directory is based on user's resources and gradle project template from android-runtime.
|
|
547
|
+
* During preparation of the `<path to user's App_Resources>/Android` we want to clean all the users files from previous preparation,
|
|
548
|
+
* but keep the ones that were introduced during `platform add` of the android-runtime.
|
|
549
|
+
* Currently the Gradle project template contains resources only in values and values-v21 directories.
|
|
550
|
+
* So the current logic of the method is cleaning al resources from `<platforms>/android/.../res` that are not in `values.*` directories
|
|
551
|
+
* and that exist in the `<path to user's App_Resources>/Android/.../res` directory
|
|
552
|
+
* This means that if user has a resource file in values-v29 for example, builds the project and then deletes this resource,
|
|
553
|
+
* it will be kept in platforms directory. Reference issue: `https://github.com/NativeScript/nativescript-cli/issues/5083`
|
|
554
|
+
* Same is valid for files in `drawable-<resolution>` directories - in case in user's resources there's drawable-hdpi directory,
|
|
555
|
+
* which is deleted after the first build of app, it will remain in platforms directory.
|
|
556
|
+
*/
|
|
491
557
|
cleanUpPreparedResources(projectData) {
|
|
492
558
|
let resourcesDirPath = path.join(projectData.appResourcesDirectoryPath, this.getPlatformData(projectData).normalizedPlatformName);
|
|
493
559
|
if (this.$androidResourcesMigrationService.hasMigrated(projectData.appResourcesDirectoryPath)) {
|
|
@@ -513,7 +579,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
513
579
|
const hasUseKotlinPropertyInAppData = `hasUseKotlinPropertyInApp${analyticsDelimiter}${buildStatistics.kotlinUsage.hasUseKotlinPropertyInApp}`;
|
|
514
580
|
const hasKotlinRuntimeClassesData = `hasKotlinRuntimeClasses${analyticsDelimiter}${buildStatistics.kotlinUsage.hasKotlinRuntimeClasses}`;
|
|
515
581
|
yield this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
516
|
-
action: "Using Kotlin"
|
|
582
|
+
action: "Using Kotlin" /* constants.TrackActionNames.UsingKotlin */,
|
|
517
583
|
additionalData: `${hasUseKotlinPropertyInAppData}${analyticsDelimiter}${hasKotlinRuntimeClassesData}`,
|
|
518
584
|
});
|
|
519
585
|
}
|
|
@@ -547,3 +613,4 @@ __decorate([
|
|
|
547
613
|
], AndroidProjectService.prototype, "buildProject", null);
|
|
548
614
|
exports.AndroidProjectService = AndroidProjectService;
|
|
549
615
|
yok_1.injector.register("androidProjectService", AndroidProjectService);
|
|
616
|
+
//# sourceMappingURL=android-project-service.js.map
|
|
@@ -58,6 +58,7 @@ class AndroidResourcesMigrationService {
|
|
|
58
58
|
const appResourcesMainSourceSetResourcesDestination = path.join(appMainSourceSet, constants.RESOURCES_DIR);
|
|
59
59
|
this.$fs.ensureDirectoryExists(appResourcesDestination);
|
|
60
60
|
this.$fs.ensureDirectoryExists(appMainSourceSet);
|
|
61
|
+
// create /java, /res and /assets in the App_Resources/Android/src/main directory
|
|
61
62
|
this.$fs.ensureDirectoryExists(appResourcesMainSourceSetResourcesDestination);
|
|
62
63
|
this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, "java"));
|
|
63
64
|
this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, constants.ASSETS_DIR));
|
|
@@ -71,20 +72,25 @@ class AndroidResourcesMigrationService {
|
|
|
71
72
|
const resourceFiles = getFiles(appResourcesFiles);
|
|
72
73
|
resourceDirectories.forEach((dir) => {
|
|
73
74
|
if (path.basename(dir) !== "libs") {
|
|
75
|
+
// don't copy /App_Resources/Android/libs into the src/main/res/libs directory
|
|
74
76
|
this.$fs.copyFile(dir, appResourcesMainSourceSetResourcesDestination);
|
|
75
77
|
}
|
|
76
78
|
else {
|
|
79
|
+
// copy App_Resources/Android/libs to App_ResourcesNew/Android/libs
|
|
77
80
|
this.$fs.copyFile(dir, path.join(appResourcesDestination));
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
resourceFiles.forEach((file) => {
|
|
81
84
|
const fileName = path.basename(file);
|
|
82
85
|
if (fileName !== constants.MANIFEST_FILE_NAME) {
|
|
86
|
+
// don't copy AndroidManifest into /App_Resources/Android as it needs to be inside src/main/
|
|
83
87
|
this.$fs.copyFile(file, path.join(appResourcesDestination, fileName));
|
|
84
88
|
}
|
|
85
89
|
});
|
|
86
90
|
this.$fs.copyFile(path.join(originalAppResources, constants.MANIFEST_FILE_NAME), path.join(appMainSourceSet, constants.MANIFEST_FILE_NAME));
|
|
91
|
+
// rename the legacy app_resources to ANDROID_DIR_OLD
|
|
87
92
|
this.$fs.rename(originalAppResources, appResourcesBackup);
|
|
93
|
+
// move the new, updated app_resources to App_Resources/Android, as the de facto resources
|
|
88
94
|
this.$fs.rename(appResourcesDestination, originalAppResources);
|
|
89
95
|
});
|
|
90
96
|
}
|
|
@@ -102,3 +108,4 @@ AndroidResourcesMigrationService.ANDROID_DIR_TEMP = "Android-Updated";
|
|
|
102
108
|
AndroidResourcesMigrationService.ANDROID_DIR_OLD = "Android-Pre-v4";
|
|
103
109
|
exports.AndroidResourcesMigrationService = AndroidResourcesMigrationService;
|
|
104
110
|
yok_1.injector.register("androidResourcesMigrationService", AndroidResourcesMigrationService);
|
|
111
|
+
//# sourceMappingURL=android-resources-migration-service.js.map
|
|
@@ -80,3 +80,4 @@ class ApplePortalApplicationService {
|
|
|
80
80
|
}
|
|
81
81
|
exports.ApplePortalApplicationService = ApplePortalApplicationService;
|
|
82
82
|
yok_1.injector.register("applePortalApplicationService", ApplePortalApplicationService);
|
|
83
|
+
//# sourceMappingURL=apple-portal-application-service.js.map
|
|
@@ -190,10 +190,10 @@ For more details how to set up your environment, please execute "ns publish ios
|
|
|
190
190
|
const data = JSON.parse(authResponse.body);
|
|
191
191
|
const isSMS = data.trustedPhoneNumbers &&
|
|
192
192
|
data.trustedPhoneNumbers.length === 1 &&
|
|
193
|
-
data.noTrustedDevices;
|
|
193
|
+
data.noTrustedDevices; // 1 device and no trusted devices means sms was automatically sent.
|
|
194
194
|
const multiSMS = data.trustedPhoneNumbers &&
|
|
195
195
|
data.trustedPhoneNumbers.length !== 1 &&
|
|
196
|
-
data.noTrustedDevices;
|
|
196
|
+
data.noTrustedDevices; // Not handling more than 1 sms device and no trusted devices.
|
|
197
197
|
let token;
|
|
198
198
|
if (data.trustedPhoneNumbers &&
|
|
199
199
|
data.trustedPhoneNumbers.length &&
|
|
@@ -207,6 +207,7 @@ For more details how to set up your environment, please execute "ns publish ios
|
|
|
207
207
|
};
|
|
208
208
|
let url = `https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode`;
|
|
209
209
|
if (isSMS) {
|
|
210
|
+
// No trusted devices means it must be sms.
|
|
210
211
|
body.mode = "sms";
|
|
211
212
|
body.phoneNumber = {
|
|
212
213
|
id: data.trustedPhoneNumbers[0].id,
|
|
@@ -270,8 +271,9 @@ function checkBits(bits, digest) {
|
|
|
270
271
|
return result;
|
|
271
272
|
}
|
|
272
273
|
function checkBit(position, buffer) {
|
|
273
|
-
const bitOffset = position & 7;
|
|
274
|
-
const byteIndex = position >> 3;
|
|
274
|
+
const bitOffset = position & 7; // in byte
|
|
275
|
+
const byteIndex = position >> 3; // in buffer
|
|
275
276
|
const bit = (buffer[byteIndex] >> bitOffset) & 1;
|
|
276
277
|
return bit === 0;
|
|
277
278
|
}
|
|
279
|
+
//# sourceMappingURL=apple-portal-session-service.js.map
|
|
@@ -96,7 +96,7 @@ class AssetsGenerationService {
|
|
|
96
96
|
}
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
|
-
const operation = assetItem.resizeOperation || "resize"
|
|
99
|
+
const operation = assetItem.resizeOperation || "resize" /* Operations.Resize */;
|
|
100
100
|
let tempScale = null;
|
|
101
101
|
if (assetItem.scale) {
|
|
102
102
|
if (_.isNumber(assetItem.scale)) {
|
|
@@ -121,27 +121,36 @@ class AssetsGenerationService {
|
|
|
121
121
|
}
|
|
122
122
|
let image;
|
|
123
123
|
switch (operation) {
|
|
124
|
-
case "overlayWith"
|
|
124
|
+
case "overlayWith" /* Operations.OverlayWith */:
|
|
125
125
|
const overlayImageScale = assetItem.overlayImageScale ||
|
|
126
126
|
constants_1.AssetConstants.defaultOverlayImageScale;
|
|
127
127
|
const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
|
|
128
128
|
image = yield this.resize(generationData.imagePath, imageResize, imageResize);
|
|
129
129
|
image = this.generateImage(background, width, height, outputPath, image);
|
|
130
130
|
break;
|
|
131
|
-
case "blank"
|
|
131
|
+
case "blank" /* Operations.Blank */:
|
|
132
132
|
image = this.generateImage(background, width, height, outputPath);
|
|
133
133
|
break;
|
|
134
|
-
case "resize"
|
|
134
|
+
case "resize" /* Operations.Resize */:
|
|
135
135
|
image = yield this.resize(generationData.imagePath, width, height);
|
|
136
136
|
break;
|
|
137
|
-
case "outerScale"
|
|
137
|
+
case "outerScale" /* Operations.OuterScale */:
|
|
138
|
+
// Resize image without applying scale
|
|
138
139
|
image = yield this.resize(generationData.imagePath, assetItem.width, assetItem.height);
|
|
140
|
+
// The scale will apply to the underlying layer of the generated image
|
|
139
141
|
image = this.generateImage("#00000000", width, height, outputPath, image);
|
|
140
142
|
break;
|
|
141
143
|
default:
|
|
142
144
|
throw new Error(`Invalid image generation operation: ${operation}`);
|
|
143
145
|
}
|
|
146
|
+
// This code disables the alpha chanel, as some images for the Apple App Store must not have transparency.
|
|
144
147
|
if (assetItem.rgba === false) {
|
|
148
|
+
//
|
|
149
|
+
// The original code here became broken at some time and there is an issue posted here..
|
|
150
|
+
// https://github.com/oliver-moran/jimp/issues/954
|
|
151
|
+
// But NathanaelA recommended the below change and it works so maybe that's just what we go with.
|
|
152
|
+
//
|
|
153
|
+
// image = image.rgba(false);
|
|
145
154
|
image = image.colorType(2);
|
|
146
155
|
}
|
|
147
156
|
image.write(outputPath);
|
|
@@ -155,6 +164,7 @@ class AssetsGenerationService {
|
|
|
155
164
|
});
|
|
156
165
|
}
|
|
157
166
|
generateImage(background, width, height, outputPath, overlayImage) {
|
|
167
|
+
// Typescript declarations for Jimp are not updated to define the constructor with backgroundColor so we workaround it by casting it to <any> for this case only.
|
|
158
168
|
const J = Jimp;
|
|
159
169
|
const backgroundColor = this.getRgbaNumber(background);
|
|
160
170
|
let image = new J(width, height, backgroundColor);
|
|
@@ -180,3 +190,4 @@ __decorate([
|
|
|
180
190
|
], AssetsGenerationService.prototype, "generateSplashScreens", null);
|
|
181
191
|
exports.AssetsGenerationService = AssetsGenerationService;
|
|
182
192
|
yok_1.injector.register("assetsGenerationService", AssetsGenerationService);
|
|
193
|
+
//# sourceMappingURL=assets-generation-service.js.map
|
|
@@ -75,7 +75,7 @@ class BuildArtifactsService {
|
|
|
75
75
|
if (packages.length > 1) {
|
|
76
76
|
this.$logger.warn(`More than one ${packageExtName} found in ${buildOutputPath} directory. Using the last one produced from build.`);
|
|
77
77
|
}
|
|
78
|
-
packages = _.sortBy(packages, (pkg) => pkg.time).reverse();
|
|
78
|
+
packages = _.sortBy(packages, (pkg) => pkg.time).reverse(); // We need to reverse because sortBy always sorts in ascending order
|
|
79
79
|
return packages[0];
|
|
80
80
|
}
|
|
81
81
|
getApplicationPackagesCore(candidates, validPackageNames) {
|
|
@@ -96,3 +96,4 @@ class BuildArtifactsService {
|
|
|
96
96
|
}
|
|
97
97
|
exports.BuildArtifactsService = BuildArtifactsService;
|
|
98
98
|
yok_1.injector.register("buildArtifactsService", BuildArtifactsService);
|
|
99
|
+
//# sourceMappingURL=build-artifacts-service.js.map
|
|
@@ -30,7 +30,7 @@ class CleanupService {
|
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
32
32
|
cleanupProcess.send({
|
|
33
|
-
messageType: "AddCleanCommand"
|
|
33
|
+
messageType: "AddCleanCommand" /* CleanupProcessMessage.AddCleanCommand */,
|
|
34
34
|
commandInfo,
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -39,7 +39,7 @@ class CleanupService {
|
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
41
41
|
cleanupProcess.send({
|
|
42
|
-
messageType: "RemoveCleanCommand"
|
|
42
|
+
messageType: "RemoveCleanCommand" /* CleanupProcessMessage.RemoveCleanCommand */,
|
|
43
43
|
commandInfo,
|
|
44
44
|
});
|
|
45
45
|
});
|
|
@@ -48,7 +48,7 @@ class CleanupService {
|
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
49
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
50
50
|
cleanupProcess.send({
|
|
51
|
-
messageType: "AddRequest"
|
|
51
|
+
messageType: "AddRequest" /* CleanupProcessMessage.AddRequest */,
|
|
52
52
|
requestInfo,
|
|
53
53
|
});
|
|
54
54
|
});
|
|
@@ -57,7 +57,7 @@ class CleanupService {
|
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
59
59
|
cleanupProcess.send({
|
|
60
|
-
messageType: "RemoveRequest"
|
|
60
|
+
messageType: "RemoveRequest" /* CleanupProcessMessage.RemoveRequest */,
|
|
61
61
|
requestInfo,
|
|
62
62
|
});
|
|
63
63
|
});
|
|
@@ -66,7 +66,7 @@ class CleanupService {
|
|
|
66
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
67
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
68
68
|
cleanupProcess.send({
|
|
69
|
-
messageType: "AddDeleteFileAction"
|
|
69
|
+
messageType: "AddDeleteFileAction" /* CleanupProcessMessage.AddDeleteFileAction */,
|
|
70
70
|
filePath,
|
|
71
71
|
});
|
|
72
72
|
});
|
|
@@ -75,7 +75,7 @@ class CleanupService {
|
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
76
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
77
77
|
cleanupProcess.send({
|
|
78
|
-
messageType: "RemoveDeleteFileAction"
|
|
78
|
+
messageType: "RemoveDeleteFileAction" /* CleanupProcessMessage.RemoveDeleteFileAction */,
|
|
79
79
|
filePath,
|
|
80
80
|
});
|
|
81
81
|
});
|
|
@@ -84,7 +84,7 @@ class CleanupService {
|
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
86
86
|
cleanupProcess.send({
|
|
87
|
-
messageType: "AddJSFileToRequire"
|
|
87
|
+
messageType: "AddJSFileToRequire" /* CleanupProcessMessage.AddJSFileToRequire */,
|
|
88
88
|
jsCommand,
|
|
89
89
|
});
|
|
90
90
|
});
|
|
@@ -93,7 +93,7 @@ class CleanupService {
|
|
|
93
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
94
|
const cleanupProcess = yield this.getCleanupProcess();
|
|
95
95
|
cleanupProcess.send({
|
|
96
|
-
messageType: "RemoveJSFileToRequire"
|
|
96
|
+
messageType: "RemoveJSFileToRequire" /* CleanupProcessMessage.RemoveJSFileToRequire */,
|
|
97
97
|
jsCommand,
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -121,6 +121,8 @@ class CleanupService {
|
|
|
121
121
|
setShouldDispose(shouldDispose) {
|
|
122
122
|
this.shouldDispose = shouldDispose;
|
|
123
123
|
}
|
|
124
|
+
// TODO: Consider extracting this method to a separate service
|
|
125
|
+
// as it has the same logic as the one used in analytics-service
|
|
124
126
|
getCleanupProcess() {
|
|
125
127
|
return new Promise((resolve, reject) => {
|
|
126
128
|
const cleanupProcessArgs = this.getCleanupProcessArgs();
|
|
@@ -139,11 +141,12 @@ class CleanupService {
|
|
|
139
141
|
clearTimeout(timeoutId);
|
|
140
142
|
if (!isSettled) {
|
|
141
143
|
isSettled = true;
|
|
144
|
+
// In case we throw error here, CLI will break its execution.
|
|
142
145
|
reject(err);
|
|
143
146
|
}
|
|
144
147
|
});
|
|
145
148
|
cleanupProcess.on("message", (data) => {
|
|
146
|
-
if (data === "ProcessReadyToReceive") {
|
|
149
|
+
if (data === "ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */) {
|
|
147
150
|
clearTimeout(timeoutId);
|
|
148
151
|
if (!isSettled) {
|
|
149
152
|
isSettled = true;
|
|
@@ -192,3 +195,4 @@ __decorate([
|
|
|
192
195
|
], CleanupService.prototype, "getCleanupProcess", null);
|
|
193
196
|
exports.CleanupService = CleanupService;
|
|
194
197
|
yok_1.injector.register("cleanupService", CleanupService);
|
|
198
|
+
//# sourceMappingURL=cleanup-service.js.map
|
|
@@ -82,6 +82,7 @@ class CocoaPodsPlatformManager {
|
|
|
82
82
|
_.each(allPodfiles, (podfileContent) => {
|
|
83
83
|
const platformMatch = platformRowRegExp.exec(podfileContent);
|
|
84
84
|
const podfilePathMatch = podfilePathRegExp.exec(podfileContent) || [];
|
|
85
|
+
// platform without version -> select it with highest priority
|
|
85
86
|
if (platformMatch && platformMatch[0] && !platformMatch[2]) {
|
|
86
87
|
selectedPlatformData = {
|
|
87
88
|
version: null,
|
|
@@ -90,6 +91,7 @@ class CocoaPodsPlatformManager {
|
|
|
90
91
|
};
|
|
91
92
|
return false;
|
|
92
93
|
}
|
|
94
|
+
// platform with version
|
|
93
95
|
if (platformMatch && platformMatch[0] && platformMatch[2]) {
|
|
94
96
|
if (!selectedPlatformData ||
|
|
95
97
|
semver.gt(semver.coerce(platformMatch[2]), semver.coerce(selectedPlatformData.version))) {
|
|
@@ -104,6 +106,12 @@ class CocoaPodsPlatformManager {
|
|
|
104
106
|
return selectedPlatformData;
|
|
105
107
|
}
|
|
106
108
|
shouldReplacePlatformSection(projectData, oldPodfilePlatformData, currentPodfilePlatformData) {
|
|
109
|
+
// The selected platform should be replaced in the following cases:
|
|
110
|
+
// 1. When the pod file is from App_Resources and the selected platform is not from App_Resources
|
|
111
|
+
// 2. When the pod file is from App_Resources, the selected platform is also from App_Resources
|
|
112
|
+
// and the pod's version is greater than the selected one
|
|
113
|
+
// 3. When the pod file doesn't have platform's version -> `platform :ios`
|
|
114
|
+
// 4. When the pod file has a version greater than the selected platform's version
|
|
107
115
|
const appResourcesPodfilePath = path.join(projectData.getAppResourcesDirectoryPath(), "iOS", constants_1.PODFILE_NAME);
|
|
108
116
|
const isFromAppResources = oldPodfilePlatformData.path !== appResourcesPodfilePath &&
|
|
109
117
|
currentPodfilePlatformData.path === appResourcesPodfilePath;
|
|
@@ -135,3 +143,4 @@ class CocoaPodsPlatformManager {
|
|
|
135
143
|
}
|
|
136
144
|
exports.CocoaPodsPlatformManager = CocoaPodsPlatformManager;
|
|
137
145
|
yok_1.injector.register("cocoaPodsPlatformManager", CocoaPodsPlatformManager);
|
|
146
|
+
//# sourceMappingURL=cocoapods-platform-manager.js.map
|
|
@@ -44,6 +44,12 @@ class CocoaPodsService {
|
|
|
44
44
|
let podTool = this.$config.USE_POD_SANDBOX ? "sandbox-pod" : "pod";
|
|
45
45
|
const args = ["install"];
|
|
46
46
|
if (process.platform === "darwin" && process.arch === "arm64") {
|
|
47
|
+
// check if pod is installed as an x86_64 binary or a native arm64 one
|
|
48
|
+
// we run the following:
|
|
49
|
+
// arch -x86_64 pod --version
|
|
50
|
+
// if it's an arm64 binary, we'll get something like this as a result:
|
|
51
|
+
// arch: posix_spawnp: pod: Bad CPU type in executable
|
|
52
|
+
// in which case, we should run it natively.
|
|
47
53
|
const res = yield this.$childProcess
|
|
48
54
|
.exec("arch -x86_64 pod --version", null, {
|
|
49
55
|
showStderr: true,
|
|
@@ -57,8 +63,11 @@ class CocoaPodsService {
|
|
|
57
63
|
podTool = "arch";
|
|
58
64
|
}
|
|
59
65
|
}
|
|
66
|
+
// cocoapods print a lot of non-error information on stderr. Pipe the `stderr` to `stdout`, so we won't polute CLI's stderr output.
|
|
60
67
|
const podInstallResult = yield this.$childProcess.spawnFromEvent(podTool, args, "close", { cwd: projectRoot, stdio: ["pipe", process.stdout, process.stdout] }, { throwError: false });
|
|
61
68
|
if (podInstallResult.exitCode !== 0) {
|
|
69
|
+
// https://github.com/CocoaPods/CocoaPods/blob/92aaf0f1120d32f3487960b485fb69fcaf61486c/lib/cocoapods/resolver.rb#L498
|
|
70
|
+
// TODO add article
|
|
62
71
|
const versionResolutionHint = podInstallResult.exitCode === 31
|
|
63
72
|
? `For more information on resolving CocoaPod issues in NativeScript read.`
|
|
64
73
|
: "";
|
|
@@ -96,6 +105,7 @@ ${versionResolutionHint}`);
|
|
|
96
105
|
applyPodfileArchExclusions(projectData, platformData) {
|
|
97
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
107
|
const xcodeVersionData = yield this.$xcodeSelectService.getXcodeVersion();
|
|
108
|
+
// only apply EXCLUDED_ARCHS workaround on XCode 12
|
|
99
109
|
if (+xcodeVersionData.major !== 12) {
|
|
100
110
|
return;
|
|
101
111
|
}
|
|
@@ -114,6 +124,7 @@ end`.trim();
|
|
|
114
124
|
this.$fs.writeFile(exclusionsPodfile, exclusions);
|
|
115
125
|
}
|
|
116
126
|
yield this.applyPodfileToProject("NativeScript-CLI-Architecture-Exclusions", exclusionsPodfile, projectData, platformData);
|
|
127
|
+
// clean up
|
|
117
128
|
this.$fs.deleteFile(exclusionsPodfile);
|
|
118
129
|
});
|
|
119
130
|
}
|
|
@@ -138,6 +149,7 @@ end`.trim();
|
|
|
138
149
|
podfilePath: path.join(extensionFolderPath, name, constants.PODFILE_NAME),
|
|
139
150
|
}));
|
|
140
151
|
extensionsPodfile.forEach(({ targetName, podfilePath }) => {
|
|
152
|
+
// Remove the data between #Begin Podfile and #EndPodfile
|
|
141
153
|
const regExpToRemove = new RegExp(`${this.getExtensionPodfileHeader(podfilePath, targetName)}[\\s\\S]*?${this.getExtensionPodfileEnd()}`, "mg");
|
|
142
154
|
projectPodFileContent = projectPodFileContent.replace(regExpToRemove, "");
|
|
143
155
|
if (this.$fs.exists(podfilePath)) {
|
|
@@ -166,6 +178,7 @@ end`.trim();
|
|
|
166
178
|
? this.$fs.readText(pathToProjectPodfile).trim()
|
|
167
179
|
: "";
|
|
168
180
|
if (projectPodfileContent.indexOf(podfileContent) === -1) {
|
|
181
|
+
// Remove old occurences of the plugin from the project's Podfile.
|
|
169
182
|
this.removePodfileFromProject(moduleName, podfilePath, projectData, nativeProjectPath);
|
|
170
183
|
let finalPodfileContent = this.$fs.exists(pathToProjectPodfile)
|
|
171
184
|
? this.getPodfileContentWithoutTarget(projectData, this.$fs.readText(pathToProjectPodfile))
|
|
@@ -184,6 +197,7 @@ end`.trim();
|
|
|
184
197
|
removePodfileFromProject(moduleName, podfilePath, projectData, projectRoot) {
|
|
185
198
|
if (this.$fs.exists(this.getProjectPodfilePath(projectRoot))) {
|
|
186
199
|
let projectPodFileContent = this.$fs.readText(this.getProjectPodfilePath(projectRoot));
|
|
200
|
+
// Remove the data between #Begin Podfile and #EndPodfile
|
|
187
201
|
const regExpToRemove = new RegExp(`${this.getPluginPodfileHeader(podfilePath)}[\\s\\S]*?${this.getPluginPodfileEnd()}`, "mg");
|
|
188
202
|
projectPodFileContent = projectPodFileContent.replace(regExpToRemove, "");
|
|
189
203
|
projectPodFileContent = this.removePostInstallHook(moduleName, projectPodFileContent);
|
|
@@ -204,7 +218,7 @@ end`.trim();
|
|
|
204
218
|
}
|
|
205
219
|
}
|
|
206
220
|
getPluginPodfilePath(pluginData) {
|
|
207
|
-
const pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath("ios");
|
|
221
|
+
const pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath("ios" /* PlatformTypes.ios */);
|
|
208
222
|
const pluginPodFilePath = path.join(pluginPlatformsFolderPath, constants_1.PODFILE_NAME);
|
|
209
223
|
return pluginPodFilePath;
|
|
210
224
|
}
|
|
@@ -240,6 +254,7 @@ end`.trim();
|
|
|
240
254
|
if (_.startsWith(projectPodfileContent, podFileHeader)) {
|
|
241
255
|
projectPodfileContent = projectPodfileContent.substr(podFileHeader.length);
|
|
242
256
|
const podFileFooter = this.getPodfileFooter();
|
|
257
|
+
// Only remove the final end in case the file starts with the podFileHeader
|
|
243
258
|
if (_.endsWith(projectPodfileContent, podFileFooter)) {
|
|
244
259
|
projectPodfileContent = projectPodfileContent.substr(0, projectPodfileContent.length - podFileFooter.length);
|
|
245
260
|
}
|
|
@@ -260,6 +275,8 @@ end`.trim();
|
|
|
260
275
|
return projectPodFileContent;
|
|
261
276
|
}
|
|
262
277
|
getHookBasicFuncNameForPlugin(hookName, pluginName) {
|
|
278
|
+
// nativescript-hook and nativescript_hook should have different names, so replace all _ with ___ first and then replace all special symbols with _
|
|
279
|
+
// This will lead to a clash in case plugins are called nativescript-hook and nativescript___hook
|
|
263
280
|
const replacedPluginName = pluginName
|
|
264
281
|
.replace(/_/g, "___")
|
|
265
282
|
.replace(/[^A-Za-z0-9_]/g, "_");
|
|
@@ -273,6 +290,7 @@ end`.trim();
|
|
|
273
290
|
const newFunctionName = `${this.getHookBasicFuncNameForPlugin(hookName, pluginName)}_${newFunctions.length}`;
|
|
274
291
|
let newDefinition = `def ${newFunctionName}`;
|
|
275
292
|
const rubyFunction = { functionName: newFunctionName };
|
|
293
|
+
// firstGroup is the block parameter, secondGroup is the block parameter name.
|
|
276
294
|
if (firstGroup && secondGroup) {
|
|
277
295
|
newDefinition = `${newDefinition} (${secondGroup})`;
|
|
278
296
|
rubyFunction.functionParameters = secondGroup;
|
|
@@ -283,6 +301,7 @@ end`.trim();
|
|
|
283
301
|
return { replacedContent, newFunctions };
|
|
284
302
|
}
|
|
285
303
|
getPluginPodfileHeader(pluginPodFilePath) {
|
|
304
|
+
// escape special + from the podfile path (pnpm)
|
|
286
305
|
pluginPodFilePath = pluginPodFilePath.replace(/\+/g, "\\+");
|
|
287
306
|
return `# Begin Podfile - ${pluginPodFilePath}`;
|
|
288
307
|
}
|
|
@@ -352,3 +371,4 @@ CocoaPodsService.PODFILE_POST_INSTALL_SECTION_NAME = "post_install";
|
|
|
352
371
|
CocoaPodsService.INSTALLER_BLOCK_PARAMETER_NAME = "installer";
|
|
353
372
|
exports.CocoaPodsService = CocoaPodsService;
|
|
354
373
|
yok_1.injector.register("cocoapodsService", CocoaPodsService);
|
|
374
|
+
//# sourceMappingURL=cocoapods-service.js.map
|