Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: many new android features #5774

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
cb695e6
feat: allow to ignore native dependencies
farfromrefug May 7, 2021
0005db5
merge
farfromrefug Jul 27, 2021
66fc8b1
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Jul 27, 2021
ae75c50
fix allow plugins to use kt files
farfromrefug Jul 29, 2021
5c8db12
fix: remove plugins duplicates
farfromrefug Aug 20, 2021
21a99d3
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Aug 20, 2021
bca2b25
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Aug 29, 2021
e019098
fix: update plugin gradle script
farfromrefug Sep 26, 2021
06a08b4
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Sep 26, 2021
bafc35f
fix: require.resolve for packages with exports field in package.json
rigor789 Sep 27, 2021
b8bd8f5
Merge branch 'NativeScript:master' into master
farfromrefug Sep 28, 2021
38d2fb4
Merge pull request #1 from NativeScript/fix/require-resolve-with-exports
farfromrefug Sep 28, 2021
3066c6a
Merge branch 'master' of github.com:farfromrefug/nativescript-cli
farfromrefug Sep 28, 2021
68e541c
feat: allow plugin blacklist metadata
farfromrefug Sep 30, 2021
8ca0889
fix: fix source map path
farfromrefug Sep 30, 2021
63a4620
chore: refactoring
farfromrefug Oct 3, 2021
29439ca
fix: makes libs smaller and build faster
farfromrefug Oct 3, 2021
aa56395
fix: remove unneeded R.class and BuildConfig.class for plugins
farfromrefug Oct 3, 2021
e0c1824
feat(android): add gradle 7+ support
triniwiz Dec 20, 2021
3dd3744
Merge branch 'feat/gradle-7' of github.com:NativeScript/nativescript-cli
farfromrefug Dec 20, 2021
9f66f72
chore: cleanup
farfromrefug Feb 15, 2022
7dc8bdc
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Feb 15, 2022
2fa7722
fix: kotlin version fix
farfromrefug Feb 15, 2022
0b55d42
feat: `--gradle` option to specify custom gradle binary
farfromrefug Feb 15, 2022
2128946
fix: pass gradlePath to plugin build
farfromrefug Feb 15, 2022
8d1eba9
fix: rename gradle option to gradlePath
farfromrefug Feb 15, 2022
d00c7ac
chore: upgraded yargs and typescript
farfromrefug Feb 15, 2022
78e88eb
feat: implemented `--gradle` option to pass gradle parameters
farfromrefug Feb 15, 2022
e8e39b4
fix: correctly allow plugins build to detect before-plugins.gradle
farfromrefug Feb 15, 2022
ac53b20
chore: cleanup logs
farfromrefug Feb 15, 2022
6e7eb1e
chore: also pass `appPath` to plugin gradle build
farfromrefug Feb 15, 2022
9333c31
feat: only install corresponding abi package when possible
farfromrefug Feb 20, 2022
2ee8e48
fix: better `copyAppPackages` handle
farfromrefug Feb 20, 2022
6993657
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Feb 21, 2022
dc28cf7
feat: `filterDevicesArch` option to build only abi of connected devic…
farfromrefug Feb 21, 2022
ec20d60
chore: fix after merge
farfromrefug Feb 21, 2022
d68e529
fix: filter for emulator only
farfromrefug Feb 21, 2022
7d57dc9
chore: default `filterDevicesArch` to true
farfromrefug Feb 21, 2022
cbd37d1
fix: handle `gradleArgs` as an array option
farfromrefug Feb 22, 2022
e548004
fix: prevent error with `pnpm` which can put `+` in plugin path
farfromrefug Mar 2, 2022
ded3485
feat(android): flavor support
farfromrefug Mar 2, 2022
82bd9d6
chore: use replace instead
farfromrefug Mar 2, 2022
d474b7c
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Mar 3, 2022
8365318
feat: android plugin build will use its own plugin dependencies to build
farfromrefug Mar 7, 2022
eb8379e
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Mar 10, 2022
ef76fb8
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Mar 24, 2022
654542b
fix: fix plugin build after merge
farfromrefug Mar 25, 2022
29fb000
chore: cleanup
farfromrefug Apr 4, 2022
141aac8
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Jun 1, 2022
8195d22
fix: android plugins now built using same “gradle” as apps
farfromrefug Jun 23, 2022
03a5379
chore: removed logs
farfromrefug Jun 23, 2022
e52d86d
chore: cleanup
farfromrefug Jun 27, 2022
c2200a3
fix: refactor to be compatible with older runtimers
farfromrefug Jun 27, 2022
e39c3d3
fix: vendor build.gradle fix
farfromrefug Jul 1, 2022
f1b1269
fix: gradle methods order fix
farfromrefug Jul 16, 2022
d3396e8
feat(profiling): generate chrome compatible timeline data
rigor789 Jul 30, 2022
bf06999
Merge remote-tracking branch 'nativescript/master'
farfromrefug Aug 9, 2022
3ef5d47
Merge remote-tracking branch 'nativescript/feat/chrome-timeline-profi…
farfromrefug Aug 9, 2022
3975f1a
Merge remote-tracking branch 'nativescript/master'
farfromrefug Aug 24, 2022
0b2d85c
fix: correctly get device abi
farfromrefug Oct 10, 2022
892e682
Merge branch 'master' of github.com:farfromrefug/nativescript-cli
farfromrefug Oct 10, 2022
272aff9
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Oct 10, 2022
149936e
Merge branch 'master' of github.com:NativeScript/nativescript-cli
farfromrefug Oct 18, 2022
5042306
chore: vendor plugin refactoring
farfromrefug Oct 21, 2022
c651089
Merge remote-tracking branch 'origin/master'
farfromrefug Oct 21, 2022
b35af16
feat: yarn2+ support
farfromrefug Nov 18, 2022
f4a986f
fix: some yarn2 fixes
farfromrefug Nov 18, 2022
52fb336
chore: project
farfromrefug Nov 18, 2022
93c17d8
fix(android): support unsigned apks
farfromrefug Dec 4, 2022
798c9a9
chore: yarn2 fixes
farfromrefug Dec 4, 2022
16b2416
Update package.json
farfromrefug Dec 15, 2022
c6e8e22
Merge branch 'master' of [email protected]:farfromrefug/nativescript-cli…
farfromrefug Dec 15, 2022
1c5d2cc
fix: another yarn 2+ fix
farfromrefug Dec 21, 2022
a32ba3f
Merge branch 'master' of github.com:farfromrefug/nativescript-cli
farfromrefug Jan 12, 2023
9d8df5f
Merge remote-tracking branch 'nativescript/main'
farfromrefug Jun 16, 2023
29de089
chore: cleanup
farfromrefug Aug 13, 2023
713be65
fix: get framework name from Info.plist
farfromrefug Sep 11, 2023
21a609d
Merge remote-tracking branch 'origin/main'
farfromrefug Sep 11, 2023
e341c31
chore: merge fix
farfromrefug Sep 11, 2023
51ca951
fix: allow cpp in android plugins
farfromrefug Sep 21, 2023
b5fef05
Merge remote-tracking branch 'origin/master'
farfromrefug Sep 21, 2023
7c6dc40
feat(android): allow to force gradle version throught nativescript-co…
farfromrefug Oct 17, 2023
bd5263d
feat(android): app gradle files now coming from CLI to prevent depend…
farfromrefug Oct 17, 2023
4f84b58
chore: lock
farfromrefug Oct 17, 2023
8b0a5ff
chore: changes to go with merge
farfromrefug Oct 17, 2023
1a110e1
chore: updated script for gradle 8
farfromrefug Oct 17, 2023
54ed89d
fix(android): add `--stacktrace` to any gradle build
farfromrefug Oct 17, 2023
5560853
fix(android): copy all other directories from App_Resources/Android t…
farfromrefug Oct 17, 2023
4abb7d9
fix(android): use absolute path to ensure it is good from every andro…
farfromrefug Oct 17, 2023
094372d
fix: more android app gradle file fixes
farfromrefug Oct 19, 2023
cbbda1c
fix: timeline profile format fix to be compatible with firefox profiler
farfromrefug Oct 19, 2023
cb44cf8
chore: more gradle updates
farfromrefug Oct 24, 2023
ed2b84a
feat(android): allow app to define `ndkVersion` to be used for plugin…
farfromrefug Nov 5, 2023
7c010fe
fix(android): in case we use `buildFilterDevicesArch` check if we nee…
farfromrefug Nov 8, 2023
06dfc73
feat(android): custom `buildPath` from `nativescript.config`
farfromrefug Nov 26, 2023
16bc22d
chore: should be commented
farfromrefug Nov 26, 2023
dc50c28
fix(android): going recursive is pretty dangerous and should not be n…
farfromrefug Nov 26, 2023
a626021
chore: default projectRoot fix
farfromrefug Nov 26, 2023
ae96032
fix: default USER_PROJECT_ROOT path fix
farfromrefug Nov 29, 2023
b72ffaa
fix: more android env build fixes
farfromrefug Nov 29, 2023
c17417b
feat: new `syncChangedDataOnDevices`. also send the changed files in …
farfromrefug Dec 1, 2023
da9b7f9
Merge remote-tracking branch 'nativescript/main'
farfromrefug Dec 1, 2023
d8bd6e9
feat: add --json option to `ns config`
Dec 7, 2023
3628490
fix: try multiple ways to get Info.plist from framework
farfromrefug Dec 12, 2023
16b2945
Merge branch 'master' of github.com:farfromrefug/nativescript-cli
farfromrefug Dec 12, 2023
48e603d
fix: better fix for custom build folder so that it works too in andro…
Dec 15, 2023
0793d44
fix: another gradle 8 fix to make the sentry plugin work. Should not …
Dec 15, 2023
de89c09
Merge remote-tracking branch 'origin/master'
Dec 15, 2023
b15679a
fix: gradle script replace fix
Dec 15, 2023
d25445b
Merge remote-tracking branch 'nativescript/main'
Dec 18, 2023
a10c9b5
fix(android): non eager namespace replace in manifest
farfromrefug Feb 16, 2024
aa6f565
chore: another android gradle rule...
farfromrefug Feb 16, 2024
b40cf83
Update lib/controllers/platform-controller.ts
farfromrefug Mar 13, 2024
ecaaf44
Update lib/controllers/prepare-controller.ts
farfromrefug Mar 13, 2024
2bbe084
Update lib/services/device/device-install-app-service.ts
farfromrefug Mar 13, 2024
6e1a227
chore: cleanup gradle task as it seems to work fine like this
farfromrefug Mar 13, 2024
dffe847
chore: we push --stacktrace all the time now
farfromrefug Mar 13, 2024
43c9d74
chore: testing
farfromrefug Mar 13, 2024
45d518b
chore: review
farfromrefug Mar 13, 2024
e61d7aa
Merge remote-tracking branch 'origin/new_big_merge_test' into new_big…
farfromrefug Mar 13, 2024
c1b8326
chore: adress comments
farfromrefug Mar 13, 2024
e1d95dc
Update lib/services/device/device-install-app-service.ts
farfromrefug Mar 13, 2024
6aa3ea3
chore: rename flavor option to gradleFlavor
farfromrefug Mar 13, 2024
50792ea
Merge remote-tracking branch 'nativescript/main' into new_big_merge_test
farfromrefug Mar 13, 2024
806855c
chore: tests
farfromrefug Mar 14, 2024
c3db9c2
chore: cleanup (mostly formatting)
rigor789 Apr 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
const buildData = this.$buildDataService.getBuildData(
this.$projectData.projectDir,
platform,
this.$options
{
...this.$options.argv,
// we disable buildFilterDevicesArch for build only to ensure we dont use it in production builds
buildFilterDevicesArch: false,
}
);
const outputPath = await this.$buildController.prepareAndBuild(buildData);

