nativescript 9.0.4-dev.0 → 9.0.4-dev.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.
Files changed (329) hide show
  1. package/lib/android-tools-info.js +0 -12
  2. package/lib/base-package-manager.js +0 -7
  3. package/lib/bootstrap.js +1 -5
  4. package/lib/bun-package-manager.js +1 -14
  5. package/lib/color.js +0 -4
  6. package/lib/commands/add-platform.js +0 -1
  7. package/lib/commands/apple-login.js +0 -1
  8. package/lib/commands/appstore-list.js +0 -1
  9. package/lib/commands/appstore-upload.js +0 -3
  10. package/lib/commands/build.js +2 -3
  11. package/lib/commands/clean.js +1 -22
  12. package/lib/commands/command-base.js +0 -1
  13. package/lib/commands/config.js +0 -5
  14. package/lib/commands/create-project.js +0 -6
  15. package/lib/commands/debug.js +1 -6
  16. package/lib/commands/deploy.js +2 -3
  17. package/lib/commands/embedding/embed.js +0 -7
  18. package/lib/commands/extensibility/install-extension.js +0 -1
  19. package/lib/commands/extensibility/list-extensions.js +0 -1
  20. package/lib/commands/extensibility/uninstall-extension.js +0 -1
  21. package/lib/commands/fonts.js +0 -1
  22. package/lib/commands/generate-assets.js +0 -1
  23. package/lib/commands/generate-help.js +0 -1
  24. package/lib/commands/generate.js +1 -48
  25. package/lib/commands/hooks/common.js +1 -2
  26. package/lib/commands/hooks/hooks-lock.js +0 -1
  27. package/lib/commands/hooks/hooks.js +0 -1
  28. package/lib/commands/info.js +0 -1
  29. package/lib/commands/install.js +0 -1
  30. package/lib/commands/list-platforms.js +0 -1
  31. package/lib/commands/migrate.js +0 -1
  32. package/lib/commands/native-add.js +0 -5
  33. package/lib/commands/platform-clean.js +0 -1
  34. package/lib/commands/plugin/add-plugin.js +0 -1
  35. package/lib/commands/plugin/build-plugin.js +0 -1
  36. package/lib/commands/plugin/create-plugin.js +0 -5
  37. package/lib/commands/plugin/list-plugins.js +0 -1
  38. package/lib/commands/plugin/remove-plugin.js +0 -2
  39. package/lib/commands/plugin/update-plugin.js +0 -1
  40. package/lib/commands/post-install.js +0 -6
  41. package/lib/commands/prepare.js +3 -4
  42. package/lib/commands/preview.js +0 -2
  43. package/lib/commands/remove-platform.js +0 -1
  44. package/lib/commands/resources/resources-update.js +0 -2
  45. package/lib/commands/run.js +0 -1
  46. package/lib/commands/setup.js +0 -1
  47. package/lib/commands/start.js +0 -1
  48. package/lib/commands/test-init.js +0 -4
  49. package/lib/commands/test.js +2 -9
  50. package/lib/commands/typings.js +1 -2
  51. package/lib/commands/update-platform.js +0 -5
  52. package/lib/commands/update.js +0 -2
  53. package/lib/commands/widget.js +1 -20
  54. package/lib/common/bootstrap.js +0 -1
  55. package/lib/common/child-process.js +0 -3
  56. package/lib/common/codeGeneration/code-entity.js +0 -1
  57. package/lib/common/codeGeneration/code-printer.js +0 -1
  58. package/lib/common/command-params.js +0 -1
  59. package/lib/common/commands/analytics.js +0 -3
  60. package/lib/common/commands/autocompletion.js +0 -3
  61. package/lib/common/commands/device/device-log-stream.js +0 -1
  62. package/lib/common/commands/device/get-file.js +0 -2
  63. package/lib/common/commands/device/list-applications.js +0 -1
  64. package/lib/common/commands/device/list-devices.js +0 -3
  65. package/lib/common/commands/device/list-files.js +0 -2
  66. package/lib/common/commands/device/put-file.js +0 -2
  67. package/lib/common/commands/device/run-application.js +0 -1
  68. package/lib/common/commands/device/stop-application.js +0 -1
  69. package/lib/common/commands/device/uninstall-application.js +0 -1
  70. package/lib/common/commands/doctor.js +2 -3
  71. package/lib/common/commands/generate-messages.js +0 -1
  72. package/lib/common/commands/help.js +0 -1
  73. package/lib/common/commands/package-manager-get.js +0 -1
  74. package/lib/common/commands/package-manager-set.js +0 -1
  75. package/lib/common/commands/post-install.js +0 -1
  76. package/lib/common/commands/preuninstall.js +2 -11
  77. package/lib/common/commands/proxy/proxy-base.js +0 -4
  78. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  79. package/lib/common/commands/proxy/proxy-get.js +0 -1
  80. package/lib/common/commands/proxy/proxy-set.js +0 -1
  81. package/lib/common/common-lib.js +0 -1
  82. package/lib/common/constants.js +0 -11
  83. package/lib/common/decorators.js +0 -48
  84. package/lib/common/dispatchers.js +1 -10
  85. package/lib/common/errors.js +3 -13
  86. package/lib/common/file-system.js +2 -13
  87. package/lib/common/header.js +0 -3
  88. package/lib/common/helpers.js +3 -89
  89. package/lib/common/host-info.js +0 -4
  90. package/lib/common/http-client.js +0 -20
  91. package/lib/common/logger/appenders/cli-appender.js +0 -4
  92. package/lib/common/logger/appenders/emit-appender.js +0 -4
  93. package/lib/common/logger/layouts/cli-layout.js +0 -1
  94. package/lib/common/logger/logger.js +0 -5
  95. package/lib/common/messages/messages.js +0 -6
  96. package/lib/common/mobile/android/android-application-manager.js +1 -20
  97. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  98. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  99. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  100. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  101. package/lib/common/mobile/android/android-device.js +0 -8
  102. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  103. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  104. package/lib/common/mobile/android/android-log-filter.js +0 -4
  105. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  106. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  107. package/lib/common/mobile/android/genymotion/genymotion-service.js +1 -6
  108. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  109. package/lib/common/mobile/android/logcat-helper.js +0 -13
  110. package/lib/common/mobile/application-manager-base.js +0 -6
  111. package/lib/common/mobile/device-emitter.js +0 -4
  112. package/lib/common/mobile/device-log-emitter.js +0 -1
  113. package/lib/common/mobile/device-log-provider-base.js +0 -1
  114. package/lib/common/mobile/device-log-provider.js +0 -23
  115. package/lib/common/mobile/device-platforms-constants.js +0 -1
  116. package/lib/common/mobile/emulator-helper.js +0 -3
  117. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  118. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
  119. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  120. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  121. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  122. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  123. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  124. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  125. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  126. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  127. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  128. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  129. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  130. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  131. package/lib/common/mobile/log-filter.js +0 -2
  132. package/lib/common/mobile/logging-levels.js +0 -1
  133. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  134. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  135. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  136. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  137. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  138. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  139. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  140. package/lib/common/mobile/mobile-helper.js +0 -1
  141. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  142. package/lib/common/opener.js +0 -1
  143. package/lib/common/os-info.js +0 -1
  144. package/lib/common/plist-parser.js +0 -1
  145. package/lib/common/project-helper.js +0 -1
  146. package/lib/common/prompter.js +1 -9
  147. package/lib/common/queue.js +0 -1
  148. package/lib/common/resource-loader.js +0 -1
  149. package/lib/common/services/auto-completion-service.js +1 -13
  150. package/lib/common/services/cancellation.js +1 -2
  151. package/lib/common/services/commands-service.js +6 -17
  152. package/lib/common/services/help-service.js +3 -11
  153. package/lib/common/services/hooks-service.js +0 -13
  154. package/lib/common/services/ios-notification-service.js +0 -1
  155. package/lib/common/services/json-file-settings-service.js +0 -6
  156. package/lib/common/services/lock-service.js +0 -6
  157. package/lib/common/services/message-contract-generator.js +0 -1
  158. package/lib/common/services/messages-service.js +0 -1
  159. package/lib/common/services/micro-templating-service.js +0 -6
  160. package/lib/common/services/net-service.js +0 -3
  161. package/lib/common/services/project-files-manager.js +0 -5
  162. package/lib/common/services/project-files-provider-base.js +0 -1
  163. package/lib/common/services/proxy-service.js +0 -1
  164. package/lib/common/services/qr.js +0 -1
  165. package/lib/common/services/settings-service.js +0 -1
  166. package/lib/common/services/xcode-select-service.js +0 -1
  167. package/lib/common/utils.js +0 -1
  168. package/lib/common/validators/project-name-validator.js +0 -1
  169. package/lib/common/validators/validation-result.js +0 -1
  170. package/lib/common/verify-node-version.js +1 -8
  171. package/lib/common/yok.js +11 -32
  172. package/lib/config.js +1 -22
  173. package/lib/constants-provider.js +0 -1
  174. package/lib/constants.js +0 -53
  175. package/lib/controllers/build-controller.js +3 -4
  176. package/lib/controllers/debug-controller.js +3 -8
  177. package/lib/controllers/deploy-controller.js +0 -1
  178. package/lib/controllers/migrate-controller.js +4 -90
  179. package/lib/controllers/platform-controller.js +1 -9
  180. package/lib/controllers/prepare-controller.js +4 -17
  181. package/lib/controllers/run-controller.js +1 -17
  182. package/lib/controllers/update-controller-base.js +0 -1
  183. package/lib/controllers/update-controller.js +0 -11
  184. package/lib/data/build-data.js +0 -1
  185. package/lib/data/controller-data-base.js +0 -1
  186. package/lib/data/debug-data.js +0 -1
  187. package/lib/data/platform-data.js +0 -1
  188. package/lib/data/prepare-data.js +0 -1
  189. package/lib/data/run-data.js +0 -1
  190. package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
  191. package/lib/detached-processes/cleanup-process.js +14 -18
  192. package/lib/detached-processes/file-log-service.js +1 -2
  193. package/lib/device-path-provider.js +0 -1
  194. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
  195. package/lib/device-sockets/ios/notification.js +0 -3
  196. package/lib/device-sockets/ios/socket-request-executor.js +0 -3
  197. package/lib/helpers/android-bundle-validator-helper.js +1 -2
  198. package/lib/helpers/deploy-command-helper.js +0 -1
  199. package/lib/helpers/key-command-helper.js +2 -4
  200. package/lib/helpers/livesync-command-helper.js +1 -4
  201. package/lib/helpers/network-connectivity-validator.js +0 -1
  202. package/lib/helpers/options-track-helper.js +2 -3
  203. package/lib/helpers/package-path-helper.js +0 -1
  204. package/lib/helpers/platform-command-helper.js +2 -7
  205. package/lib/helpers/version-validator-helper.js +0 -1
  206. package/lib/key-commands/bootstrap.js +2 -3
  207. package/lib/key-commands/index.js +4 -5
  208. package/lib/nativescript-cli-lib-bootstrap.js +0 -4
  209. package/lib/nativescript-cli-lib.js +0 -1
  210. package/lib/nativescript-cli.js +1 -11
  211. package/lib/node/pbxproj-dom-xcode.js +0 -1
  212. package/lib/node/xcode.js +0 -1
  213. package/lib/node-package-manager.js +1 -11
  214. package/lib/options.js +119 -144
  215. package/lib/package-installation-manager.js +1 -8
  216. package/lib/package-manager.js +0 -2
  217. package/lib/platform-command-param.js +0 -1
  218. package/lib/pnpm-package-manager.js +1 -4
  219. package/lib/project-data.js +0 -12
  220. package/lib/providers/project-files-provider.js +0 -1
  221. package/lib/resolvers/livesync-service-resolver.js +0 -1
  222. package/lib/services/analytics/analytics-broker-process.js +6 -10
  223. package/lib/services/analytics/analytics-broker.js +1 -2
  224. package/lib/services/analytics/analytics-service.js +25 -29
  225. package/lib/services/analytics/google-analytics-provider.js +12 -13
  226. package/lib/services/analytics-settings-service.js +0 -5
  227. package/lib/services/android/android-bundle-tool-service.js +0 -1
  228. package/lib/services/android/gradle-build-args-service.js +0 -3
  229. package/lib/services/android/gradle-build-service.js +0 -1
  230. package/lib/services/android/gradle-command-service.js +0 -1
  231. package/lib/services/android-device-debug-service.js +0 -6
  232. package/lib/services/android-plugin-build-service.js +2 -31
  233. package/lib/services/android-project-service.js +4 -71
  234. package/lib/services/android-resources-migration-service.js +0 -7
  235. package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
  236. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  237. package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
  238. package/lib/services/apple-portal/srp/srp-wrapper.js +1 -4
  239. package/lib/services/assets-generation/assets-generation-service.js +5 -10
  240. package/lib/services/build-artifacts-service.js +1 -2
  241. package/lib/services/build-data-service.js +0 -1
  242. package/lib/services/build-info-file-service.js +0 -1
  243. package/lib/services/bundler/bundler-compiler-service.js +1 -68
  244. package/lib/services/bundler/bundler.js +0 -1
  245. package/lib/services/cleanup-service.js +9 -13
  246. package/lib/services/cocoapods-platform-manager.js +0 -9
  247. package/lib/services/cocoapods-service.js +1 -21
  248. package/lib/services/debug-data-service.js +0 -1
  249. package/lib/services/debug-service-base.js +0 -7
  250. package/lib/services/device/device-install-app-service.js +1 -2
  251. package/lib/services/doctor-service.js +6 -21
  252. package/lib/services/extensibility-service.js +0 -8
  253. package/lib/services/files-hash-service.js +0 -1
  254. package/lib/services/hmr-status-service.js +0 -2
  255. package/lib/services/info-service.js +0 -1
  256. package/lib/services/initialize-service.js +1 -5
  257. package/lib/services/ios/export-options-plist-service.js +0 -4
  258. package/lib/services/ios/ios-signing-service.js +10 -7
  259. package/lib/services/ios/spm-service.js +0 -18
  260. package/lib/services/ios/xcodebuild-args-service.js +0 -11
  261. package/lib/services/ios/xcodebuild-command-service.js +0 -1
  262. package/lib/services/ios/xcodebuild-service.js +1 -2
  263. package/lib/services/ios-debugger-port-service.js +0 -1
  264. package/lib/services/ios-device-debug-service.js +0 -1
  265. package/lib/services/ios-entitlements-service.js +0 -1
  266. package/lib/services/ios-extensions-service.js +0 -1
  267. package/lib/services/ios-log-filter.js +0 -20
  268. package/lib/services/ios-native-target-service.js +4 -6
  269. package/lib/services/ios-project-service.js +1 -100
  270. package/lib/services/ios-provision-service.js +0 -3
  271. package/lib/services/ios-watch-app-service.js +0 -1
  272. package/lib/services/ip-service.js +0 -2
  273. package/lib/services/itmstransporter-service.js +0 -1
  274. package/lib/services/karma-execution.js +0 -2
  275. package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
  276. package/lib/services/livesync/android-device-livesync-service.js +0 -2
  277. package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
  278. package/lib/services/livesync/android-livesync-service.js +0 -1
  279. package/lib/services/livesync/android-livesync-tool.js +0 -4
  280. package/lib/services/livesync/device-livesync-service-base.js +0 -2
  281. package/lib/services/livesync/ios-device-livesync-service.js +0 -7
  282. package/lib/services/livesync/ios-livesync-service.js +0 -2
  283. package/lib/services/livesync/livesync-socket.js +0 -1
  284. package/lib/services/livesync/platform-livesync-service-base.js +0 -5
  285. package/lib/services/livesync-process-data-service.js +0 -1
  286. package/lib/services/log-parser-service.js +0 -1
  287. package/lib/services/log-source-map-service.js +0 -15
  288. package/lib/services/marking-mode-service.js +5 -8
  289. package/lib/services/metadata-filtering-service.js +0 -1
  290. package/lib/services/npm-config-service.js +0 -4
  291. package/lib/services/pacote-service.js +0 -7
  292. package/lib/services/performance-service.js +1 -3
  293. package/lib/services/platform/add-platform-service.js +2 -49
  294. package/lib/services/platform/platform-validation-service.js +0 -1
  295. package/lib/services/platform/prepare-native-platform-service.js +2 -5
  296. package/lib/services/platform-environment-requirements.js +3 -8
  297. package/lib/services/platform-project-service-base.js +0 -1
  298. package/lib/services/platforms-data-service.js +0 -1
  299. package/lib/services/plugins-service.js +2 -20
  300. package/lib/services/prepare-data-service.js +0 -1
  301. package/lib/services/project-backup-service.js +0 -4
  302. package/lib/services/project-changes-service.js +3 -14
  303. package/lib/services/project-cleanup-service.js +0 -2
  304. package/lib/services/project-config-service.js +2 -21
  305. package/lib/services/project-data-service.js +7 -36
  306. package/lib/services/project-name-service.js +0 -1
  307. package/lib/services/project-service.js +0 -10
  308. package/lib/services/project-templates-service.js +2 -3
  309. package/lib/services/qr-code-terminal-service.js +0 -1
  310. package/lib/services/require-service.js +0 -1
  311. package/lib/services/start-service.js +0 -1
  312. package/lib/services/temp-service.js +0 -3
  313. package/lib/services/terminal-spinner-service.js +0 -2
  314. package/lib/services/test-execution-service.js +2 -9
  315. package/lib/services/test-initialization-service.js +0 -4
  316. package/lib/services/timeline-profiler-service.js +0 -1
  317. package/lib/services/user-settings-service.js +0 -1
  318. package/lib/services/versions-service.js +4 -6
  319. package/lib/services/watch-ignore-list-service.js +0 -1
  320. package/lib/services/xcconfig-service.js +0 -2
  321. package/lib/services/xcproj-service.js +0 -1
  322. package/lib/shared-event-bus.js +0 -6
  323. package/lib/sys-info.js +1 -2
  324. package/lib/tools/config-manipulation/config-transformer.js +0 -12
  325. package/lib/tools/node-modules/node-modules-builder.js +0 -1
  326. package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
  327. package/lib/yarn-package-manager.js +0 -1
  328. package/lib/yarn2-package-manager.js +0 -3
  329. package/package.json +1 -1
