@akylas/nativescript-cli 8.8.7 → 8.10.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.
Files changed (85) hide show
  1. package/config/test-deps-versions-generated.json +16 -0
  2. package/docs/build-jekyll-md.sh +1 -1
  3. package/docs/man_pages/config/config-get.md +36 -0
  4. package/docs/man_pages/config/config-set.md +40 -0
  5. package/docs/man_pages/config/config.md +39 -0
  6. package/docs/man_pages/project/configuration/widget-ios.md +24 -0
  7. package/docs/man_pages/project/configuration/widget.md +24 -0
  8. package/docs/man_pages/project/hooks/hooks.md +35 -0
  9. package/docs/man_pages/start.md +2 -1
  10. package/lib/.d.ts +9 -3
  11. package/lib/bootstrap.js +4 -1
  12. package/lib/bun-package-manager.js +1 -1
  13. package/lib/color.js +38 -7
  14. package/lib/commands/build.js +18 -2
  15. package/lib/commands/clean.js +1 -2
  16. package/lib/commands/config.js +1 -1
  17. package/lib/commands/embedding/embed.js +1 -1
  18. package/lib/commands/generate.js +2 -41
  19. package/lib/commands/hooks/common.js +79 -0
  20. package/lib/commands/hooks/hooks-lock.js +100 -0
  21. package/lib/commands/hooks/hooks.js +71 -0
  22. package/lib/commands/post-install.js +2 -2
  23. package/lib/commands/typings.js +29 -18
  24. package/lib/commands/widget.js +799 -0
  25. package/lib/common/definitions/extensibility.d.ts +2 -2
  26. package/lib/common/definitions/mobile.d.ts +72 -72
  27. package/lib/common/file-system.js +1 -2
  28. package/lib/common/header.js +3 -3
  29. package/lib/common/logger/layouts/cli-layout.js +1 -1
  30. package/lib/common/logger/logger.js +5 -5
  31. package/lib/common/mobile/android/android-device.js +1 -1
  32. package/lib/common/mobile/android/android-emulator-services.js +9 -7
  33. package/lib/common/mobile/device-log-provider.js +3 -4
  34. package/lib/common/mobile/emulator-helper.js +1 -0
  35. package/lib/common/mobile/mobile-core/devices-service.js +2 -1
  36. package/lib/common/opener.js +2 -2
  37. package/lib/common/project-helper.js +15 -2
  38. package/lib/common/services/hooks-service.js +23 -6
  39. package/lib/common/verify-node-version.js +1 -1
  40. package/lib/constants.js +8 -5
  41. package/lib/controllers/migrate-controller.js +11 -12
  42. package/lib/controllers/prepare-controller.js +11 -13
  43. package/lib/controllers/run-controller.js +1 -1
  44. package/lib/declarations.d.ts +5 -0
  45. package/lib/definitions/hooks.d.ts +1 -0
  46. package/lib/definitions/ios.d.ts +11 -1
  47. package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
  48. package/lib/definitions/project.d.ts +102 -25
  49. package/lib/definitions/temp-service.d.ts +6 -2
  50. package/lib/helpers/key-command-helper.js +2 -1
  51. package/lib/nativescript-cli.js +28 -0
  52. package/lib/node-package-manager.js +1 -1
  53. package/lib/options.js +4 -0
  54. package/lib/project-data.js +10 -4
  55. package/lib/services/analytics/analytics-broker-process.js +1 -1
  56. package/lib/services/analytics/analytics-service.js +2 -1
  57. package/lib/services/analytics-settings-service.js +2 -1
  58. package/lib/services/android/gradle-build-args-service.js +8 -4
  59. package/lib/services/android/gradle-build-service.js +4 -1
  60. package/lib/services/android-plugin-build-service.js +1 -1
  61. package/lib/services/android-project-service.js +12 -10
  62. package/lib/services/assets-generation/assets-generation-service.js +33 -15
  63. package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +258 -88
  64. package/lib/services/bundler/bundler.js +2 -0
  65. package/lib/services/extensibility-service.js +1 -1
  66. package/lib/services/ios/spm-service.js +22 -2
  67. package/lib/services/ios/xcodebuild-args-service.js +7 -5
  68. package/lib/services/ios-debugger-port-service.js +1 -1
  69. package/lib/services/ios-project-service.js +45 -15
  70. package/lib/services/ios-watch-app-service.js +540 -16
  71. package/lib/services/livesync/android-livesync-tool.js +4 -2
  72. package/lib/services/plugins-service.js +1 -0
  73. package/lib/services/project-changes-service.js +1 -1
  74. package/lib/services/project-config-service.js +12 -3
  75. package/lib/services/temp-service.js +16 -4
  76. package/lib/services/versions-service.js +2 -1
  77. package/lib/tools/config-manipulation/config-transformer.js +9 -0
  78. package/package.json +59 -66
  79. package/vendor/aab-tool/README.txt +1 -1
  80. package/vendor/aab-tool/bundletool.jar +0 -0
  81. package/vendor/gradle-app/app/build.gradle +365 -130
  82. package/vendor/gradle-app/app/gradle.properties +45 -0
  83. package/vendor/gradle-app/build.gradle +7 -7
  84. package/vendor/gradle-plugin/build.gradle +7 -6
  85. package/lib/services/webpack/webpack.d.ts +0 -227
