nativescript 8.7.2 → 8.8.0-embed.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- package/lib/commands/add-platform.js +1 -2
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +0 -4
- package/lib/commands/build.js +2 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -3
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +1 -6
- package/lib/commands/deploy.js +2 -3
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +2 -12
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +2 -3
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +2 -9
- package/lib/commands/typings.js +1 -2
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +2 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +1 -20
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +3 -91
- package/lib/controllers/platform-controller.js +1 -9
- package/lib/controllers/prepare-controller.js +10 -17
- package/lib/controllers/run-controller.js +1 -17
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +2 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +1 -1
- package/lib/data/run-data.js +0 -1
- package/lib/declarations.d.ts +12 -2
- package/lib/definitions/platform.d.ts +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +17 -10
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +2 -3
- package/lib/key-commands/index.js +4 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -10
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +123 -141
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +1 -2
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +0 -3
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +12 -34
- package/lib/services/android-project-service.js +22 -86
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
- package/lib/services/assets-generation/assets-generation-service.js +13 -17
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/cleanup-service.js +9 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +3 -3
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +1 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +0 -4
- package/lib/services/ios/spm-service.js +0 -9
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- package/lib/services/ios/xcodebuild-service.js +0 -1
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +4 -6
- package/lib/services/ios-project-service.js +24 -26
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -7
- package/lib/services/livesync/android-livesync-service.js +2 -3
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +2 -4
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +4 -8
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +3 -17
- package/lib/services/marking-mode-service.js +5 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +1 -3
- package/lib/services/platform/add-platform-service.js +9 -48
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +8 -8
- package/lib/services/platform-environment-requirements.js +6 -9
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +9 -19
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +11 -13
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +1 -18
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -1
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +2 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/webpack/webpack-compiler-service.js +15 -48
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +12 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- package/package.json +2 -2
- package/vendor/gradle-plugin/build.gradle +21 -6
- package/vendor/gradle-plugin/settings.gradle +13 -3
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +0 -15
- package/node_modules/rimraf/CHANGELOG.md +0 -65
- package/node_modules/stringify-package/CHANGELOG.md +0 -16
|
@@ -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
|
}
|
|
@@ -104,30 +69,32 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
104
69
|
throw new Error("First call of getPlatformData without providing projectData.");
|
|
105
70
|
}
|
|
106
71
|
if (projectData && projectData.platformsDir) {
|
|
107
|
-
const projectRoot =
|
|
72
|
+
const projectRoot = this.$options.nativeHost
|
|
73
|
+
? this.$options.nativeHost
|
|
74
|
+
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
108
75
|
const appDestinationDirectoryArr = [
|
|
109
76
|
projectRoot,
|
|
110
|
-
|
|
77
|
+
this.$options.nativeHostModule,
|
|
111
78
|
constants.SRC_DIR,
|
|
112
79
|
constants.MAIN_DIR,
|
|
113
80
|
constants.ASSETS_DIR,
|
|
114
81
|
];
|
|
115
82
|
const configurationsDirectoryArr = [
|
|
116
83
|
projectRoot,
|
|
117
|
-
|
|
84
|
+
this.$options.nativeHostModule,
|
|
118
85
|
constants.SRC_DIR,
|
|
119
86
|
constants.MAIN_DIR,
|
|
120
87
|
constants.MANIFEST_FILE_NAME,
|
|
121
88
|
];
|
|
122
89
|
const deviceBuildOutputArr = [
|
|
123
90
|
projectRoot,
|
|
124
|
-
|
|
91
|
+
this.$options.nativeHostModule,
|
|
125
92
|
constants.BUILD_DIR,
|
|
126
93
|
constants.OUTPUTS_DIR,
|
|
127
94
|
constants.APK_DIR,
|
|
128
95
|
];
|
|
129
96
|
const packageName = this.getProjectNameFromId(projectData);
|
|
130
|
-
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android"
|
|
97
|
+
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android");
|
|
131
98
|
this._platformData = {
|
|
132
99
|
frameworkPackageName: runtimePackage.name,
|
|
133
100
|
normalizedPlatformName: "Android",
|
|
@@ -137,7 +104,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
137
104
|
projectRoot: projectRoot,
|
|
138
105
|
getBuildOutputPath: (buildOptions) => {
|
|
139
106
|
if (buildOptions.androidBundle) {
|
|
140
|
-
return path.join(projectRoot,
|
|
107
|
+
return path.join(projectRoot, this.$options.nativeHostModule, constants.BUILD_DIR, constants.OUTPUTS_DIR, constants.BUNDLE_DIR);
|
|
141
108
|
}
|
|
142
109
|
return path.join(...deviceBuildOutputArr);
|
|
143
110
|
},
|
|
@@ -148,8 +115,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
148
115
|
if (buildOptions.androidBundle) {
|
|
149
116
|
return {
|
|
150
117
|
packageNames: [
|
|
151
|
-
`${
|
|
152
|
-
`${
|
|
118
|
+
`${this.$options.nativeHostModule}${constants.AAB_EXTENSION_NAME}`,
|
|
119
|
+
`${this.$options.nativeHostModule}-${buildMode}${constants.AAB_EXTENSION_NAME}`,
|
|
153
120
|
],
|
|
154
121
|
};
|
|
155
122
|
}
|
|
@@ -158,17 +125,17 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
158
125
|
`${packageName}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
159
126
|
`${projectData.projectName}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
160
127
|
`${projectData.projectName}${constants.APK_EXTENSION_NAME}`,
|
|
161
|
-
`${
|
|
128
|
+
`${this.$options.nativeHostModule}-${buildMode}${constants.APK_EXTENSION_NAME}`,
|
|
162
129
|
],
|
|
163
130
|
regexes: [
|
|
164
|
-
new RegExp(`(${packageName}|${
|
|
131
|
+
new RegExp(`(${packageName}|${this.$options.nativeHostModule})-.*-(${constants_1.Configurations.Debug}|${constants_1.Configurations.Release})(-unsigned)?${constants.APK_EXTENSION_NAME}`, "i"),
|
|
165
132
|
],
|
|
166
133
|
};
|
|
167
134
|
},
|
|
168
135
|
configurationFileName: constants.MANIFEST_FILE_NAME,
|
|
169
136
|
configurationFilePath: path.join(...configurationsDirectoryArr),
|
|
170
137
|
relativeToFrameworkConfigurationFilePath: path.join(constants.SRC_DIR, constants.MAIN_DIR, constants.MANIFEST_FILE_NAME),
|
|
171
|
-
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
|
|
138
|
+
fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
|
|
172
139
|
};
|
|
173
140
|
}
|
|
174
141
|
return this._platformData;
|
|
@@ -223,7 +190,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
223
190
|
const targetSdkVersion = androidToolsInfo && androidToolsInfo.targetSdkVersion;
|
|
224
191
|
this.$logger.trace(`Using Android SDK '${targetSdkVersion}'.`);
|
|
225
192
|
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
193
|
this.cleanResValues(targetSdkVersion, projectData);
|
|
228
194
|
});
|
|
229
195
|
}
|
|
@@ -257,7 +223,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
257
223
|
}
|
|
258
224
|
interpolateData(projectData) {
|
|
259
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
// Interpolate the apilevel and package
|
|
261
226
|
this.interpolateConfigurationFile(projectData);
|
|
262
227
|
const appResourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
|
|
263
228
|
let stringsFilePath;
|
|
@@ -273,10 +238,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
273
238
|
const gradleSettingsFilePath = path.join(this.getPlatformData(projectData).projectRoot, "settings.gradle");
|
|
274
239
|
shell.sed("-i", /__PROJECT_NAME__/, this.getProjectNameFromId(projectData), gradleSettingsFilePath);
|
|
275
240
|
try {
|
|
276
|
-
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
|
|
277
241
|
const appGradleContent = this.$fs.readText(projectData.appGradlePath);
|
|
278
242
|
if (appGradleContent.indexOf(constants.PACKAGE_PLACEHOLDER_NAME) !== -1) {
|
|
279
|
-
//TODO: For compatibility with old templates. Once all templates are updated should delete.
|
|
280
243
|
shell.sed("-i", new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectIdentifiers.android, projectData.appGradlePath);
|
|
281
244
|
}
|
|
282
245
|
}
|
|
@@ -286,8 +249,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
286
249
|
});
|
|
287
250
|
}
|
|
288
251
|
interpolateConfigurationFile(projectData) {
|
|
289
|
-
const manifestPath = this.getPlatformData(projectData)
|
|
290
|
-
.configurationFilePath;
|
|
252
|
+
const manifestPath = this.getPlatformData(projectData).configurationFilePath;
|
|
291
253
|
shell.sed("-i", /__PACKAGE__/, projectData.projectIdentifiers.android, manifestPath);
|
|
292
254
|
}
|
|
293
255
|
getProjectNameFromId(projectData) {
|
|
@@ -329,14 +291,13 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
329
291
|
});
|
|
330
292
|
}
|
|
331
293
|
isPlatformPrepared(projectRoot, projectData) {
|
|
332
|
-
return this.$fs.exists(path.join(this.getPlatformData(projectData).appDestinationDirectoryPath,
|
|
294
|
+
return this.$fs.exists(path.join(this.getPlatformData(projectData).appDestinationDirectoryPath, this.$options.nativeHostModule));
|
|
333
295
|
}
|
|
334
296
|
getFrameworkFilesExtensions() {
|
|
335
297
|
return [".jar", ".dat"];
|
|
336
298
|
}
|
|
337
299
|
prepareProject() {
|
|
338
300
|
return __awaiter(this, void 0, void 0, function* () {
|
|
339
|
-
// Intentionally left empty.
|
|
340
301
|
});
|
|
341
302
|
}
|
|
342
303
|
ensureConfigurationFileInAppResources(projectData) {
|
|
@@ -354,7 +315,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
354
315
|
this.$logger.warn("No manifest found in " + originalAndroidManifestFilePath);
|
|
355
316
|
return;
|
|
356
317
|
}
|
|
357
|
-
// Overwrite the AndroidManifest from runtime.
|
|
358
318
|
if (!appResourcesDirStructureHasMigrated) {
|
|
359
319
|
this.$fs.copyFile(originalAndroidManifestFilePath, this.getPlatformData(projectData).configurationFilePath);
|
|
360
320
|
}
|
|
@@ -371,8 +331,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
371
331
|
}
|
|
372
332
|
else {
|
|
373
333
|
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
334
|
this.$fs.deleteDirectory(path.join(platformsAppResourcesPath, "libs"));
|
|
377
335
|
}
|
|
378
336
|
const androidToolsInfo = this.$androidToolsInfo.getToolsInfo({
|
|
@@ -383,7 +341,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
383
341
|
}
|
|
384
342
|
preparePluginNativeCode(pluginData, projectData) {
|
|
385
343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
-
// build Android plugins which contain AndroidManifest.xml and/or resources
|
|
387
344
|
const pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
388
345
|
if (this.$fs.exists(pluginPlatformsFolderPath)) {
|
|
389
346
|
const options = {
|
|
@@ -409,7 +366,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
409
366
|
}
|
|
410
367
|
removePluginNativeCode(pluginData, projectData) {
|
|
411
368
|
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
-
// not implemented
|
|
413
369
|
});
|
|
414
370
|
}
|
|
415
371
|
beforePrepareAllPlugins(projectData, dependencies) {
|
|
@@ -428,7 +384,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
428
384
|
filterUniqueDependencies(dependencies) {
|
|
429
385
|
const depsDictionary = dependencies.reduce((dict, dep) => {
|
|
430
386
|
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
387
|
if (!collision || collision.depth > dep.depth) {
|
|
433
388
|
dict[dep.name] = dep;
|
|
434
389
|
}
|
|
@@ -437,7 +392,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
437
392
|
return _.values(depsDictionary);
|
|
438
393
|
}
|
|
439
394
|
provideDependenciesJson(projectData, dependencies) {
|
|
440
|
-
const platformDir =
|
|
395
|
+
const platformDir = this.$options.nativeHost
|
|
396
|
+
? this.$options.nativeHost
|
|
397
|
+
: path.join(projectData.platformsDir, AndroidProjectService.ANDROID_PLATFORM_NAME);
|
|
441
398
|
const dependenciesJsonPath = path.join(platformDir, constants.DEPENDENCIES_JSON_NAME);
|
|
442
399
|
let nativeDependencyData = dependencies.filter(AndroidProjectService.isNativeAndroidDependency);
|
|
443
400
|
let nativeDependencies = nativeDependencyData.map(({ name, directory, dependencies }) => {
|
|
@@ -445,7 +402,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
445
402
|
name,
|
|
446
403
|
directory: path.relative(platformDir, directory),
|
|
447
404
|
dependencies: dependencies.filter((dep) => {
|
|
448
|
-
// filter out transient dependencies that don't have native dependencies
|
|
449
405
|
return (nativeDependencyData.findIndex((nativeDep) => nativeDep.name === dep) !== -1);
|
|
450
406
|
}),
|
|
451
407
|
};
|
|
@@ -453,7 +409,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
453
409
|
nativeDependencies = topologicalSortNativeDependencies(nativeDependencies);
|
|
454
410
|
const jsonContent = JSON.stringify(nativeDependencies, null, 4);
|
|
455
411
|
this.$fs.writeFile(dependenciesJsonPath, jsonContent);
|
|
456
|
-
// we sort all the dependencies to respect the topological sorting of the native dependencies
|
|
457
412
|
return dependencies.sort(function (a, b) {
|
|
458
413
|
return (nativeDependencies.findIndex((n) => n.name === a.name) -
|
|
459
414
|
nativeDependencies.findIndex((n) => n.name === b.name));
|
|
@@ -492,7 +447,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
492
447
|
}
|
|
493
448
|
checkForChanges() {
|
|
494
449
|
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
-
// Nothing android specific to check yet.
|
|
496
450
|
});
|
|
497
451
|
}
|
|
498
452
|
getDeploymentTarget(projectData) {
|
|
@@ -503,12 +457,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
503
457
|
shell.cp(cpArg, paths, projectRoot);
|
|
504
458
|
}
|
|
505
459
|
validatePackageName(packageName) {
|
|
506
|
-
//Make the package conform to Java package types
|
|
507
|
-
//Enforce underscore limitation
|
|
508
460
|
if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(packageName)) {
|
|
509
461
|
this.$errors.fail(`Package name must look like: com.company.Name. Got: ${packageName}`);
|
|
510
462
|
}
|
|
511
|
-
//Class is a reserved word
|
|
512
463
|
if (/\b[Cc]lass\b/.test(packageName)) {
|
|
513
464
|
this.$errors.fail("class is a reserved word");
|
|
514
465
|
}
|
|
@@ -517,14 +468,13 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
517
468
|
if (projectName === "") {
|
|
518
469
|
this.$errors.fail("Project name cannot be empty");
|
|
519
470
|
}
|
|
520
|
-
//Classes in Java don't begin with numbers
|
|
521
471
|
if (/^[0-9]/.test(projectName)) {
|
|
522
472
|
this.$errors.fail("Project name must not begin with a number");
|
|
523
473
|
}
|
|
524
474
|
}
|
|
525
475
|
getLegacyAppResourcesDestinationDirPath(projectData) {
|
|
526
476
|
const resourcePath = [
|
|
527
|
-
|
|
477
|
+
this.$options.nativeHostModule,
|
|
528
478
|
constants.SRC_DIR,
|
|
529
479
|
constants.MAIN_DIR,
|
|
530
480
|
constants.RESOURCES_DIR,
|
|
@@ -533,24 +483,11 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
533
483
|
}
|
|
534
484
|
getUpdatedAppResourcesDestinationDirPath(projectData) {
|
|
535
485
|
const resourcePath = [
|
|
536
|
-
|
|
486
|
+
this.$options.nativeHostModule,
|
|
537
487
|
constants.SRC_DIR,
|
|
538
488
|
];
|
|
539
489
|
return path.join(this.getPlatformData(projectData).projectRoot, ...resourcePath);
|
|
540
490
|
}
|
|
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
491
|
cleanUpPreparedResources(projectData) {
|
|
555
492
|
let resourcesDirPath = path.join(projectData.appResourcesDirectoryPath, this.getPlatformData(projectData).normalizedPlatformName);
|
|
556
493
|
if (this.$androidResourcesMigrationService.hasMigrated(projectData.appResourcesDirectoryPath)) {
|
|
@@ -576,7 +513,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
|
|
|
576
513
|
const hasUseKotlinPropertyInAppData = `hasUseKotlinPropertyInApp${analyticsDelimiter}${buildStatistics.kotlinUsage.hasUseKotlinPropertyInApp}`;
|
|
577
514
|
const hasKotlinRuntimeClassesData = `hasKotlinRuntimeClasses${analyticsDelimiter}${buildStatistics.kotlinUsage.hasKotlinRuntimeClasses}`;
|
|
578
515
|
yield this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
579
|
-
action: "Using Kotlin"
|
|
516
|
+
action: "Using Kotlin",
|
|
580
517
|
additionalData: `${hasUseKotlinPropertyInAppData}${analyticsDelimiter}${hasKotlinRuntimeClassesData}`,
|
|
581
518
|
});
|
|
582
519
|
}
|
|
@@ -610,4 +547,3 @@ __decorate([
|
|
|
610
547
|
], AndroidProjectService.prototype, "buildProject", null);
|
|
611
548
|
exports.AndroidProjectService = AndroidProjectService;
|
|
612
549
|
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
|
|
@@ -30,13 +30,17 @@ class AssetsGenerationService {
|
|
|
30
30
|
splash: ["splashBackgrounds", "splashCenterImages", "splashImages"],
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
constructor($logger, $projectDataService, $fs) {
|
|
33
|
+
constructor($logger, $projectDataService, $fs, $options) {
|
|
34
34
|
this.$logger = $logger;
|
|
35
35
|
this.$projectDataService = $projectDataService;
|
|
36
36
|
this.$fs = $fs;
|
|
37
|
+
this.$options = $options;
|
|
37
38
|
}
|
|
38
39
|
generateIcons(resourceGenerationData) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (this.$options.nativeHost) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
40
44
|
this.$logger.info("Generating icons ...");
|
|
41
45
|
yield this.generateImagesForDefinitions(resourceGenerationData, this.propertiesToEnumerate.icon);
|
|
42
46
|
this.$logger.info("Icons generation completed.");
|
|
@@ -44,6 +48,9 @@ class AssetsGenerationService {
|
|
|
44
48
|
}
|
|
45
49
|
generateSplashScreens(splashesGenerationData) {
|
|
46
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
if (this.$options.nativeHost) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
47
54
|
this.$logger.info("Generating splash screens ...");
|
|
48
55
|
yield this.generateImagesForDefinitions(splashesGenerationData, this.propertiesToEnumerate.splash);
|
|
49
56
|
this.$logger.info("Splash screens generation completed.");
|
|
@@ -92,7 +99,7 @@ class AssetsGenerationService {
|
|
|
92
99
|
}
|
|
93
100
|
continue;
|
|
94
101
|
}
|
|
95
|
-
const operation = assetItem.resizeOperation || "resize"
|
|
102
|
+
const operation = assetItem.resizeOperation || "resize";
|
|
96
103
|
let tempScale = null;
|
|
97
104
|
if (assetItem.scale) {
|
|
98
105
|
if (_.isNumber(assetItem.scale)) {
|
|
@@ -117,36 +124,27 @@ class AssetsGenerationService {
|
|
|
117
124
|
}
|
|
118
125
|
let image;
|
|
119
126
|
switch (operation) {
|
|
120
|
-
case "overlayWith"
|
|
127
|
+
case "overlayWith":
|
|
121
128
|
const overlayImageScale = assetItem.overlayImageScale ||
|
|
122
129
|
constants_1.AssetConstants.defaultOverlayImageScale;
|
|
123
130
|
const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
|
|
124
131
|
image = yield this.resize(generationData.imagePath, imageResize, imageResize);
|
|
125
132
|
image = this.generateImage(background, width, height, outputPath, image);
|
|
126
133
|
break;
|
|
127
|
-
case "blank"
|
|
134
|
+
case "blank":
|
|
128
135
|
image = this.generateImage(background, width, height, outputPath);
|
|
129
136
|
break;
|
|
130
|
-
case "resize"
|
|
137
|
+
case "resize":
|
|
131
138
|
image = yield this.resize(generationData.imagePath, width, height);
|
|
132
139
|
break;
|
|
133
|
-
case "outerScale"
|
|
134
|
-
// Resize image without applying scale
|
|
140
|
+
case "outerScale":
|
|
135
141
|
image = yield this.resize(generationData.imagePath, assetItem.width, assetItem.height);
|
|
136
|
-
// The scale will apply to the underlying layer of the generated image
|
|
137
142
|
image = this.generateImage("#00000000", width, height, outputPath, image);
|
|
138
143
|
break;
|
|
139
144
|
default:
|
|
140
145
|
throw new Error(`Invalid image generation operation: ${operation}`);
|
|
141
146
|
}
|
|
142
|
-
// This code disables the alpha chanel, as some images for the Apple App Store must not have transparency.
|
|
143
147
|
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
148
|
image = image.colorType(2);
|
|
151
149
|
}
|
|
152
150
|
image.write(outputPath);
|
|
@@ -160,7 +158,6 @@ class AssetsGenerationService {
|
|
|
160
158
|
});
|
|
161
159
|
}
|
|
162
160
|
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
161
|
const J = Jimp;
|
|
165
162
|
const backgroundColor = this.getRgbaNumber(background);
|
|
166
163
|
let image = new J(width, height, backgroundColor);
|
|
@@ -186,4 +183,3 @@ __decorate([
|
|
|
186
183
|
], AssetsGenerationService.prototype, "generateSplashScreens", null);
|
|
187
184
|
exports.AssetsGenerationService = AssetsGenerationService;
|
|
188
185
|
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
|