nativescript 8.7.2 → 8.8.0-alpha.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/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 +0 -1
- 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 +4 -14
- 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 +0 -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 +0 -1
- package/lib/data/run-data.js +0 -1
- 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 +2 -7
- 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 +116 -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 +0 -1
- 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 +2 -9
- 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 -43
- package/lib/services/android-project-service.js +4 -71
- 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 +5 -16
- 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 +0 -1
- 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 +1 -23
- 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 +0 -3
- package/lib/services/livesync/android-livesync-service.js +0 -1
- 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 +0 -2
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +0 -5
- 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 +0 -15
- 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 +2 -47
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -5
- package/lib/services/platform-environment-requirements.js +3 -8
- 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 +2 -18
- 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 +3 -12
- 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 +1 -42
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +0 -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 +1 -1
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +21 -15
- 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
|
@@ -27,40 +27,7 @@ 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
|
-
|
|
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
|
|
30
|
+
function topologicalSortNativeDependencies(dependencies, start = [], depth = 0, total = 0) {
|
|
64
31
|
if (total === 0) {
|
|
65
32
|
total = dependencies.length;
|
|
66
33
|
}
|
|
@@ -74,8 +41,6 @@ function topologicalSortNativeDependencies(dependencies, start = [], depth = 0,
|
|
|
74
41
|
return sortedDeps;
|
|
75
42
|
}, start);
|
|
76
43
|
const remainingDeps = dependencies.filter((nativeDep) => !sortedDeps.includes(nativeDep));
|
|
77
|
-
// recurse if we still have remaining deps
|
|
78
|
-
// the second condition here prevents infinite recursion
|
|
79
44
|
if (remainingDeps.length && sortedDeps.length < total) {
|
|
80
45
|
return topologicalSortNativeDependencies(remainingDeps, sortedDeps, depth + 1, total);
|
|
81
46
|
}
|
|
@@ -127,7 +92,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
127
92
|
constants.APK_DIR,
|
|
128
93
|
];
|
|
129
94
|
const packageName = this.getProjectNameFromId(projectData);
|
|
130
|
-
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android"
|
|
95
|
+
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android");
|
|
131
96
|
this._platformData = {
|
|
132
97
|
frameworkPackageName: runtimePackage.name,
|
|
133
98
|
normalizedPlatformName: "Android",
|
|
@@ -168,7 +133,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
168
133
|
configurationFileName: constants.MANIFEST_FILE_NAME,
|
|
169
134
|
configurationFilePath: path.join(...configurationsDirectoryArr),
|
|
170
135
|
relativeToFrameworkConfigurationFilePath: path.join(constants.SRC_DIR, constants.MAIN_DIR, constants.MANIFEST_FILE_NAME),
|
|
171
|
-
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
|
|
136
|
+
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
|
|
172
137
|
};
|
|
173
138
|
}
|
|
174
139
|
return this._platformData;
|
|
@@ -223,7 +188,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
223
188
|
const targetSdkVersion = androidToolsInfo && androidToolsInfo.targetSdkVersion;
|
|
224
189
|
this.$logger.trace(`Using Android SDK '${targetSdkVersion}'.`);
|
|
225
190
|
this.copy(this.getPlatformData(projectData).projectRoot, frameworkDir, "*", "-R");
|
|
226
|
-
// TODO: Check if we actually need this and if it should be targetSdk or compileSdk
|
|
227
191
|
this.cleanResValues(targetSdkVersion, projectData);
|
|
228
192
|
});
|
|
229
193
|
}
|
|
@@ -257,7 +221,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
257
221
|
}
|
|
258
222
|
interpolateData(projectData) {
|
|
259
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
// Interpolate the apilevel and package
|
|
261
224
|
this.interpolateConfigurationFile(projectData);
|
|
262
225
|
const appResourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
|
|
263
226
|
let stringsFilePath;
|
|
@@ -273,10 +236,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
273
236
|
const gradleSettingsFilePath = path.join(this.getPlatformData(projectData).projectRoot, "settings.gradle");
|
|
274
237
|
shell.sed("-i", /__PROJECT_NAME__/, this.getProjectNameFromId(projectData), gradleSettingsFilePath);
|
|
275
238
|
try {
|
|
276
|
-
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
|
|
277
239
|
const appGradleContent = this.$fs.readText(projectData.appGradlePath);
|
|
278
240
|
if (appGradleContent.indexOf(constants.PACKAGE_PLACEHOLDER_NAME) !== -1) {
|
|
279
|
-
//TODO: For compatibility with old templates. Once all templates are updated should delete.
|
|
280
241
|
shell.sed("-i", new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectIdentifiers.android, projectData.appGradlePath);
|
|
281
242
|
}
|
|
282
243
|
}
|
|
@@ -336,7 +297,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
336
297
|
}
|
|
337
298
|
prepareProject() {
|
|
338
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
339
|
-
// Intentionally left empty.
|
|
340
300
|
});
|
|
341
301
|
}
|
|
342
302
|
ensureConfigurationFileInAppResources(projectData) {
|
|
@@ -354,7 +314,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
354
314
|
this.$logger.warn("No manifest found in " + originalAndroidManifestFilePath);
|
|
355
315
|
return;
|
|
356
316
|
}
|
|
357
|
-
// Overwrite the AndroidManifest from runtime.
|
|
358
317
|
if (!appResourcesDirStructureHasMigrated) {
|
|
359
318
|
this.$fs.copyFile(originalAndroidManifestFilePath, this.getPlatformData(projectData).configurationFilePath);
|
|
360
319
|
}
|
|
@@ -371,8 +330,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
371
330
|
}
|
|
372
331
|
else {
|
|
373
332
|
this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), platformsAppResourcesPath);
|
|
374
|
-
// https://github.com/NativeScript/android-runtime/issues/899
|
|
375
|
-
// App_Resources/Android/libs is reserved to user's aars and jars, but they should not be copied as resources
|
|
376
333
|
this.$fs.deleteDirectory(path.join(platformsAppResourcesPath, "libs"));
|
|
377
334
|
}
|
|
378
335
|
const androidToolsInfo = this.$androidToolsInfo.getToolsInfo({
|
|
@@ -383,7 +340,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
383
340
|
}
|
|
384
341
|
preparePluginNativeCode(pluginData, projectData) {
|
|
385
342
|
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
-
// build Android plugins which contain AndroidManifest.xml and/or resources
|
|
387
343
|
const pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
388
344
|
if (this.$fs.exists(pluginPlatformsFolderPath)) {
|
|
389
345
|
const options = {
|
|
@@ -409,7 +365,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
409
365
|
}
|
|
410
366
|
removePluginNativeCode(pluginData, projectData) {
|
|
411
367
|
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
-
// not implemented
|
|
413
368
|
});
|
|
414
369
|
}
|
|
415
370
|
beforePrepareAllPlugins(projectData, dependencies) {
|
|
@@ -428,7 +383,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
428
383
|
filterUniqueDependencies(dependencies) {
|
|
429
384
|
const depsDictionary = dependencies.reduce((dict, dep) => {
|
|
430
385
|
const collision = dict[dep.name];
|
|
431
|
-
// in case there are multiple dependencies to the same module, the one declared in the package.json takes precedence
|
|
432
386
|
if (!collision || collision.depth > dep.depth) {
|
|
433
387
|
dict[dep.name] = dep;
|
|
434
388
|
}
|
|
@@ -445,7 +399,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
445
399
|
name,
|
|
446
400
|
directory: path.relative(platformDir, directory),
|
|
447
401
|
dependencies: dependencies.filter((dep) => {
|
|
448
|
-
// filter out transient dependencies that don't have native dependencies
|
|
449
402
|
return (nativeDependencyData.findIndex((nativeDep) => nativeDep.name === dep) !== -1);
|
|
450
403
|
}),
|
|
451
404
|
};
|
|
@@ -453,7 +406,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
453
406
|
nativeDependencies = topologicalSortNativeDependencies(nativeDependencies);
|
|
454
407
|
const jsonContent = JSON.stringify(nativeDependencies, null, 4);
|
|
455
408
|
this.$fs.writeFile(dependenciesJsonPath, jsonContent);
|
|
456
|
-
// we sort all the dependencies to respect the topological sorting of the native dependencies
|
|
457
409
|
return dependencies.sort(function (a, b) {
|
|
458
410
|
return (nativeDependencies.findIndex((n) => n.name === a.name) -
|
|
459
411
|
nativeDependencies.findIndex((n) => n.name === b.name));
|
|
@@ -492,7 +444,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
492
444
|
}
|
|
493
445
|
checkForChanges() {
|
|
494
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
-
// Nothing android specific to check yet.
|
|
496
447
|
});
|
|
497
448
|
}
|
|
498
449
|
getDeploymentTarget(projectData) {
|
|
@@ -503,12 +454,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
503
454
|
shell.cp(cpArg, paths, projectRoot);
|
|
504
455
|
}
|
|
505
456
|
validatePackageName(packageName) {
|
|
506
|
-
//Make the package conform to Java package types
|
|
507
|
-
//Enforce underscore limitation
|
|
508
457
|
if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(packageName)) {
|
|
509
458
|
this.$errors.fail(`Package name must look like: com.company.Name. Got: ${packageName}`);
|
|
510
459
|
}
|
|
511
|
-
//Class is a reserved word
|
|
512
460
|
if (/\b[Cc]lass\b/.test(packageName)) {
|
|
513
461
|
this.$errors.fail("class is a reserved word");
|
|
514
462
|
}
|
|
@@ -517,7 +465,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
517
465
|
if (projectName === "") {
|
|
518
466
|
this.$errors.fail("Project name cannot be empty");
|
|
519
467
|
}
|
|
520
|
-
//Classes in Java don't begin with numbers
|
|
521
468
|
if (/^[0-9]/.test(projectName)) {
|
|
522
469
|
this.$errors.fail("Project name must not begin with a number");
|
|
523
470
|
}
|
|
@@ -538,19 +485,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
538
485
|
];
|
|
539
486
|
return path.join(this.getPlatformData(projectData).projectRoot, ...resourcePath);
|
|
540
487
|
}
|
|
541
|
-
/**
|
|
542
|
-
* The purpose of this method is to delete the previously prepared user resources.
|
|
543
|
-
* The content of the `<platforms>/android/.../res` directory is based on user's resources and gradle project template from android-runtime.
|
|
544
|
-
* During preparation of the `<path to user's App_Resources>/Android` we want to clean all the users files from previous preparation,
|
|
545
|
-
* but keep the ones that were introduced during `platform add` of the android-runtime.
|
|
546
|
-
* Currently the Gradle project template contains resources only in values and values-v21 directories.
|
|
547
|
-
* So the current logic of the method is cleaning al resources from `<platforms>/android/.../res` that are not in `values.*` directories
|
|
548
|
-
* and that exist in the `<path to user's App_Resources>/Android/.../res` directory
|
|
549
|
-
* This means that if user has a resource file in values-v29 for example, builds the project and then deletes this resource,
|
|
550
|
-
* it will be kept in platforms directory. Reference issue: `https://github.com/NativeScript/nativescript-cli/issues/5083`
|
|
551
|
-
* Same is valid for files in `drawable-<resolution>` directories - in case in user's resources there's drawable-hdpi directory,
|
|
552
|
-
* which is deleted after the first build of app, it will remain in platforms directory.
|
|
553
|
-
*/
|
|
554
488
|
cleanUpPreparedResources(projectData) {
|
|
555
489
|
let resourcesDirPath = path.join(projectData.appResourcesDirectoryPath, this.getPlatformData(projectData).normalizedPlatformName);
|
|
556
490
|
if (this.$androidResourcesMigrationService.hasMigrated(projectData.appResourcesDirectoryPath)) {
|
|
@@ -576,7 +510,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
576
510
|
const hasUseKotlinPropertyInAppData = `hasUseKotlinPropertyInApp${analyticsDelimiter}${buildStatistics.kotlinUsage.hasUseKotlinPropertyInApp}`;
|
|
577
511
|
const hasKotlinRuntimeClassesData = `hasKotlinRuntimeClasses${analyticsDelimiter}${buildStatistics.kotlinUsage.hasKotlinRuntimeClasses}`;
|
|
578
512
|
yield this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
579
|
-
action: "Using Kotlin"
|
|
513
|
+
action: "Using Kotlin",
|
|
580
514
|
additionalData: `${hasUseKotlinPropertyInAppData}${analyticsDelimiter}${hasKotlinRuntimeClassesData}`,
|
|
581
515
|
});
|
|
582
516
|
}
|
|
@@ -610,4 +544,3 @@ __decorate([
|
|
|
610
544
|
], AndroidProjectService.prototype, "buildProject", null);
|
|
611
545
|
exports.AndroidProjectService = AndroidProjectService;
|
|
612
546
|
yok_1.injector.register("androidProjectService", AndroidProjectService);
|
|
613
|
-
//# sourceMappingURL=android-project-service.js.map
|
|
@@ -58,7 +58,6 @@ 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
|
|
62
61
|
this.$fs.ensureDirectoryExists(appResourcesMainSourceSetResourcesDestination);
|
|
63
62
|
this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, "java"));
|
|
64
63
|
this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, constants.ASSETS_DIR));
|
|
@@ -72,25 +71,20 @@ class AndroidResourcesMigrationService {
|
|
|
72
71
|
const resourceFiles = getFiles(appResourcesFiles);
|
|
73
72
|
resourceDirectories.forEach((dir) => {
|
|
74
73
|
if (path.basename(dir) !== "libs") {
|
|
75
|
-
// don't copy /App_Resources/Android/libs into the src/main/res/libs directory
|
|
76
74
|
this.$fs.copyFile(dir, appResourcesMainSourceSetResourcesDestination);
|
|
77
75
|
}
|
|
78
76
|
else {
|
|
79
|
-
// copy App_Resources/Android/libs to App_ResourcesNew/Android/libs
|
|
80
77
|
this.$fs.copyFile(dir, path.join(appResourcesDestination));
|
|
81
78
|
}
|
|
82
79
|
});
|
|
83
80
|
resourceFiles.forEach((file) => {
|
|
84
81
|
const fileName = path.basename(file);
|
|
85
82
|
if (fileName !== constants.MANIFEST_FILE_NAME) {
|
|
86
|
-
// don't copy AndroidManifest into /App_Resources/Android as it needs to be inside src/main/
|
|
87
83
|
this.$fs.copyFile(file, path.join(appResourcesDestination, fileName));
|
|
88
84
|
}
|
|
89
85
|
});
|
|
90
86
|
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
|
|
92
87
|
this.$fs.rename(originalAppResources, appResourcesBackup);
|
|
93
|
-
// move the new, updated app_resources to App_Resources/Android, as the de facto resources
|
|
94
88
|
this.$fs.rename(appResourcesDestination, originalAppResources);
|
|
95
89
|
});
|
|
96
90
|
}
|
|
@@ -108,4 +102,3 @@ AndroidResourcesMigrationService.ANDROID_DIR_TEMP = "Android-Updated";
|
|
|
108
102
|
AndroidResourcesMigrationService.ANDROID_DIR_OLD = "Android-Pre-v4";
|
|
109
103
|
exports.AndroidResourcesMigrationService = AndroidResourcesMigrationService;
|
|
110
104
|
yok_1.injector.register("androidResourcesMigrationService", AndroidResourcesMigrationService);
|
|
111
|
-
//# sourceMappingURL=android-resources-migration-service.js.map
|
|
@@ -80,4 +80,3 @@ 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;
|
|
194
194
|
const multiSMS = data.trustedPhoneNumbers &&
|
|
195
195
|
data.trustedPhoneNumbers.length !== 1 &&
|
|
196
|
-
data.noTrustedDevices;
|
|
196
|
+
data.noTrustedDevices;
|
|
197
197
|
let token;
|
|
198
198
|
if (data.trustedPhoneNumbers &&
|
|
199
199
|
data.trustedPhoneNumbers.length &&
|
|
@@ -207,7 +207,6 @@ 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.
|
|
211
210
|
body.mode = "sms";
|
|
212
211
|
body.phoneNumber = {
|
|
213
212
|
id: data.trustedPhoneNumbers[0].id,
|
|
@@ -271,9 +270,8 @@ function checkBits(bits, digest) {
|
|
|
271
270
|
return result;
|
|
272
271
|
}
|
|
273
272
|
function checkBit(position, buffer) {
|
|
274
|
-
const bitOffset = position & 7;
|
|
275
|
-
const byteIndex = position >> 3;
|
|
273
|
+
const bitOffset = position & 7;
|
|
274
|
+
const byteIndex = position >> 3;
|
|
276
275
|
const bit = (buffer[byteIndex] >> bitOffset) & 1;
|
|
277
276
|
return bit === 0;
|
|
278
277
|
}
|
|
279
|
-
//# sourceMappingURL=apple-portal-session-service.js.map
|
|
@@ -92,7 +92,7 @@ class AssetsGenerationService {
|
|
|
92
92
|
}
|
|
93
93
|
continue;
|
|
94
94
|
}
|
|
95
|
-
const operation = assetItem.resizeOperation || "resize"
|
|
95
|
+
const operation = assetItem.resizeOperation || "resize";
|
|
96
96
|
let tempScale = null;
|
|
97
97
|
if (assetItem.scale) {
|
|
98
98
|
if (_.isNumber(assetItem.scale)) {
|
|
@@ -117,36 +117,27 @@ class AssetsGenerationService {
|
|
|
117
117
|
}
|
|
118
118
|
let image;
|
|
119
119
|
switch (operation) {
|
|
120
|
-
case "overlayWith"
|
|
120
|
+
case "overlayWith":
|
|
121
121
|
const overlayImageScale = assetItem.overlayImageScale ||
|
|
122
122
|
constants_1.AssetConstants.defaultOverlayImageScale;
|
|
123
123
|
const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
|
|
124
124
|
image = yield this.resize(generationData.imagePath, imageResize, imageResize);
|
|
125
125
|
image = this.generateImage(background, width, height, outputPath, image);
|
|
126
126
|
break;
|
|
127
|
-
case "blank"
|
|
127
|
+
case "blank":
|
|
128
128
|
image = this.generateImage(background, width, height, outputPath);
|
|
129
129
|
break;
|
|
130
|
-
case "resize"
|
|
130
|
+
case "resize":
|
|
131
131
|
image = yield this.resize(generationData.imagePath, width, height);
|
|
132
132
|
break;
|
|
133
|
-
case "outerScale"
|
|
134
|
-
// Resize image without applying scale
|
|
133
|
+
case "outerScale":
|
|
135
134
|
image = yield this.resize(generationData.imagePath, assetItem.width, assetItem.height);
|
|
136
|
-
// The scale will apply to the underlying layer of the generated image
|
|
137
135
|
image = this.generateImage("#00000000", width, height, outputPath, image);
|
|
138
136
|
break;
|
|
139
137
|
default:
|
|
140
138
|
throw new Error(`Invalid image generation operation: ${operation}`);
|
|
141
139
|
}
|
|
142
|
-
// This code disables the alpha chanel, as some images for the Apple App Store must not have transparency.
|
|
143
140
|
if (assetItem.rgba === false) {
|
|
144
|
-
//
|
|
145
|
-
// The original code here became broken at some time and there is an issue posted here..
|
|
146
|
-
// https://github.com/oliver-moran/jimp/issues/954
|
|
147
|
-
// But NathanaelA recommended the below change and it works so maybe that's just what we go with.
|
|
148
|
-
//
|
|
149
|
-
// image = image.rgba(false);
|
|
150
141
|
image = image.colorType(2);
|
|
151
142
|
}
|
|
152
143
|
image.write(outputPath);
|
|
@@ -160,7 +151,6 @@ class AssetsGenerationService {
|
|
|
160
151
|
});
|
|
161
152
|
}
|
|
162
153
|
generateImage(background, width, height, outputPath, overlayImage) {
|
|
163
|
-
// 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.
|
|
164
154
|
const J = Jimp;
|
|
165
155
|
const backgroundColor = this.getRgbaNumber(background);
|
|
166
156
|
let image = new J(width, height, backgroundColor);
|
|
@@ -186,4 +176,3 @@ __decorate([
|
|
|
186
176
|
], AssetsGenerationService.prototype, "generateSplashScreens", null);
|
|
187
177
|
exports.AssetsGenerationService = AssetsGenerationService;
|
|
188
178
|
yok_1.injector.register("assetsGenerationService", AssetsGenerationService);
|
|
189
|
-
//# 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();
|
|
79
79
|
return packages[0];
|
|
80
80
|
}
|
|
81
81
|
getApplicationPackagesCore(candidates, validPackageNames) {
|
|
@@ -96,4 +96,3 @@ 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",
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
97
97
|
jsCommand,
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -121,8 +121,6 @@ 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
|
|
126
124
|
getCleanupProcess() {
|
|
127
125
|
return new Promise((resolve, reject) => {
|
|
128
126
|
const cleanupProcessArgs = this.getCleanupProcessArgs();
|
|
@@ -141,12 +139,11 @@ class CleanupService {
|
|
|
141
139
|
clearTimeout(timeoutId);
|
|
142
140
|
if (!isSettled) {
|
|
143
141
|
isSettled = true;
|
|
144
|
-
// In case we throw error here, CLI will break its execution.
|
|
145
142
|
reject(err);
|
|
146
143
|
}
|
|
147
144
|
});
|
|
148
145
|
cleanupProcess.on("message", (data) => {
|
|
149
|
-
if (data === "ProcessReadyToReceive"
|
|
146
|
+
if (data === "ProcessReadyToReceive") {
|
|
150
147
|
clearTimeout(timeoutId);
|
|
151
148
|
if (!isSettled) {
|
|
152
149
|
isSettled = true;
|
|
@@ -195,4 +192,3 @@ __decorate([
|
|
|
195
192
|
], CleanupService.prototype, "getCleanupProcess", null);
|
|
196
193
|
exports.CleanupService = CleanupService;
|
|
197
194
|
yok_1.injector.register("cleanupService", CleanupService);
|
|
198
|
-
//# sourceMappingURL=cleanup-service.js.map
|
|
@@ -82,7 +82,6 @@ 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
|
|
86
85
|
if (platformMatch && platformMatch[0] && !platformMatch[2]) {
|
|
87
86
|
selectedPlatformData = {
|
|
88
87
|
version: null,
|
|
@@ -91,7 +90,6 @@ class CocoaPodsPlatformManager {
|
|
|
91
90
|
};
|
|
92
91
|
return false;
|
|
93
92
|
}
|
|
94
|
-
// platform with version
|
|
95
93
|
if (platformMatch && platformMatch[0] && platformMatch[2]) {
|
|
96
94
|
if (!selectedPlatformData ||
|
|
97
95
|
semver.gt(semver.coerce(platformMatch[2]), semver.coerce(selectedPlatformData.version))) {
|
|
@@ -106,12 +104,6 @@ class CocoaPodsPlatformManager {
|
|
|
106
104
|
return selectedPlatformData;
|
|
107
105
|
}
|
|
108
106
|
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
|
|
115
107
|
const appResourcesPodfilePath = path.join(projectData.getAppResourcesDirectoryPath(), "iOS", constants_1.PODFILE_NAME);
|
|
116
108
|
const isFromAppResources = oldPodfilePlatformData.path !== appResourcesPodfilePath &&
|
|
117
109
|
currentPodfilePlatformData.path === appResourcesPodfilePath;
|
|
@@ -143,4 +135,3 @@ class CocoaPodsPlatformManager {
|
|
|
143
135
|
}
|
|
144
136
|
exports.CocoaPodsPlatformManager = CocoaPodsPlatformManager;
|
|
145
137
|
yok_1.injector.register("cocoaPodsPlatformManager", CocoaPodsPlatformManager);
|
|
146
|
-
//# sourceMappingURL=cocoapods-platform-manager.js.map
|
|
@@ -44,12 +44,6 @@ 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.
|
|
53
47
|
const res = yield this.$childProcess
|
|
54
48
|
.exec("arch -x86_64 pod --version", null, {
|
|
55
49
|
showStderr: true,
|
|
@@ -63,11 +57,8 @@ class CocoaPodsService {
|
|
|
63
57
|
podTool = "arch";
|
|
64
58
|
}
|
|
65
59
|
}
|
|
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.
|
|
67
60
|
const podInstallResult = yield this.$childProcess.spawnFromEvent(podTool, args, "close", { cwd: projectRoot, stdio: ["pipe", process.stdout, process.stdout] }, { throwError: false });
|
|
68
61
|
if (podInstallResult.exitCode !== 0) {
|
|
69
|
-
// https://github.com/CocoaPods/CocoaPods/blob/92aaf0f1120d32f3487960b485fb69fcaf61486c/lib/cocoapods/resolver.rb#L498
|
|
70
|
-
// TODO add article
|
|
71
62
|
const versionResolutionHint = podInstallResult.exitCode === 31
|
|
72
63
|
? `For more information on resolving CocoaPod issues in NativeScript read.`
|
|
73
64
|
: "";
|
|
@@ -105,7 +96,6 @@ ${versionResolutionHint}`);
|
|
|
105
96
|
applyPodfileArchExclusions(projectData, platformData) {
|
|
106
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
98
|
const xcodeVersionData = yield this.$xcodeSelectService.getXcodeVersion();
|
|
108
|
-
// only apply EXCLUDED_ARCHS workaround on XCode 12
|
|
109
99
|
if (+xcodeVersionData.major !== 12) {
|
|
110
100
|
return;
|
|
111
101
|
}
|
|
@@ -124,7 +114,6 @@ end`.trim();
|
|
|
124
114
|
this.$fs.writeFile(exclusionsPodfile, exclusions);
|
|
125
115
|
}
|
|
126
116
|
yield this.applyPodfileToProject("NativeScript-CLI-Architecture-Exclusions", exclusionsPodfile, projectData, platformData);
|
|
127
|
-
// clean up
|
|
128
117
|
this.$fs.deleteFile(exclusionsPodfile);
|
|
129
118
|
});
|
|
130
119
|
}
|
|
@@ -149,7 +138,6 @@ end`.trim();
|
|
|
149
138
|
podfilePath: path.join(extensionFolderPath, name, constants.PODFILE_NAME),
|
|
150
139
|
}));
|
|
151
140
|
extensionsPodfile.forEach(({ targetName, podfilePath }) => {
|
|
152
|
-
// Remove the data between #Begin Podfile and #EndPodfile
|
|
153
141
|
const regExpToRemove = new RegExp(`${this.getExtensionPodfileHeader(podfilePath, targetName)}[\\s\\S]*?${this.getExtensionPodfileEnd()}`, "mg");
|
|
154
142
|
projectPodFileContent = projectPodFileContent.replace(regExpToRemove, "");
|
|
155
143
|
if (this.$fs.exists(podfilePath)) {
|
|
@@ -178,7 +166,6 @@ end`.trim();
|
|
|
178
166
|
? this.$fs.readText(pathToProjectPodfile).trim()
|
|
179
167
|
: "";
|
|
180
168
|
if (projectPodfileContent.indexOf(podfileContent) === -1) {
|
|
181
|
-
// Remove old occurences of the plugin from the project's Podfile.
|
|
182
169
|
this.removePodfileFromProject(moduleName, podfilePath, projectData, nativeProjectPath);
|
|
183
170
|
let finalPodfileContent = this.$fs.exists(pathToProjectPodfile)
|
|
184
171
|
? this.getPodfileContentWithoutTarget(projectData, this.$fs.readText(pathToProjectPodfile))
|
|
@@ -197,7 +184,6 @@ end`.trim();
|
|
|
197
184
|
removePodfileFromProject(moduleName, podfilePath, projectData, projectRoot) {
|
|
198
185
|
if (this.$fs.exists(this.getProjectPodfilePath(projectRoot))) {
|
|
199
186
|
let projectPodFileContent = this.$fs.readText(this.getProjectPodfilePath(projectRoot));
|
|
200
|
-
// Remove the data between #Begin Podfile and #EndPodfile
|
|
201
187
|
const regExpToRemove = new RegExp(`${this.getPluginPodfileHeader(podfilePath)}[\\s\\S]*?${this.getPluginPodfileEnd()}`, "mg");
|
|
202
188
|
projectPodFileContent = projectPodFileContent.replace(regExpToRemove, "");
|
|
203
189
|
projectPodFileContent = this.removePostInstallHook(moduleName, projectPodFileContent);
|
|
@@ -218,7 +204,7 @@ end`.trim();
|
|
|
218
204
|
}
|
|
219
205
|
}
|
|
220
206
|
getPluginPodfilePath(pluginData) {
|
|
221
|
-
const pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath("ios"
|
|
207
|
+
const pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath("ios");
|
|
222
208
|
const pluginPodFilePath = path.join(pluginPlatformsFolderPath, constants_1.PODFILE_NAME);
|
|
223
209
|
return pluginPodFilePath;
|
|
224
210
|
}
|
|
@@ -254,7 +240,6 @@ end`.trim();
|
|
|
254
240
|
if (_.startsWith(projectPodfileContent, podFileHeader)) {
|
|
255
241
|
projectPodfileContent = projectPodfileContent.substr(podFileHeader.length);
|
|
256
242
|
const podFileFooter = this.getPodfileFooter();
|
|
257
|
-
// Only remove the final end in case the file starts with the podFileHeader
|
|
258
243
|
if (_.endsWith(projectPodfileContent, podFileFooter)) {
|
|
259
244
|
projectPodfileContent = projectPodfileContent.substr(0, projectPodfileContent.length - podFileFooter.length);
|
|
260
245
|
}
|
|
@@ -275,8 +260,6 @@ end`.trim();
|
|
|
275
260
|
return projectPodFileContent;
|
|
276
261
|
}
|
|
277
262
|
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
|
|
280
263
|
const replacedPluginName = pluginName
|
|
281
264
|
.replace(/_/g, "___")
|
|
282
265
|
.replace(/[^A-Za-z0-9_]/g, "_");
|
|
@@ -290,7 +273,6 @@ end`.trim();
|
|
|
290
273
|
const newFunctionName = `${this.getHookBasicFuncNameForPlugin(hookName, pluginName)}_${newFunctions.length}`;
|
|
291
274
|
let newDefinition = `def ${newFunctionName}`;
|
|
292
275
|
const rubyFunction = { functionName: newFunctionName };
|
|
293
|
-
// firstGroup is the block parameter, secondGroup is the block parameter name.
|
|
294
276
|
if (firstGroup && secondGroup) {
|
|
295
277
|
newDefinition = `${newDefinition} (${secondGroup})`;
|
|
296
278
|
rubyFunction.functionParameters = secondGroup;
|
|
@@ -301,7 +283,6 @@ end`.trim();
|
|
|
301
283
|
return { replacedContent, newFunctions };
|
|
302
284
|
}
|
|
303
285
|
getPluginPodfileHeader(pluginPodFilePath) {
|
|
304
|
-
// escape special + from the podfile path (pnpm)
|
|
305
286
|
pluginPodFilePath = pluginPodFilePath.replace(/\+/g, "\\+");
|
|
306
287
|
return `# Begin Podfile - ${pluginPodFilePath}`;
|
|
307
288
|
}
|
|
@@ -371,4 +352,3 @@ CocoaPodsService.PODFILE_POST_INSTALL_SECTION_NAME = "post_install";
|
|
|
371
352
|
CocoaPodsService.INSTALLER_BLOCK_PARAMETER_NAME = "installer";
|
|
372
353
|
exports.CocoaPodsService = CocoaPodsService;
|
|
373
354
|
yok_1.injector.register("cocoapodsService", CocoaPodsService);
|
|
374
|
-
//# sourceMappingURL=cocoapods-service.js.map
|