@@ -101,10 +101,37 @@ interface INsConfigPlaform {
101
101
  id?: string;
102
102
  }
103
103
 
104
+ interface IOSSPMPackageBase {
105
+ name: string;
106
+ libs: string[];
107
+ /**
108
+ * Optional: If you have more targets (like widgets for example)
109
+ * you can list their names here to include the Swift Package with them
110
+ */
111
+ targets?: string[];
112
+ }
113
+
114
+ export interface IOSRemoteSPMPackage extends IOSSPMPackageBase {
115
+ repositoryURL: string;
116
+ version: string;
117
+ }
118
+
119
+ export interface IOSLocalSPMPackage extends IOSSPMPackageBase {
120
+ path: string;
121
+ }
122
+
123
+ export type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;
124
+ export type BundlerType = "webpack" | "rspack" | "vite";
125
+
104
126
  interface INsConfigIOS extends INsConfigPlaform {
105
127
  discardUncaughtJsExceptions?: boolean;
106
128
  runtimePackageName?: string
107
129
  cocoapodUseBundleExec?: boolean
130
+ /**
131
+ * Swift Package Manager
132
+ * List packages to be included in the iOS build.
133
+ */
134
+ SPMPackages?: Array<IOSSPMPackage>;
108
135
  }
109
136
 
110
137
  interface INSConfigVisionOS extends INsConfigIOS {}
@@ -168,12 +195,15 @@ interface INsConfig {
168
195
  overridePods?: string;
169
196
  webpackPackageName?: string;
170
197
  webpackConfigPath?: string;
198
+ bundlerConfigPath?: string;
199
+ bundler?: BundlerType;
171
200
  ios?: INsConfigIOS;
172
201
  android?: INsConfigAndroid;
173
202
  visionos?: INSConfigVisionOS;
174
203
  ignoredNativeDependencies?: string[];
175
204
  hooks?: INsConfigHooks[];
176
205
  projectName?: string;
206
+ corePackageName?: string;
177
207
  }
178
208
 