Expand Down
4 changes: 3 additions & 1 deletion lib/commands/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IProjectCleanupResult,
IProjectCleanupService,
IProjectConfigService,
IProjectData,
IProjectService,
} from "../definitions/project";

Expand Down Expand Up @@ -83,6 +84,7 @@ export class CleanCommand implements ICommand {
constructor(
private $projectCleanupService: IProjectCleanupService,
private $projectConfigService: IProjectConfigService,
private $projectData: IProjectData,
private $terminalSpinnerService: ITerminalSpinnerService,
private $projectService: IProjectService,
private $prompter: IPrompter,
Expand All @@ -108,7 +110,7 @@ export class CleanCommand implements ICommand {

let pathsToClean = [
constants.HOOKS_DIR_NAME,
constants.PLATFORMS_DIR_NAME,
this.$projectData.getBuildRelativeDirectoryPath(),
constants.NODE_MODULES_FOLDER_NAME,
constants.PACKAGE_LOCK_JSON_FILE_NAME,
];
Expand Down
9 changes: 8 additions & 1 deletion lib/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ import { IProjectConfigService } from "../definitions/project";
import { SupportedConfigValues } from "../tools/config-manipulation/config-transformer";
import { IErrors } from "../common/declarations";
import { color } from "../color";
import { IOptions } from "../declarations";

export class ConfigListCommand implements ICommand {
public allowedParameters: ICommandParameter[] = [];

constructor(
private $projectConfigService: IProjectConfigService,
private $options: IOptions,
private $logger: ILogger
) {}

public async execute(args: string[]): Promise<void> {
try {
const config = this.$projectConfigService.readConfig();
this.$logger.info(this.getValueString(config as SupportedConfigValues));
if (this.$options.json) {
console.log(JSON.stringify(config))
} else {
this.$logger.info(this.getValueString(config as SupportedConfigValues));

}
} catch (error) {
this.$logger.info("Failed to read config. Error is: ", error);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class TypingsCommand implements ICommand {

const dtsGeneratorPath = path.resolve(
this.$projectData.projectDir,
"platforms",
this.$projectData.getBuildRelativeDirectoryPath(),
"android",
"build-tools",
"dts-generator.jar"
Expand Down
5 changes: 5 additions & 0 deletions lib/common/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,11 @@ interface IDashedOption {
* Specifies either a single option key (string), or an array of options that must be followed by option values.
*/
requiresArg?: any;

/**
* Set to true to define the option as an array option https://github.com/yargs/yargs/blob/main/docs/api.md#array
*/
array?: any;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions lib/common/definitions/mobile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ declare global {
* For iOS simulators - same as the identifier.
*/
imageIdentifier?: string;

/**
* Optional property describing the architecture of the device
* Available for Android only
*/
abis?: string[];
}

interface IDeviceError extends Error, IDeviceIdentifier {}
Expand Down
31 changes: 21 additions & 10 deletions lib/common/mobile/android/android-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ interface IAndroidDeviceDetails {
name: string;
release: string;
brand: string;
"cpu.abi": string;
"cpu.abilist64": string;
"cpu.abilist32": string;
}

interface IAdbDeviceStatusInfo {
Expand Down Expand Up @@ -96,6 +99,10 @@ export class AndroidDevice implements Mobile.IAndroidDevice {
identifier: this.identifier,
displayName: details.name,
model: details.model,
abis: [
...details["cpu.abilist64"].split(","),
...details["cpu.abilist32"].split(","),
],
version,
vendor: details.brand,
platform: this.$devicePlatformsConstants.Android,
Expand All @@ -111,12 +118,14 @@ export class AndroidDevice implements Mobile.IAndroidDevice {
: [DeviceConnectionType.USB];

if (this.isEmulator) {
this.deviceInfo.displayName = await this.$androidEmulatorServices.getRunningEmulatorName(
this.identifier
);
this.deviceInfo.imageIdentifier = await this.$androidEmulatorServices.getRunningEmulatorImageIdentifier(
this.identifier
);
this.deviceInfo.displayName =
await this.$androidEmulatorServices.getRunningEmulatorName(
this.identifier
);
this.deviceInfo.imageIdentifier =
await this.$androidEmulatorServices.getRunningEmulatorImageIdentifier(
this.identifier
);
}

this.$logger.trace(this.deviceInfo);
Expand Down Expand Up @@ -161,9 +170,10 @@ export class AndroidDevice implements Mobile.IAndroidDevice {
// sample line is "ro.build.version.release=4.4" in /system/build.prop
// sample line from getprop is: [ro.build.version.release]: [6.0]
// NOTE: some props do not have value: [ro.build.version.base_os]: []
const match = /(?:\[?ro\.build\.version|ro\.product|ro\.build)\.(.+?)]?(?:\:|=)(?:\s*?\[)?(.*?)]?$/.exec(
value
);
const match =
/(?:\[?ro\.build\.version|ro\.product|ro\.build)\.(.+?)]?(?:\:|=)(?:\s*?\[)?(.*?)]?$/.exec(
value
);
if (match) {
parsedDetails[match[1]] = match[2];
}
Expand All @@ -189,7 +199,8 @@ export class AndroidDevice implements Mobile.IAndroidDevice {
}

private async getType(): Promise<string> {
const runningEmulatorIds = await this.$androidEmulatorServices.getRunningEmulatorIds();
const runningEmulatorIds =
await this.$androidEmulatorServices.getRunningEmulatorIds();
if (
_.find(runningEmulatorIds, (emulatorId) => emulatorId === this.identifier)
) {
Expand Down
1 change: 1 addition & 0 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const BUNDLE_DIR = "bundle";
export const RESOURCES_DIR = "res";
export const CONFIG_NS_FILE_NAME = "nsconfig.json";
export const CONFIG_NS_APP_RESOURCES_ENTRY = "appResourcesPath";
export const CONFIG_NS_BUILD_ENTRY = "buildPath";
export const CONFIG_NS_APP_ENTRY = "appPath";
export const CONFIG_FILE_NAME_DISPLAY = "nativescript.config.(js|ts)";
export const CONFIG_FILE_NAME_JS = "nativescript.config.js";
Expand Down
12 changes: 5 additions & 7 deletions lib/controllers/build-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class BuildController extends EventEmitter implements IBuildController {
);

if (buildData.copyTo) {
this.$buildArtifactsService.copyLatestAppPackage(
this.$buildArtifactsService.copyAppPackages(
buildData.copyTo,
platformData,
buildData
Expand Down Expand Up @@ -165,9 +165,8 @@ export class BuildController extends EventEmitter implements IBuildController {
return true;
}

const validBuildOutputData = platformData.getValidBuildOutputData(
buildData
);
const validBuildOutputData =
platformData.getValidBuildOutputData(buildData);
const packages = this.$buildArtifactsService.getAllAppPackages(
outputPath,
validBuildOutputData
Expand All @@ -176,9 +175,8 @@ export class BuildController extends EventEmitter implements IBuildController {
return true;
}

const prepareInfo = this.$projectChangesService.getPrepareInfo(
platformData
);
const prepareInfo =
this.$projectChangesService.getPrepareInfo(platformData);
const buildInfo = this.$buildInfoFileService.getLocalBuildInfo(
platformData,
buildData
Expand Down
11 changes: 5 additions & 6 deletions lib/controllers/deploy-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ export class DeployController {
},
};
await this.$prepareController.prepare(prepareData);
const packageFilePath = await deviceDescriptor.buildAction();
await this.$deviceInstallAppService.installOnDevice(
device,
{ ...deviceDescriptor.buildData, buildForDevice: !device.isEmulator },
packageFilePath
);
await deviceDescriptor.buildAction();
await this.$deviceInstallAppService.installOnDevice(device, {
...deviceDescriptor.buildData,
buildForDevice: !device.isEmulator,
});
};

await this.$devicesService.execute(
Expand Down
3 changes: 2 additions & 1 deletion lib/controllers/migrate-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class MigrateController
private $pluginsService: IPluginsService,
private $projectDataService: IProjectDataService,
private $projectConfigService: IProjectConfigService,
private $projectData: IProjectData,
private $options: IOptions,
private $resources: IResourceLoader,
private $injector: IInjector,
Expand Down Expand Up @@ -721,7 +722,7 @@ export class MigrateController
private async cleanUpProject(projectData: IProjectData): Promise<void> {
await this.$projectCleanupService.clean([
constants.HOOKS_DIR_NAME,
constants.PLATFORMS_DIR_NAME,
this.$projectData.getBuildRelativeDirectoryPath(),
constants.NODE_MODULES_FOLDER_NAME,
constants.PACKAGE_LOCK_JSON_FILE_NAME,
]);
Expand Down
35 changes: 18 additions & 17 deletions lib/controllers/platform-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,15 @@ export class PlatformController implements IPlatformController {

this.$logger.trace("Determined package to install is", packageToInstall);

const installedPlatformVersion = await this.$addPlatformService.addPlatformSafe(
projectData,
platformData,
packageToInstall,
addPlatformData
);

this.$fs.ensureDirectoryExists(
path.join(projectData.platformsDir, platform)
);
const installedPlatformVersion =
await this.$addPlatformService.addPlatformSafe(
projectData,
platformData,
packageToInstall,
addPlatformData
);
const buildPath = projectData.platformsDir;
this.$fs.ensureDirectoryExists(path.join(buildPath, platform));

if (this.$mobileHelper.isAndroidPlatform(platform)) {
const gradlePropertiesPath = path.resolve(
Expand All @@ -80,7 +79,8 @@ export class PlatformController implements IPlatformController {
);
const commentHeader = "# App configuration";
const appPath = projectData.getAppDirectoryRelativePath();
const appResourcesPath = projectData.getAppResourcesRelativeDirectoryPath();
const appResourcesPath =
projectData.getAppResourcesRelativeDirectoryPath();

let gradlePropertiesContents = "";
if (this.$fs.exists(gradlePropertiesPath)) {
Expand All @@ -96,6 +96,7 @@ export class PlatformController implements IPlatformController {
commentHeader,
`appPath = ${appPath}`,
`appResourcesPath = ${appResourcesPath}`,
`buildPath = ${buildPath}`,
"",
].join("\n");

Expand Down Expand Up @@ -161,9 +162,10 @@ export class PlatformController implements IPlatformController {

if (!desiredRuntimePackage.version) {
// if no version is explicitly added, then we use the latest
desiredRuntimePackage.version = await this.$packageInstallationManager.getLatestCompatibleVersion(
desiredRuntimePackage.name
);
desiredRuntimePackage.version =
await this.$packageInstallationManager.getLatestCompatibleVersion(
desiredRuntimePackage.name
);
}
// const currentPlatformData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
// version = (currentPlatformData && currentPlatformData.version) ||
Expand All @@ -186,9 +188,8 @@ export class PlatformController implements IPlatformController {

const shouldAddNativePlatform =
!nativePrepare || !nativePrepare.skipNativePrepare;
const prepareInfo = this.$projectChangesService.getPrepareInfo(
platformData
);
const prepareInfo =
this.$projectChangesService.getPrepareInfo(platformData);
const requiresNativePlatformAdd =
prepareInfo &&
prepareInfo.nativePlatformStatus ===
Expand Down
8 changes: 6 additions & 2 deletions lib/controllers/prepare-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ export class PrepareController extends EventEmitter {
data.platform.toLowerCase() === platformData.platformNameLowerCase
) {
if (this.isFileWatcherPaused()) return;
this.emitPrepareEvent({ ...data, hasNativeChanges: false });
this.emitPrepareEvent({
...data,
files: data.files ?? [],
hasNativeChanges: false,
});
}
};

Expand Down Expand Up @@ -371,7 +375,7 @@ export class PrepareController extends EventEmitter {
this.$logger.info(`Chokidar raised event ${event} for ${filePath}.`);
await this.writeRuntimePackageJson(projectData, platformData);
this.emitPrepareEvent({
files: [],
files: [filePath],
staleFiles: [],
hasOnlyHotUpdateFiles: false,
hmrData: null,
Expand Down
Loading