@@ -19,7 +19,6 @@ class ProjectData {
19
19
  this.warnProjectId();
20
20
  return this.projectIdentifiers.ios;
21
21
  }
22
- //just in case hook/extension modifies it.
23
22
  set projectId(identifier) {
24
23
  this.warnProjectId();
25
24
  this.projectIdentifiers.ios = identifier;
@@ -45,7 +44,6 @@ class ProjectData {
45
44
  return;
46
45
  }
47
46
  projectDir = projectDir || this.$projectHelper.projectDir;
48
- // If no project found, projectDir should be null
49
47
  if (projectDir) {
50
48
  const projectFilePath = this.getProjectFilePath(projectDir);
51
49
  if (this.$fs.exists(projectFilePath)) {
@@ -118,7 +116,6 @@ class ProjectData {
118
116
  errorInvalidProject(projectDir) {
119
117
  const currentDir = path.resolve(".");
120
118
  this.$logger.trace(`Unable to find project. projectDir: ${projectDir}, options.path: ${this.$options.path}, ${currentDir}`);
121
- // This is the case when no project file found
122
119
  this.$errors.fail("No project found at or above '%s' and neither was a --path specified.", projectDir || this.$options.path || currentDir);
123
120
  }
124
121
  getProjectFilePath(projectDir) {
@@ -134,10 +131,6 @@ class ProjectData {
134
131
  return this.nsConfig[constants.CONFIG_NS_APP_RESOURCES_ENTRY];
135
132
  }
136
133
  return constants.APP_RESOURCES_FOLDER_NAME;
137
- // return path.join(
138
- // this.getAppDirectoryRelativePath(),
139
- // constants.APP_RESOURCES_FOLDER_NAME
140
- // );
141
134
  }
142
135
  getAppDirectoryPath(projectDir) {
143
136
  const appRelativePath = this.getAppDirectoryRelativePath();
@@ -151,7 +144,6 @@ class ProjectData {
151
144
  return constants.SRC_DIR;
152
145
  }
153
146
  else {
154
- // legacy project setup often uses app folder
155
147
  return constants.APP_FOLDER_NAME;
156
148
  }
157
149
  }
@@ -209,9 +201,6 @@ class ProjectData {
209
201
  }
210
202
  }
211
203
  exports.ProjectData = ProjectData;
212
- /**
213
- * NOTE: Order of the elements is important as the TypeScript dependencies are commonly included in Angular project as well.
214
- */
215
204
  ProjectData.PROJECT_TYPES = [
216
205
  {
217
206
  type: constants.ProjectTypes.JsFlavorName,
@@ -249,4 +238,3 @@ __decorate([
249
238
  (0, decorators_1.cache)()
250
239
  ], ProjectData.prototype, "warnProjectId", null);
251
240
  yok_1.injector.register("projectData", ProjectData, true);
252
- //# sourceMappingURL=project-data.js.map
@@ -44,4 +44,3 @@ class ProjectFilesProvider extends project_files_provider_base_1.ProjectFilesPro
44
44
  exports.ProjectFilesProvider = ProjectFilesProvider;
45
45
  ProjectFilesProvider.INTERNAL_NONPROJECT_FILES = ["**/*.ts"];
46
46
  yok_1.injector.register("projectFilesProvider", ProjectFilesProvider);
47
- //# sourceMappingURL=project-files-provider.js.map
@@ -20,4 +20,3 @@ class LiveSyncServiceResolver {
20
20
  }
21
21
  exports.LiveSyncServiceResolver = LiveSyncServiceResolver;
22
22
  yok_1.injector.register("liveSyncServiceResolver", LiveSyncServiceResolver);
23
- //# sourceMappingURL=livesync-service-resolver.js.map
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // NOTE: This file is used to track data in a separate process.
4
- // The instances here are not shared with the ones in main CLI process.
5
3
  const fs = require("fs");
6
4
  const analytics_broker_1 = require("./analytics-broker");
7
5
  const file_log_service_1 = require("../../detached-processes/file-log-service");
@@ -11,7 +9,6 @@ if (!pathToBootstrap || !fs.existsSync(pathToBootstrap)) {
11
9
  throw new Error("Invalid path to bootstrap.");
12
10
  }
13
11
  const logFile = process.argv[3];
14
- // After requiring the bootstrap we can use $injector
15
12
  require(pathToBootstrap);
16
13
  const analyticsLoggingService = yok_1.injector.resolve(file_log_service_1.FileLogService, { logFile });
17
14
  analyticsLoggingService.logData({ message: "Initializing AnalyticsBroker." });
@@ -41,15 +38,15 @@ process.on("message", async (data) => {
41
38
  analyticsLoggingService.logData({
42
39
  message: `analytics-broker-process received message of type: ${JSON.stringify(data)}`,
43
40
  });
44
- if (data.type === "FinishTracking" /* TrackingTypes.FinishTracking */) {
41
+ if (data.type === "FinishTracking") {
45
42
  await finishTracking();
46
43
  if (process.connected) {
47
44
  analyticsLoggingService.logData({
48
- message: `analytics-broker-process will send ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message`,
45
+ message: `analytics-broker-process will send ${"ProcessFinishedTasks"} message`,
49
46
  });
50
- process.send("ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */, null, null, () => {
47
+ process.send("ProcessFinishedTasks", null, null, () => {
51
48
  analyticsLoggingService.logData({
52
- message: `analytics-broker-process sent ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message and will exit gracefully now`,
49
+ message: `analytics-broker-process sent ${"ProcessFinishedTasks"} message and will exit gracefully now`,
53
50
  });
54
51
  killCurrentProcessGracefully();
55
52
  });
@@ -66,7 +63,6 @@ process.on("disconnect", async () => {
66
63
  killCurrentProcessGracefully();
67
64
  });
68
65
  analyticsLoggingService.logData({
69
- message: `analytics-broker-process will send ${"ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */} message`,
66
+ message: `analytics-broker-process will send ${"ProcessReadyToReceive"} message`,
70
67
  });
71
- process.send("ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */);
72
- //# sourceMappingURL=analytics-broker-process.js.map
68
+ process.send("ProcessReadyToReceive");
@@ -29,7 +29,7 @@ class AnalyticsBroker {
29
29
  catch (err) {
30
30
  this.analyticsLoggingService.logData({
31
31
  message: `AnalyticsBroker unable to execute action in sendDataForTracking: ${err}`,
32
- type: "Error" /* FileLogMessageType.Error */,
32
+ type: "Error",
33
33
  });
34
34
  }
35
35
  }
@@ -38,4 +38,3 @@ exports.AnalyticsBroker = AnalyticsBroker;
38
38
  __decorate([
39
39
  (0, decorators_1.cache)()
40
40
  ], AnalyticsBroker.prototype, "getGoogleAnalyticsProvider", null);
41
- //# sourceMappingURL=analytics-broker.js.map
@@ -34,7 +34,7 @@ class AnalyticsService {
34
34
  async checkConsent() {
35
35
  if (await this.$analyticsSettingsService.canDoRequest()) {
36
36
  const initialTrackFeatureUsageStatus = await this.getStatus(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME);
37
- let trackFeatureUsage = initialTrackFeatureUsageStatus === "enabled" /* AnalyticsStatus.enabled */;
37
+ let trackFeatureUsage = initialTrackFeatureUsageStatus === "enabled";
38
38
  if ((await this.isNotConfirmed(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME)) &&
39
39
  (0, helpers_1.isInteractive)()) {
40
40
  const message = `Do you want to help us improve ${this.$analyticsSettingsService.getClientName()} by automatically sending anonymous usage statistics? We will not use this information to identify or contact you.`;
@@ -53,13 +53,13 @@ class AnalyticsService {
53
53
  }
54
54
  async setStatus(settingName, enabled) {
55
55
  this.analyticsStatuses[settingName] = enabled
56
- ? "enabled" /* AnalyticsStatus.enabled */
57
- : "disabled" /* AnalyticsStatus.disabled */;
56
+ ? "enabled"
57
+ : "disabled";
58
58
  await this.$userSettingsService.saveSetting(settingName, enabled.toString());
59
59
  }
60
60
  async isEnabled(settingName) {
61
61
  const analyticsStatus = await this.getStatus(settingName);
62
- return analyticsStatus === "enabled" /* AnalyticsStatus.enabled */;
62
+ return analyticsStatus === "enabled";
63
63
  }
64
64
  getStatusMessage(settingName, jsonFormat, readableSettingName) {
65
65
  if (jsonFormat) {
@@ -70,8 +70,8 @@ class AnalyticsService {
70
70
  async trackAcceptFeatureUsage(settings) {
71
71
  const acceptTracking = !!(settings && settings.acceptTrackFeatureUsage);
72
72
  const googleAnalyticsEventData = {
73
- googleAnalyticsDataType: "event" /* GoogleAnalyticsDataType.Event */,
74
- action: "Accept Tracking" /* TrackActionNames.AcceptTracking */,
73
+ googleAnalyticsDataType: "event",
74
+ action: "Accept Tracking",
75
75
  label: acceptTracking.toString(),
76
76
  };
77
77
  await this.forcefullyTrackInGoogleAnalytics(googleAnalyticsEventData);
@@ -79,7 +79,7 @@ class AnalyticsService {
79
79
  async trackInGoogleAnalytics(gaSettings) {
80
80
  await this.initAnalyticsStatuses();
81
81
  if (!this.$staticConfig.disableAnalytics &&
82
- this.analyticsStatuses[this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME] === "enabled" /* AnalyticsStatus.enabled */) {
82
+ this.analyticsStatuses[this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME] === "enabled") {
83
83
  return this.forcefullyTrackInGoogleAnalytics(gaSettings);
84
84
  }
85
85
  }
@@ -92,8 +92,6 @@ class AnalyticsService {
92
92
  const isForDevice = device ? !device.isEmulator : data.isForDevice;
93
93
  let label = "";
94
94
  label = this.addDataToLabel(label, normalizedPlatform);
95
- // In some cases (like in case action is Build and platform is Android), we do not know if the deviceType is emulator or device.
96
- // Just exclude the device_type in this case.
97
95
  if (isForDevice !== null && isForDevice !== undefined) {
98
96
  const deviceType = isForDevice
99
97
  ? constants_1.DeviceTypes.Device
@@ -111,7 +109,7 @@ class AnalyticsService {
111
109
  const customDimensions = {};
112
110
  this.setProjectRelatedCustomDimensions(customDimensions, data.projectDir);
113
111
  const googleAnalyticsEventData = {
114
- googleAnalyticsDataType: "event" /* GoogleAnalyticsDataType.Event */,
112
+ googleAnalyticsDataType: "event",
115
113
  action: data.action,
116
114
  label,
117
115
  customDimensions,
@@ -124,7 +122,7 @@ class AnalyticsService {
124
122
  if (this.brokerProcess && this.brokerProcess.connected) {
125
123
  let timer;
126
124
  const handler = (data) => {
127
- if (data === "ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */) {
125
+ if (data === "ProcessFinishedTasks") {
128
126
  this.brokerProcess.removeListener("message", handler);
129
127
  clearTimeout(timer);
130
128
  resolve();
@@ -135,7 +133,7 @@ class AnalyticsService {
135
133
  resolve();
136
134
  }, 3000);
137
135
  this.brokerProcess.on("message", handler);
138
- const msg = { type: "FinishTracking" /* TrackingTypes.FinishTracking */ };
136
+ const msg = { type: "FinishTracking" };
139
137
  this.brokerProcess.send(msg, (err) => this.$logger.trace(`Error while sending ${JSON.stringify(msg)}`));
140
138
  }
141
139
  else {
@@ -145,13 +143,13 @@ class AnalyticsService {
145
143
  }
146
144
  forcefullyTrackInGoogleAnalytics(gaSettings) {
147
145
  gaSettings.customDimensions = gaSettings.customDimensions || {};
148
- gaSettings.customDimensions["cd5" /* GoogleAnalyticsCustomDimensions.client */] =
146
+ gaSettings.customDimensions["cd5"] =
149
147
  this.$options.analyticsClient ||
150
- ((0, helpers_1.isInteractive)() ? "CLI" /* AnalyticsClients.Cli */ : "Unknown" /* AnalyticsClients.Unknown */);
148
+ ((0, helpers_1.isInteractive)() ? "CLI" : "Unknown");
151
149
  this.setProjectRelatedCustomDimensions(gaSettings.customDimensions);
152
150
  const googleAnalyticsData = _.merge({
153
- type: "googleAnalyticsData" /* TrackingTypes.GoogleAnalyticsData */,
154
- category: "CLI" /* AnalyticsClients.Cli */,
151
+ type: "googleAnalyticsData",
152
+ category: "CLI",
155
153
  }, gaSettings);
156
154
  this.$logger.trace("Will send the following information to Google Analytics:", googleAnalyticsData);
157
155
  return this.sendMessageToBroker(googleAnalyticsData);
@@ -162,15 +160,14 @@ class AnalyticsService {
162
160
  projectDir = this.$projectHelper.projectDir;
163
161
  }
164
162
  catch (err) {
165
- // In case there's no project dir here, the above getter will fail.
166
163
  this.$logger.trace("Unable to get the projectDir from projectHelper", err);
167
164
  }
168
165
  }
169
166
  if (projectDir) {
170
167
  const projectData = this.$projectDataService.getProjectData(projectDir);
171
- customDimensions["cd2" /* GoogleAnalyticsCustomDimensions.projectType */] =
168
+ customDimensions["cd2"] =
172
169
  projectData.projectType;
173
- customDimensions["cd9" /* GoogleAnalyticsCustomDimensions.isShared */] =
170
+ customDimensions["cd9"] =
174
171
  projectData.isShared.toString();
175
172
  }
176
173
  return customDimensions;
@@ -208,7 +205,7 @@ class AnalyticsService {
208
205
  }
209
206
  });
210
207
  broker.on("message", (data) => {
211
- if (data === "ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */) {
208
+ if (data === "ProcessReadyToReceive") {
212
209
  clearTimeout(timeoutId);
213
210
  if (!isSettled) {
214
211
  isSettled = true;
@@ -232,7 +229,7 @@ class AnalyticsService {
232
229
  async sendInfoForTracking(trackingInfo, settingName) {
233
230
  await this.initAnalyticsStatuses();
234
231
  if (!this.$staticConfig.disableAnalytics &&
235
- this.analyticsStatuses[settingName] === "enabled" /* AnalyticsStatus.enabled */) {
232
+ this.analyticsStatuses[settingName] === "enabled") {
236
233
  return this.sendMessageToBroker(trackingInfo);
237
234
  }
238
235
  }
@@ -280,21 +277,21 @@ class AnalyticsService {
280
277
  if (settingValue) {
281
278
  const isEnabled = (0, helpers_1.toBoolean)(settingValue);
282
279
  if (isEnabled) {
283
- this.analyticsStatuses[settingName] = "enabled" /* AnalyticsStatus.enabled */;
280
+ this.analyticsStatuses[settingName] = "enabled";
284
281
  }
285
282
  else {
286
- this.analyticsStatuses[settingName] = "disabled" /* AnalyticsStatus.disabled */;
283
+ this.analyticsStatuses[settingName] = "disabled";
287
284
  }
288
285
  }
289
286
  else {
290
- this.analyticsStatuses[settingName] = "not confirmed" /* AnalyticsStatus.notConfirmed */;
287
+ this.analyticsStatuses[settingName] = "not confirmed";
291
288
  }
292
289
  }
293
290
  return this.analyticsStatuses[settingName];
294
291
  }
295
292
  async isNotConfirmed(settingName) {
296
293
  const analyticsStatus = await this.getStatus(settingName);
297
- return analyticsStatus === "not confirmed" /* AnalyticsStatus.notConfirmed */;
294
+ return analyticsStatus === "not confirmed";
298
295
  }
299
296
  async getHumanReadableStatusMessage(settingName, readableSettingName) {
300
297
  let status = null;
@@ -308,14 +305,14 @@ class AnalyticsService {
308
305
  }
309
306
  async getJsonStatusMessage(settingName) {
310
307
  const status = await this.getStatus(settingName);
311
- const enabled = status === "not confirmed" /* AnalyticsStatus.notConfirmed */
308
+ const enabled = status === "not confirmed"
312
309
  ? null
313
- : status === "enabled" /* AnalyticsStatus.enabled */;
310
+ : status === "enabled";
314
311
  return JSON.stringify({ enabled });
315
312
  }
316
313
  trackException(exception, message) {
317
314
  const data = {
318
- type: "exception" /* TrackingTypes.Exception */,
315
+ type: "exception",
319
316
  exception,
320
317
  message,
321
318
  };
@@ -331,4 +328,3 @@ __decorate([
331
328
  (0, decorators_1.cache)()
332
329
  ], AnalyticsService.prototype, "initAnalyticsStatuses", null);
333
330
  yok_1.injector.register("analyticsService", AnalyticsService);
334
- //# sourceMappingURL=analytics-service.js.map
@@ -29,7 +29,7 @@ class GoogleAnalyticsProvider {
29
29
  }
30
30
  catch (e) {
31
31
  this.analyticsLoggingService.logData({
32
- type: "Error" /* FileLogMessageType.Error */,
32
+ type: "Error",
33
33
  message: `Unable to track information ${JSON.stringify(trackInfo)}. Error is: ${e}`,
34
34
  });
35
35
  this.$logger.trace("Analytics exception: ", e);
@@ -61,23 +61,23 @@ class GoogleAnalyticsProvider {
61
61
  const visitor = this.getVisitor(gaTrackingId, proxy);
62
62
  await this.setCustomDimensions(visitor, trackInfo.customDimensions, sessionId);
63
63
  switch (trackInfo.googleAnalyticsDataType) {
64
- case "pageview" /* GoogleAnalyticsDataType.Page */:
64
+ case "pageview":
65
65
  await this.trackPageView(visitor, trackInfo);
66
66
  break;
67
- case "event" /* GoogleAnalyticsDataType.Event */:
67
+ case "event":
68
68
  await this.trackEvent(visitor, trackInfo);
69
69
  break;
70
70
  }
71
71
  }
72
72
  async setCustomDimensions(visitor, customDimensions, sessionId) {
73
73
  const defaultValues = {
74
- ["cd1" /* GoogleAnalyticsCustomDimensions.cliVersion */]: this.$staticConfig.version,
75
- ["cd6" /* GoogleAnalyticsCustomDimensions.nodeVersion */]: process.version,
76
- ["cd3" /* GoogleAnalyticsCustomDimensions.clientID */]: this.clientId,
77
- ["cd2" /* GoogleAnalyticsCustomDimensions.projectType */]: null,
78
- ["cd9" /* GoogleAnalyticsCustomDimensions.isShared */]: null,
79
- ["cd4" /* GoogleAnalyticsCustomDimensions.sessionID */]: sessionId,
80
- ["cd5" /* GoogleAnalyticsCustomDimensions.client */]: "Unknown" /* AnalyticsClients.Unknown */,
74
+ ["cd1"]: this.$staticConfig.version,
75
+ ["cd6"]: process.version,
76
+ ["cd3"]: this.clientId,
77
+ ["cd2"]: null,
78
+ ["cd9"]: null,
79
+ ["cd4"]: sessionId,
80
+ ["cd5"]: "Unknown",
81
81
  };
82
82
  customDimensions = _.merge(defaultValues, customDimensions);
83
83
  _.each(customDimensions, (value, key) => {
@@ -94,7 +94,7 @@ class GoogleAnalyticsProvider {
94
94
  this.analyticsLoggingService.logData({
95
95
  message: `Unable to track event with category: '${trackInfo.category}', action: '${trackInfo.action}', label: '${trackInfo.label}', ` +
96
96
  `value: '${trackInfo.value}' attached page: ${this.currentPage}. Error is: ${err}.`,
97
- type: "Error" /* FileLogMessageType.Error */,
97
+ type: "Error",
98
98
  });
99
99
  reject(err);
100
100
  return;
@@ -117,7 +117,7 @@ class GoogleAnalyticsProvider {
117
117
  if (err) {
118
118
  this.analyticsLoggingService.logData({
119
119
  message: `Unable to track pageview with path '${trackInfo.path}' and title: '${trackInfo.title}' Error is: ${err}.`,
120
- type: "Error" /* FileLogMessageType.Error */,
120
+ type: "Error",
121
121
  });
122
122
  reject(err);
123
123
  return;
@@ -135,4 +135,3 @@ __decorate([
135
135
  (0, decorators_1.cache)()
136
136
  ], GoogleAnalyticsProvider.prototype, "getVisitor", null);
137
137
  yok_1.injector.register("googleAnalyticsProvider", GoogleAnalyticsProvider);
138
- //# sourceMappingURL=google-analytics-provider.js.map
@@ -62,10 +62,6 @@ class AnalyticsSettingsService {
62
62
  return userAgent;
63
63
  }
64
64
  getMacOSReleaseVersion(osRelease) {
65
- // https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
66
- // Each macOS version is labeled 10.<version>, where it looks like <versions> is taken from the major version returned by os.release() (16.x.x for example) and subtracting 4 from it.
67
- // So the version becomes "10.12" in this case.
68
- // Could be improved by spawning `system_profiler SPSoftwareDataType` and getting the System Version line from the result.
69
65
  const majorVersion = osRelease && _.first(osRelease.split("."));
70
66
  return majorVersion && `10.${+majorVersion - 4}`;
71
67
  }
@@ -90,4 +86,3 @@ __decorate([
90
86
  (0, decorators_1.exported)("analyticsSettingsService")
91
87
  ], AnalyticsSettingsService.prototype, "getUserAgentString", null);
92
88
  yok_1.injector.register("analyticsSettingsService", AnalyticsSettingsService);
93
- //# sourceMappingURL=analytics-settings-service.js.map
@@ -62,4 +62,3 @@ class AndroidBundleToolService {
62
62
  }
63
63
  exports.AndroidBundleToolService = AndroidBundleToolService;
64
64
  yok_1.injector.register("androidBundleToolService", AndroidBundleToolService);
65
- //# sourceMappingURL=android-bundle-tool-service.js.map
@@ -18,7 +18,6 @@ class GradleBuildArgsService {
18
18
  if (await this.$analyticsService.isEnabled(this.$staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME)) {
19
19
  args.push("-PgatherAnalyticsData=true");
20
20
  }
21
- // allow modifying gradle args from a `before-build-task-args` hook
22
21
  await this.$hooksService.executeBeforeHooks("build-task-args", {
23
22
  hookArgs: { args },
24
23
  });
@@ -31,7 +30,6 @@ class GradleBuildArgsService {
31
30
  }
32
31
  getBaseTaskArgs(buildData) {
33
32
  const args = this.getBuildLoggingArgs();
34
- // ensure we initialize project data
35
33
  this.$projectData.initializeProjectData(buildData.projectDir);
36
34
  args.push(`-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`);
37
35
  if (buildData.gradleArgs) {
@@ -63,4 +61,3 @@ class GradleBuildArgsService {
63
61
  }
64
62
  exports.GradleBuildArgsService = GradleBuildArgsService;
65
63
  yok_1.injector.register("gradleBuildArgsService", GradleBuildArgsService);
66
- //# sourceMappingURL=gradle-build-args-service.js.map
@@ -39,4 +39,3 @@ class GradleBuildService extends events_1.EventEmitter {
39
39
  }
40
40
  exports.GradleBuildService = GradleBuildService;
41
41
  yok_1.injector.register("gradleBuildService", GradleBuildService);
42
- //# sourceMappingURL=gradle-build-service.js.map
@@ -38,4 +38,3 @@ class GradleCommandService {
38
38
  }
39
39
  exports.GradleCommandService = GradleCommandService;
40
40
  yok_1.injector.register("gradleCommandService", GradleCommandService);
41
- //# sourceMappingURL=gradle-command-service.js.map
@@ -33,7 +33,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
33
33
  async debug(debugData, debugOptions) {
34
34
  this._packageName = debugData.applicationIdentifier;
35
35
  const result = await this.debugCore(debugData.applicationIdentifier, debugOptions);
36
- // TODO: extract this logic outside the debug service
37
36
  if (debugOptions.start && !debugOptions.justlaunch) {
38
37
  const pid = await this.$androidProcessService.getAppProcessId(this.deviceIdentifier, debugData.applicationIdentifier);
39
38
  if (pid) {
@@ -56,7 +55,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
56
55
  `tcp:${port}`,
57
56
  ]);
58
57
  }
59
- // TODO: Remove this method and reuse logic from androidProcessService
60
58
  async getForwardedDebugPort(deviceId, packageName) {
61
59
  let port = -1;
62
60
  const forwardsResult = await this.device.adb.executeCommand([
@@ -64,7 +62,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
64
62
  "--list",
65
63
  ]);
66
64
  const unixSocketName = `${packageName}-inspectorServer`;
67
- //matches 123a188909e6czzc tcp:40001 localabstract:org.nativescript.testUnixSockets-debug
68
65
  const regexp = new RegExp(`(?:${deviceId} tcp:)([\\d]+)(?= localabstract:${unixSocketName})`, "g");
69
66
  const match = regexp.exec(forwardsResult);
70
67
  if (match) {
@@ -80,7 +77,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
80
77
  });
81
78
  return port;
82
79
  }
83
- // TODO: Remove this method and reuse logic from androidProcessService
84
80
  async unixSocketForward(local, remote) {
85
81
  await this.device.adb.executeCommand([
86
82
  "forward",
@@ -106,7 +102,6 @@ class AndroidDeviceDebugService extends debug_service_base_1.DebugServiceBase {
106
102
  async printDebugPort(deviceId, port) {
107
103
  this.$logger.info("device: " + deviceId + " debug port: " + port + "\n");
108
104
  }
109
- // TODO: extract this logic outside the debug service
110
105
  async validateRunningApp(deviceId, packageName) {
111
106
  if (!(await this.isAppRunning(packageName, deviceId))) {
112
107
  this.$errors.fail(`The application ${packageName} does not appear to be running on ${deviceId} or is not built with debugging enabled. Try starting the application manually.`);
@@ -149,4 +144,3 @@ __decorate([
149
144
  (0, decorators_1.performanceLog)()
150
145
  ], AndroidDeviceDebugService.prototype, "debugCore", null);
151
146
  yok_1.injector.register("androidDeviceDebugService", AndroidDeviceDebugService, false);
152
- //# sourceMappingURL=android-device-debug-service.js.map
@@ -54,15 +54,12 @@ class AndroidPluginBuildService {
54
54
  async updateManifestContent(oldManifestContent, defaultPackageName) {
55
55
  let xml = await this.getXml(oldManifestContent);
56
56
  let packageName = defaultPackageName;
57
- // if the manifest file is full-featured and declares settings inside the manifest scope
58
57
  if (xml["manifest"]) {
59
58
  if (xml["manifest"]["$"]["package"]) {
60
59
  packageName = xml["manifest"]["$"]["package"];
61
60
  }
62
- // set the xml as the value to iterate over its properties
63
61
  xml = xml["manifest"];
64
62
  }
65
- // if the manifest file doesn't have a <manifest> scope, only the first setting will be picked up
66
63
  const newManifest = { manifest: {} };
67
64
  for (const prop in xml) {
68
65
  newManifest.manifest[prop] = xml[prop];
@@ -135,14 +132,6 @@ class AndroidPluginBuildService {
135
132
  }
136
133
  return result;
137
134
  }
138
- /**
139
- * Returns whether the build has completed or not
140
- * @param {Object} options
141
- * @param {string} options.pluginName - The name of the plugin. E.g. 'nativescript-barcodescanner'
142
- * @param {string} options.platformsAndroidDirPath - The path to the 'plugin/src/platforms/android' directory.
143
- * @param {string} options.aarOutputDir - The path where the aar should be copied after a successful build.
144
- * @param {string} options.tempPluginDirPath - The path where the android plugin will be built.
145
- */
146
135
  async buildAar(options) {
147
136
  this.validateOptions(options);
148
137
  const manifestFilePath = this.getManifest(options.platformsAndroidDirPath);
@@ -178,7 +167,6 @@ class AndroidPluginBuildService {
178
167
  return shouldBuildAar;
179
168
  }
180
169
  cleanPluginDir(pluginTempDir) {
181
- // In case plugin was already built in the current process, we need to clean the old sources as they may break the new build.
182
170
  this.$fs.deleteDirectory(pluginTempDir);
183
171
  this.$fs.ensureDirectoryExists(pluginTempDir);
184
172
  }
@@ -252,7 +240,6 @@ class AndroidPluginBuildService {
252
240
  this.replaceGradleAndroidPluginVersion(buildGradlePath, runtimeGradleVersions.gradleAndroidPluginVersion);
253
241
  this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName);
254
242
  this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName);
255
- // gets the package from the AndroidManifest to use as the namespace or fallback to the `org.nativescript.${shortPluginName}`
256
243
  const shortPluginName = (0, helpers_1.getShortPluginName)(pluginName);
257
244
  const manifestPath = path.join(pluginTempDir, "src", "main", "AndroidManifest.xml");
258
245
  const manifestContent = this.$fs.readText(manifestPath);
@@ -299,7 +286,6 @@ class AndroidPluginBuildService {
299
286
  return runtimeVersion;
300
287
  }
301
288
  getLocalGradleVersions() {
302
- // try reading from installed runtime first before reading from the npm registry...
303
289
  const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(constants_1.SCOPED_ANDROID_RUNTIME_NAME, {
304
290
  paths: [this.$projectData.projectDir],
305
291
  });
@@ -333,23 +319,13 @@ class AndroidPluginBuildService {
333
319
  if (localVersionInfo) {
334
320
  return localVersionInfo;
335
321
  }
336
- // fallback to reading from npm...
337
322
  try {
338
323
  let output = await this.$packageManager.view(`${constants_1.SCOPED_ANDROID_RUNTIME_NAME}@${runtimeVersion}`, { version_info: true });
339
324
  output = (_a = output === null || output === void 0 ? void 0 : output["version_info"]) !== null && _a !== void 0 ? _a : output;
340
325
  if (!output) {
341
- /**
342
- * fallback to the old 'gradle' key in package.json
343
- *
344
- * format:
345
- *
346
- * gradle: { version: '6.4', android: '3.6.4' }
347
- *
348
- */
349
326
  output = await this.$packageManager.view(`${constants_1.SCOPED_ANDROID_RUNTIME_NAME}@${runtimeVersion}`, { gradle: true });
350
327
  output = (_b = output === null || output === void 0 ? void 0 : output["gradle"]) !== null && _b !== void 0 ? _b : output;
351
328
  const { version, android } = output;
352
- // covert output to the new format...
353
329
  output = {
354
330
  gradle: version,
355
331
  gradleAndroid: android,
@@ -421,10 +397,6 @@ class AndroidPluginBuildService {
421
397
  this.$errors.fail(`No built aar found at ${pathToBuiltAar}`);
422
398
  }
423
399
  }
424
- /**
425
- * @param {Object} options
426
- * @param {string} options.platformsAndroidDirPath - The path to the 'plugin/src/platforms/android' directory.
427
- */
428
400
  migrateIncludeGradle(options) {
429
401
  this.validatePlatformsAndroidDirPathOption(options);
430
402
  const includeGradleFilePath = path.join(options.platformsAndroidDirPath, constants_1.INCLUDE_GRADLE_NAME);
@@ -477,8 +449,8 @@ class AndroidPluginBuildService {
477
449
  };
478
450
  if (this.$options.hostProjectPath) {
479
451
  opts.env = {
480
- USER_PROJECT_PLATFORMS_ANDROID: path.resolve((0, process_1.cwd)(), this.$options.hostProjectPath), // TODO: couldn't `hostProjectPath` have an absolute path already?
481
- ...process.env, // TODO: any other way to pass automatically the current process.env?
452
+ USER_PROJECT_PLATFORMS_ANDROID: path.resolve((0, process_1.cwd)(), this.$options.hostProjectPath),
453
+ ...process.env,
482
454
  };
483
455
  }
484
456
  try {
@@ -525,4 +497,3 @@ __decorate([
525
497
  (0, helpers_1.hook)("buildAndroidPlugin")
526
498
  ], AndroidPluginBuildService.prototype, "buildPlugin", null);
527
499
  yok_1.injector.register("androidPluginBuildService", AndroidPluginBuildService);
528
- //# sourceMappingURL=android-plugin-build-service.js.map