179
209
  interface IProjectData extends ICreateProjectData {
@@ -201,13 +231,28 @@ interface IProjectData extends ICreateProjectData {
201
231
  * Value is true when project has nativescript.config and it has `shared: true` in it.
202
232
  */
203
233
  isShared: boolean;
204
-
205
234
  /**
235
+ * Specifies the bundler used to build the application.
236
+ *
237
+ * - `"webpack"`: Uses Webpack for traditional bundling.
238
+ * - `"rspack"`: Uses Rspack for fast bundling.
239
+ * - `"vite"`: Uses Vite for fast bundling.
240
+ *
241
+ * @default "webpack"
242
+ */
243
+ bundler: BundlerType;
244
+ /**
245
+ * @deprecated Use bundlerConfigPath
206
246
  * Defines the path to the configuration file passed to webpack process.
207
247
  * By default this is the webpack.config.js at the root of the application.
208
248
  * The value can be changed by setting `webpackConfigPath` in nativescript.config.
209
249
  */
210
250
  webpackConfigPath: string;
251
+ /**
252
+ * Defines the path to the bundler configuration file passed to the compiler.
253
+ * The value can be changed by setting `bundlerConfigPath` in nativescript.config.
254
+ */
255
+ bundlerConfigPath: string;
211
256
  projectName: string;
212
257
 
213
258
  /**
@@ -218,7 +263,7 @@ interface IProjectData extends ICreateProjectData {
218
263
  initializeProjectData(projectDir?: string): void;
219
264
  initializeProjectDataFromContent(
220
265
  packageJsonContent: string,
221
- projectDir?: string
266
+ projectDir?: string,
222
267
  ): void;
223
268
  getAppDirectoryPath(projectDir?: string): string;
224
269
  getAppDirectoryRelativePath(): string;
@@ -309,7 +354,7 @@ interface IProjectDataService {
309
354
  */
310
355
  getRuntimePackage(
311
356
  projectDir: string,
312
- platform: SupportedPlatform
357
+ platform: SupportedPlatform,
313
358
  ): IBasePluginData;
314
359
 
315
360
  /**
@@ -329,7 +374,7 @@ interface IProjectCleanupService {
329
374
  */
330
375
  clean(
331
376
  pathsToClean: string[],
332
- options?: IProjectCleanupOptions
377
+ options?: IProjectCleanupOptions,
333
378
  ): Promise<IProjectCleanupResult>;
334
379
 
335
380
  /**
@@ -338,7 +383,7 @@ interface IProjectCleanupService {
338
383
  */
339
384
  cleanPath(
340
385
  pathToClean: string,
341
- options?: IProjectCleanupOptions
386
+ options?: IProjectCleanupOptions,
342
387
  ): Promise<IProjectCleanupResult>;
343
388
  }
344
389
 
@@ -440,7 +485,7 @@ interface IProjectConfigService {
440
485
 
441
486
  writeLegacyNSConfigIfNeeded(
442
487
  projectDir: string,
443
- runtimePackage: IBasePluginData
488
+ runtimePackage: IBasePluginData,
444
489
  ): Promise<void>;
445
490
  }
446
491
 
@@ -543,14 +588,14 @@ interface IProjectTemplatesService {
543
588
  */
544
589
  prepareTemplate(
545
590
  templateName: string,
546
- projectDir: string
591
+ projectDir: string,
547
592
  ): Promise<ITemplateData>;
548
593
  }
549
594
 
550
595
  interface IPlatformProjectServiceBase {
551
596
  getPluginPlatformsFolderPath(
552
597
  pluginData: IPluginData,
553
- platform: string
598
+ platform: string,
554
599
  ): string;
555
600
  getFrameworkVersion(projectData: IProjectData): string;
556
601
  }
@@ -612,7 +657,7 @@ interface ILocalBuildService {
612
657
  */
613
658
  build(
614
659
  platform: string,
615
- platformBuildOptions: IPlatformBuildData
660
+ platformBuildOptions: IPlatformBuildData,
616
661
  ): Promise<string>;
617
662
  /**
618
663
  * Removes build artifacts specific to the platform
@@ -632,7 +677,7 @@ interface ITestExecutionService {
632
677
  startKarmaServer(
633
678
  platform: string,
634
679
  liveSyncInfo: ILiveSyncInfo,
635
- deviceDescriptors: ILiveSyncDeviceDescriptor[]
680
+ deviceDescriptors: ILiveSyncDeviceDescriptor[],
636
681
  ): Promise<void>;
637
682
  canStartKarmaServer(projectData: IProjectData): Promise<boolean>;
638
683
  }
@@ -666,17 +711,17 @@ interface ICocoaPodsService {
666
711
  */
667
712
  applyPodfileFromAppResources(
668
713
  projectData: IProjectData,
669
- platformData: IPlatformData
714
+ platformData: IPlatformData,
670
715
  ): Promise<void>;
671
716
 
672
717
  applyPodfileArchExclusions(
673
718
  projectData: IProjectData,
674
- platformData: IPlatformData
719
+ platformData: IPlatformData,
675
720
  ): Promise<void>;
676
721
 
677
722
  applyPodfileFromExtensions(
678
723
  projectData: IProjectData,
679
- platformData: IPlatformData
724
+ platformData: IPlatformData,
680
725
  ): Promise<void>;
681
726
 
682
727
  /**
@@ -691,7 +736,7 @@ interface ICocoaPodsService {
691
736
  moduleName: string,
692
737
  podfilePath: string,
693
738
  projectData: IProjectData,
694
- platformData: IPlatformData
739
+ platformData: IPlatformData,
695
740
  ): Promise<void>;
696
741
 
697
742
  /**
@@ -713,7 +758,7 @@ interface ICocoaPodsService {
713
758
  moduleName: string,
714
759
  podfilePath: string,
715
760
  projectData: IProjectData,
716
- nativeProjectPath: string
761
+ nativeProjectPath: string,
717
762
  ): void;
718
763
 
719
764
  /**
@@ -731,7 +776,7 @@ interface ICocoaPodsService {
731
776
  */
732
777
  executePodInstall(
733
778
  projectRoot: string,
734
- xcodeProjPath: string
779
+ xcodeProjPath: string,
735
780
  ): Promise<ISpawnResult>;
736
781
 
737
782
  /**
@@ -743,7 +788,7 @@ interface ICocoaPodsService {
743
788
  mergePodXcconfigFile(
744
789
  projectData: IProjectData,
745
790
  platformData: IPlatformData,
746
- opts: IRelease
791
+ opts: IRelease,
747
792
  ): Promise<void>;
748
793
  }
749
794
 
@@ -751,16 +796,16 @@ interface ICocoaPodsPlatformManager {
751
796
  addPlatformSection(
752
797
  projectData: IProjectData,
753
798
  podfilePlatformData: IPodfilePlatformData,
754
- projectPodfileContent: string
799
+ projectPodfileContent: string,
755
800
  ): string;
756
801
  removePlatformSection(
757
802
  moduleName: string,
758
803
  projectPodFileContent: string,
759
- podfilePath: string
804
+ podfilePath: string,
760
805
  ): string;
761
806
  replacePlatformRow(
762
807
  podfileContent: string,
763
- podfilePath: string
808
+ podfilePath: string,
764
809
  ): { replacedContent: string; podfilePlatformData: IPodfilePlatformData };
765
810
  }
766
811
 
@@ -785,24 +830,24 @@ interface IIOSNativeTargetService {
785
830
  targetType: string,
786
831
  project: IXcode.project,
787
832
  platformData: IPlatformData,
788
- parentTarget?: string
833
+ parentTarget?: string,
789
834
  ): IXcode.target;
790
835
  prepareSigning(
791
836
  targetUuids: string[],
792
837
  projectData: IProjectData,
793
- projectPath: string
838
+ projectPath: string,
794
839
  ): void;
795
840
  getTargetDirectories(folderPath: string): string[];
796
841
  setXcodeTargetBuildConfigurationProperties(
797
842
  properties: IXcodeTargetBuildConfigurationProperty[],
798
843
  targetName: string,
799
- project: IXcode.project
844
+ project: IXcode.project,
800
845
  ): void;
801
846
  setConfigurationsFromJsonFile(
802
847
  jsonPath: string,
803
848
  targetUuid: string,
804
849
  targetName: string,
805
- project: IXcode.project
850
+ project: IXcode.project,
806
851
  ): void;
807
852
  }
808
853
 
@@ -811,7 +856,7 @@ interface IIOSNativeTargetService {
811
856
  */
812
857
  interface IIOSExtensionsService {
813
858
  addExtensionsFromPath(
814
- options: IAddExtensionsFromPathOptions
859
+ options: IAddExtensionsFromPathOptions,
815
860
  ): Promise<boolean>;
816
861
  removeExtensions(options: IRemoveExtensionsOptions): void;
817
862
  }
@@ -842,6 +887,38 @@ interface IRemoveExtensionsOptions {
842
887
 
843
888
  interface IRemoveWatchAppOptions extends IRemoveExtensionsOptions {}
844
889
 
890
+ interface IWatchAppJSONConfigModule {
891
+ name?: string;
892
+ path: string;
893
+ targetType?: string;
894
+ embed?: boolean;
895
+ frameworks?: Array<string | Record<string, string>>;
896
+ dependencies?: string[];
897
+ headerSearchPaths?: string[];
898
+ resources?: string[];
899
+ src?: string[];
900
+ linkerFlags?: string[];
901
+ buildConfigurationProperties?: Record<string, string>;
902
+ SPMPackages?: Array<IOSSPMPackage | string>;
903
+ }
904
+ interface IWatchAppJSONConfig {
905
+ targetType?: string;
906
+ forceAddEmbedWatchContent?: boolean;
907
+ sharedModulesBuildConfigurationProperties?: Record<string, string>;
908
+ basedir?: string;
909
+ infoPlistPath?: string;
910
+ xcprivacyPath?: string;
911
+ importSourcesFromMainFolder?: boolean;
912
+ importResourcesFromMainFolder?: boolean;
913
+ resources?: string[];
914
+ src?: string[];
915
+ resourcesExclude?: string[];
916
+ srcExclude?: string[];
917
+ modules: IWatchAppConfigModule[];
918
+ SPMPackages?: Array<IOSSPMPackage>;
919
+ }
920
+
921
+
845
922
  interface IRubyFunction {
846
923
  functionName: string;
847
924
  functionParameters?: string;
@@ -1,9 +1,13 @@
1
- import { AffixOptions } from "temp";
1
+ export type AffixOptions = {
2
+ prefix?: string;
3
+ suffix?: string;
4
+ dir?: string;
5
+ };
2
6
 
3
7
  /**
4
8
  * Declares wrapped functions of temp module
5
9
  */
6
- interface ITempService {
10
+ export interface ITempService {
7
11
  mkdirSync(affixes: string | AffixOptions): Promise<string>;
8
12
  path(options: string | AffixOptions): Promise<string>;
9
13
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const color_1 = require("../color");
4
+ const node_util_1 = require("node:util");
4
5
  const yok_1 = require("../common/yok");
5
6
  class KeyCommandHelper {
6
7
  constructor() {
@@ -33,7 +34,7 @@ class KeyCommandHelper {
33
34
  }
34
35
  if (keyCommand.key !== "\u0003") {
35
36
  const line = ` ${color_1.color.dim("→")} ${color_1.color.bold(keyCommand.key)} — ${keyCommand.description}`;
36
- const lineLength = (0, color_1.stripColors)(line).length - 1;
37
+ const lineLength = (0, node_util_1.stripVTControlCharacters)(line).length - 1;
37
38
  console.log(color_1.color.dim(` ┌${"─".repeat(lineLength)}┐`));
38
39
  console.log(line + color_1.color.dim(" │"));
39
40
  console.log(color_1.color.dim(` └${"─".repeat(lineLength)}┘`));
@@ -5,6 +5,34 @@ require("./bootstrap");
5
5
  const shelljs = require("shelljs");
6
6
  shelljs.config.silent = true;
7
7
  shelljs.config.fatal = true;
8
+ if (process.platform === "win32") {
9
+ const realcp = shelljs.cp;
10
+ shelljs.cp = (...args) => {
11
+ if (args.length === 3) {
12
+ args[1] = replaceDashes(args[1]);
13
+ }
14
+ else {
15
+ args[0] = replaceDashes(args[0]);
16
+ }
17
+ if (args.length == 2) {
18
+ realcp(args[0], args[1]);
19
+ }
20
+ else {
21
+ realcp(args[0], args[1], args[2]);
22
+ }
23
+ };
24
+ function replaceDashes(values) {
25
+ if (Array.isArray(values)) {
26
+ for (let i = 0; i < values.length; ++i) {
27
+ values[i] = replaceDashes(values[i]);
28
+ }
29
+ return values;
30
+ }
31
+ else {
32
+ return values.replace(/\\/g, "/");
33
+ }
34
+ }
35
+ }
8
36
  const errors_1 = require("./common/errors");
9
37
  const helpers_1 = require("./common/helpers");
10
38
  const yok_1 = require("./common/yok");
@@ -30,7 +30,7 @@ class NodePackageManager extends base_package_manager_1.BasePackageManager {
30
30
  const packageJsonPath = (0, path_1.join)(pathToSave, "package.json");
31
31
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
32
32
  const flags = this.getFlagsString(config, true);
33
- let params = ["install", "--legacy-peer-deps"];
33
+ let params = ["install"];
34
34
  const isInstallingAllDependencies = packageName === pathToSave;
35
35
  if (!isInstallingAllDependencies) {
36
36
  params.push(packageName);
package/lib/options.js CHANGED
@@ -220,7 +220,11 @@ class Options {
220
220
  appleSessionBase64: { type: "string", hasSensitiveValue: true },
221
221
  jar: { type: "string", hasSensitiveValue: true },
222
222
  aar: { type: "string", hasSensitiveValue: true },
223
+ dtsGeneratorPath: { type: "string", hasSensitiveValue: true },
223
224
  filter: { type: "string", hasSensitiveValue: true },
225
+ lookupPath: { type: "string", hasSensitiveValue: true },
226
+ super: { type: "string", hasSensitiveValue: true },
227
+ skipDeclarations: { type: "boolean", hasSensitiveValue: false },
224
228
  git: {
225
229
  type: "boolean",
226
230
  hasSensitiveValue: false,
@@ -56,6 +56,7 @@ class ProjectData {
56
56
  this.errorInvalidProject(projectDir);
57
57
  }
58
58
  initializeProjectDataFromContent(packageJsonContent, projectDir) {
59
+ var _a, _b;
59
60
  projectDir = projectDir || this.$projectHelper.projectDir || "";
60
61
  this.projectDir = projectDir;
61
62
  const projectFilePath = this.getProjectFilePath(projectDir);
@@ -92,10 +93,15 @@ class ProjectData {
92
93
  this.buildXcconfigPath = path.join(this.appResourcesDirectoryPath, this.$devicePlatformsConstants.iOS, constants.BUILD_XCCONFIG_FILE_NAME);
93
94
  this.podfilePath = path.join(this.appResourcesDirectoryPath, this.$devicePlatformsConstants.iOS, constants.PODFILE_NAME);
94
95
  this.isShared = !!(this.nsConfig && this.nsConfig.shared);
95
- this.webpackConfigPath =
96
- this.nsConfig && this.nsConfig.webpackConfigPath
97
- ? path.resolve(this.projectDir, this.nsConfig.webpackConfigPath)
98
- : path.join(this.projectDir, "webpack.config.js");
96
+ const webpackConfigPath = this.nsConfig && this.nsConfig.webpackConfigPath
97
+ ? path.resolve(this.projectDir, this.nsConfig.webpackConfigPath)
98
+ : path.join(this.projectDir, "webpack.config.js");
99
+ this.webpackConfigPath = webpackConfigPath;
100
+ this.bundlerConfigPath =
101
+ this.nsConfig && this.nsConfig.bundlerConfigPath
102
+ ? path.resolve(this.projectDir, this.nsConfig.bundlerConfigPath)
103
+ : webpackConfigPath;
104
+ this.bundler = (_b = (_a = this === null || this === void 0 ? void 0 : this.nsConfig) === null || _a === void 0 ? void 0 : _a.bundler) !== null && _b !== void 0 ? _b : "webpack";
99
105
  return;
100
106
  }
101
107
  this.errorInvalidProject(projectDir);
@@ -44,7 +44,7 @@ process.on("message", async (data) => {
44
44
  analyticsLoggingService.logData({
45
45
  message: `analytics-broker-process will send ${"ProcessFinishedTasks"} message`,
46
46
  });
47
- process.send("ProcessFinishedTasks", () => {
47
+ process.send("ProcessFinishedTasks", null, null, () => {
48
48
  analyticsLoggingService.logData({
49
49
  message: `analytics-broker-process sent ${"ProcessFinishedTasks"} message and will exit gracefully now`,
50
50
  });
@@ -167,7 +167,8 @@ class AnalyticsService {
167
167
  const projectData = this.$projectDataService.getProjectData(projectDir);
168
168
  customDimensions["cd2"] =
169
169
  projectData.projectType;
170
- customDimensions["cd9"] = projectData.isShared.toString();
170
+ customDimensions["cd9"] =
171
+ projectData.isShared.toString();
171
172
  }
172
173
  return customDimensions;
173
174
  }
@@ -29,7 +29,8 @@ class AnalyticsSettingsService {
29
29
  return this.getSettingValueOrDefault(this.$staticConfig.ANALYTICS_INSTALLATION_ID_SETTING_NAME);
30
30
  }
31
31
  getClientName() {
32
- return "" + color_1.color.cyan.bold(this.$staticConfig.CLIENT_NAME_ALIAS);
32
+ return ("" +
33
+ color_1.color.styleText(["cyan", "bold"], this.$staticConfig.CLIENT_NAME_ALIAS));
33
34
  }
34
35
  async getUserSessionsCount(projectName) {
35
36
  const sessionsCountForProject = await this.$userSettingsService.getSettingValue(this.getSessionsProjectKey(projectName));
@@ -4,6 +4,7 @@ exports.GradleBuildArgsService = void 0;
4
4
  const path = require("path");
5
5
  const constants_1 = require("../../common/constants");
6
6
  const yok_1 = require("../../common/yok");
7
+ const constants_2 = require("../../constants");
7
8
  class GradleBuildArgsService {
8
9
  constructor($androidToolsInfo, $hooksService, $analyticsService, $staticConfig, $projectData, $logger) {
9
10
  this.$androidToolsInfo = $androidToolsInfo;
@@ -45,18 +46,21 @@ class GradleBuildArgsService {
45
46
  args.push(...additionalArgs);
46
47
  }
47
48
  if (buildData.release) {
48
- args.push("-Prelease", `-PksPath=${path.resolve(buildData.keyStorePath)}`, `-Palias=${buildData.keyStoreAlias}`, `-Ppassword=${buildData.keyStoreAliasPassword}`, `-PksPassword=${buildData.keyStorePassword}`);
49
+ args.push("-Prelease");
50
+ }
51
+ if (buildData.release || buildData.keyStorePath) {
52
+ args.push(`-PksPath=${path.resolve(buildData.keyStorePath)}`, `-Palias=${buildData.keyStoreAlias}`, `-Ppassword=${buildData.keyStoreAliasPassword}`, `-PksPassword=${buildData.keyStorePassword}`);
49
53
  }
50
54
  return args;
51
55
  }
52
56
  getBuildLoggingArgs() {
53
57
  const args = [];
54
58
  const logLevel = this.$logger.getLevel();
55
- if (logLevel === "TRACE") {
59
+ if (logLevel === constants_2.LoggerLevel.TRACE) {
56
60
  args.push("--debug");
57
61
  }
58
- else if (logLevel === "INFO") {
59
- args.push("--quiet");
62
+ else if (logLevel === constants_2.LoggerLevel.DEBUG) {
63
+ args.push("--info");
60
64
  }
61
65
  return args;
62
66
  }
@@ -17,7 +17,10 @@ class GradleBuildService extends events_1.EventEmitter {
17
17
  const buildTaskArgs = await this.$gradleBuildArgsService.getBuildTaskArgs(buildData);
18
18
  if (buildData.buildFilterDevicesArch) {
19
19
  let devices = this.$devicesService.getDevicesForPlatform(buildData.platform);
20
- if (buildData.emulator) {
20
+ if (buildData.device) {
21
+ devices = devices.filter((d) => d.deviceInfo.identifier === buildData.device);
22
+ }
23
+ else if (buildData.emulator) {
21
24
  devices = devices.filter((d) => d.isEmulator);
22
25
  }
23
26
  const abis = devices
@@ -454,7 +454,7 @@ class AndroidPluginBuildService {
454
454
  localArgs.push(...additionalArgs);
455
455
  }
456
456
  if (this.$logger.getLevel() === "INFO") {
457
- localArgs.push("--quiet");
457
+ localArgs.push("--info");
458
458
  }
459
459
  const opts = {
460
460
  cwd: pluginBuildSettings.pluginDir,
@@ -448,17 +448,19 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
448
448
  if (!this.$fs.exists(apkOutputPath)) {
449
449
  return;
450
450
  }
451
- const device = this.$devicesService
452
- .getDevicesForPlatform(deviceDescriptor.buildData.platform)
453
- .filter((d) => d.deviceInfo.identifier === deviceDescriptor.identifier)[0];
454
- const abis = device.deviceInfo.abis.filter((a) => !!a && a.length)[0];
455
451
  const directoryContent = this.$fs.readDirectory(apkOutputPath);
456
- const regexp = new RegExp(`${abis}.*\.apk`);
457
- const files = _.filter(directoryContent, (entry) => {
458
- return regexp.test(entry);
459
- });
460
- if (files.length === 0) {
461
- changesInfo.nativeChanged = true;
452
+ if (!directoryContent.find(f => f.indexOf("universal") !== -1)) {
453
+ const device = this.$devicesService
454
+ .getDevicesForPlatform(deviceDescriptor.buildData.platform)
455
+ .filter((d) => d.deviceInfo.identifier === deviceDescriptor.identifier)[0];
456
+ const abis = device.deviceInfo.abis.filter((a) => !!a && a.length)[0];
457
+ const regexp = new RegExp(`${abis}.*\.apk`);
458
+ const files = _.filter(directoryContent, (entry) => {
459
+ return regexp.test(entry);
460
+ });
461
+ if (files.length === 0) {
462
+ changesInfo.nativeChanged = true;
463
+ }
462
464
  }
463
465
  }
464
466
  });
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AssetsGenerationService = void 0;
10
- const Jimp = require("jimp");
10
+ const JimpModule = require("jimp");
11
11
  const Color = require("color");
12
12
  const decorators_1 = require("../../common/decorators");
13
13
  const constants_1 = require("../../constants");
@@ -67,7 +67,7 @@ class AssetsGenerationService {
67
67
  }
68
68
  try {
69
69
  const color = (_e = (_c = generationData[(_b = assetItem.data) === null || _b === void 0 ? void 0 : _b.fromKey]) !== null && _c !== void 0 ? _c : (_d = assetItem.data) === null || _d === void 0 ? void 0 : _d.default) !== null && _e !== void 0 ? _e : "white";
70
- const colorHEX = Jimp.cssColorToHex(color);
70
+ const colorHEX = JimpModule.cssColorToHex(color);
71
71
  const hex = (_f = colorHEX === null || colorHEX === void 0 ? void 0 : colorHEX.toString(16).substring(0, 6)) !== null && _f !== void 0 ? _f : "FFFFFF";
72
72
  this.$fs.writeFile(assetItem.path, [
73
73
  `<?xml version="1.0" encoding="utf-8"?>`,
@@ -112,38 +112,49 @@ class AssetsGenerationService {
112
112
  constants_1.AssetConstants.defaultOverlayImageScale;
113
113
  const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
114
114
  image = await this.resize(generationData.imagePath, imageResize, imageResize);
115
- image = this.generateImage(background, width, height, outputPath, image);
115
+ image = this.generateImage(background, width, height, image);
116
116
  break;
117
117
  case "blank":
118
- image = this.generateImage(background, width, height, outputPath);
118
+ image = this.generateImage(background, width, height);
119
119
  break;
120
120
  case "resize":
121
121
  image = await this.resize(generationData.imagePath, width, height);
122
122
  break;
123
123
  case "outerScale":
124
124
  image = await this.resize(generationData.imagePath, assetItem.width, assetItem.height);
125
- image = this.generateImage("#00000000", width, height, outputPath, image);
125
+ image = this.generateImage("#00000000", width, height, image);
126
126
  break;
127
127
  default:
128
128
  throw new Error(`Invalid image generation operation: ${operation}`);
129
129
  }
130
130
  if (assetItem.rgba === false) {
131
- image = image.colorType(2);
131
+ image = this.generateImage("#FFFFFF", image.width, image.height, image);
132
+ }
133
+ if (this.isAssetFilePath(outputPath)) {
134
+ image.write(outputPath);
135
+ }
136
+ else {
137
+ this.$logger.warn(`Incorrect destination path ${outputPath} for image ${assetItem.filename}`);
132
138
  }
133
- image.write(outputPath);
134
139
  }
135
140
  }
136
141
  async resize(imagePath, width, height) {
137
- const image = await Jimp.read(imagePath);
138
- return image.scaleToFit(width, height);
142
+ const image = await JimpModule.Jimp.read(imagePath);
143
+ return image.scaleToFit({
144
+ w: width,
145
+ h: height,
146
+ });
139
147
  }
140
- generateImage(background, width, height, outputPath, overlayImage) {
141
- const J = Jimp;
148
+ generateImage(background, width, height, overlayImage) {
142
149
  const backgroundColor = this.getRgbaNumber(background);
143
- let image = new J(width, height, backgroundColor);
150
+ let image = new JimpModule.Jimp({
151
+ width,
152
+ height,
153
+ color: backgroundColor,
154
+ });
144
155
  if (overlayImage) {
145
- const centeredWidth = (width - overlayImage.bitmap.width) / 2;
146
- const centeredHeight = (height - overlayImage.bitmap.height) / 2;
156
+ const centeredWidth = (width - overlayImage.width) / 2;
157
+ const centeredHeight = (height - overlayImage.height) / 2;
147
158
  image = image.composite(overlayImage, centeredWidth, centeredHeight);
148
159
  }
149
160
  return image;
@@ -152,7 +163,14 @@ class AssetsGenerationService {
152
163
  const color = new Color(colorString);
153
164
  const colorRgb = color.rgb();
154
165
  const alpha = Math.round(colorRgb.alpha() * 255);
155
- return Jimp.rgbaToInt(colorRgb.red(), colorRgb.green(), colorRgb.blue(), alpha);
166
+ return JimpModule.rgbaToInt(colorRgb.red(), colorRgb.green(), colorRgb.blue(), alpha);
167
+ }
168
+ isAssetFilePath(path) {
169
+ if (!path) {
170
+ return false;
171
+ }
172
+ const index = path.lastIndexOf(".");
173
+ return index > -1 && index < path.length - 1;
156
174
  }
157
175
  }
158
176
  exports.AssetsGenerationService = AssetsGenerationService;