Skip to content

Commit ce33b5f

Browse files
committed
chore: undo the changes on beforePrepareAllPlugins method
1 parent 1848c30 commit ce33b5f

File tree

8 files changed

+28
-4
lines changed

8 files changed

+28
-4
lines changed

lib/definitions/project.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ interface IPlatformProjectService extends NodeJS.EventEmitter, IPlatformProjectS
400400
*/
401401
removePluginNativeCode(pluginData: IPluginData, projectData: IProjectData): Promise<void>;
402402

403+
beforePrepareAllPlugins(projectData: IProjectData, dependencies?: IDependencyData[]): Promise<void>;
404+
403405
handleNativeDependenciesChange(projectData: IProjectData): Promise<void>;
404406

405407
/**

lib/services/android-project-service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
577577
}
578578
}
579579

580-
public async handleNativeDependenciesChange(projectData: IProjectData, dependencies?: IDependencyData[]): Promise<void> {
580+
public async beforePrepareAllPlugins(projectData: IProjectData, dependencies?: IDependencyData[]): Promise<void> {
581581
const shouldUseNewRoutine = this.runtimeVersionIsGreaterThanOrEquals(projectData, "3.3.0");
582582

583583
if (dependencies) {
@@ -605,6 +605,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
605605
}
606606
}
607607

608+
public async handleNativeDependenciesChange(projectData: IProjectData): Promise<void> {
609+
return;
610+
}
611+
608612
private filterUniqueDependencies(dependencies: IDependencyData[]): IDependencyData[] {
609613
const depsDictionary = dependencies.reduce((dict, dep) => {
610614
const collision = dict[dep.name];

lib/services/ios-project-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,10 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
986986
}
987987
}
988988

989+
public beforePrepareAllPlugins(): Promise<void> {
990+
return Promise.resolve();
991+
}
992+
989993
public async checkForChanges(changesInfo: IProjectChangesInfo, { provision, teamId }: IProjectChangesOptions, projectData: IProjectData): Promise<void> {
990994
const hasProvision = provision !== undefined;
991995
const hasTeamId = teamId !== undefined;

lib/tools/node-modules/node-modules-dest-copy.ts

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ export class NpmPluginPrepare {
154154
return;
155155
}
156156

157+
await this.$platformsData.getPlatformData(platform, projectData).platformProjectService.beforePrepareAllPlugins(projectData, dependencies);
158+
157159
for (const dependencyKey in dependencies) {
158160
const dependency = dependencies[dependencyKey];
159161
const isPlugin = !!dependency.nativescript;

test/debug.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ describe("debug command tests", () => {
350350
testInjector = createTestInjector();
351351
});
352352

353-
it("Ensures that handleNativeDependenciesChange will call gradle with clean option when *NOT* livesyncing", async () => {
353+
it("Ensures that beforePrepareAllPlugins will call gradle with clean option when *NOT* livesyncing", async () => {
354354
const platformData = testInjector.resolve<IPlatformData>("platformsData");
355355
platformData.frameworkPackageName = "tns-android";
356356

@@ -367,7 +367,7 @@ describe("debug command tests", () => {
367367
};
368368
const projectData: IProjectData = testInjector.resolve("projectData");
369369
const spawnFromEventCount = childProcess.spawnFromEventCount;
370-
await androidProjectService.handleNativeDependenciesChange(projectData);
370+
await androidProjectService.beforePrepareAllPlugins(projectData);
371371
assert.isTrue(childProcess.lastCommand.indexOf("gradle") !== -1);
372372
assert.isTrue(childProcess.lastCommandArgs[0] === "clean");
373373
assert.isTrue(spawnFromEventCount === 0);

test/npm-support.ts

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ async function setupProject(dependencies?: any): Promise<any> {
182182
platformProjectService: {
183183
prepareProject: (): any => null,
184184
prepareAppResources: (): any => null,
185+
beforePrepareAllPlugins: () => Promise.resolve(),
185186
handleNativeDependenciesChange: () => Promise.resolve(),
186187
getAppResourcesDestinationDirectoryPath: () => path.join(androidFolderPath, "src", "main", "res"),
187188
processConfigurationFilesFromAppResources: () => Promise.resolve(),

test/plugin-prepare.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ class TestNpmPluginPrepare extends NpmPluginPrepare {
77
public preparedDependencies: IDictionary<boolean> = {};
88

99
constructor(private previouslyPrepared: IDictionary<boolean>) {
10-
super(null, null, null, null);
10+
super(null, null, <any>{
11+
getPlatformData: () => {
12+
return {
13+
platformProjectService: {
14+
beforePrepareAllPlugins: () => Promise.resolve()
15+
}
16+
};
17+
}
18+
}, null);
1119
}
1220

1321
protected getPreviouslyPreparedDependencies(platform: string): IDictionary<boolean> {

test/stubs.ts

+3
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ export class PlatformProjectServiceStub extends EventEmitter implements IPlatfor
448448
async handleNativeDependenciesChange(): Promise<void> {
449449
return Promise.resolve();
450450
}
451+
async beforePrepareAllPlugins(): Promise<void> {
452+
return Promise.resolve();
453+
}
451454
async cleanDeviceTempFolder(deviceIdentifier: string): Promise<void> {
452455
return Promise.resolve();
453456
}

0 commit comments

Comments
 (0)