Skip to content

Commit 60b1366

Browse files
committed
fix: Add missing fields to test projectData
1 parent 229769f commit 60b1366

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

lib/definitions/project.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,6 @@ interface ICocoaPodsService {
483483
*/
484484
getPodfileFooter(): string;
485485

486-
/**
487-
* Copies the Podfile(if any) in App_Resources to the project's folder.
488-
* @param {string} mainPodfilePath Path to the main Podfile.
489-
* @param {string} nativeProjectPath Path to the native Xcode project.
490-
* @returns {Promise<void>}
491-
*/
492-
copyMainPodfileToProject(mainPodfilePath: string, nativeProjectPath: string): Promise<void>;
493-
494486
/**
495487
* Prepares the Podfile content of a plugin and merges it in the project's Podfile.
496488
* @param {string} moduleName The module which the Podfile is from.

lib/services/ios-project-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { IOSEntitlementsService } from "./ios-entitlements-service";
1414
import { XCConfigService } from "./xcconfig-service";
1515
import * as mobileprovision from "ios-mobileprovision-finder";
1616
import { BUILD_XCCONFIG_FILE_NAME, IosProjectConstants } from "../constants";
17-
import { project } from "xcode";
1817

1918
interface INativeSourceCodeGroup {
2019
name: string;
@@ -772,10 +771,11 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
772771
this.$logger.trace(`Images to remove from xcode project: ${imagesToRemove.join(", ")}`);
773772
_.each(imagesToRemove, image => project.removeResourceFile(path.join(this.getAppResourcesDestinationDirectoryPath(projectData), image)));
774773

774+
await this.prepareNativeSourceCode("src", path.join(projectData.appDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, "src"), projectData);
775+
775776
this.savePbxProj(project, projectData);
776777
}
777778

778-
await this.prepareNativeSourceCode("src", path.join(projectData.appDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, "src"), projectData);
779779
}
780780

781781
public prepareAppResources(appResourcesDirectoryPath: string, projectData: IProjectData): void {

test/ios-project-service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,18 @@ function createTestInjector(projectPath: string, projectName: string, xcode?: IX
6767
testInjector.register("iOSEntitlementsService", IOSEntitlementsService);
6868
testInjector.register("logger", LoggerLib.Logger);
6969
testInjector.register("options", OptionsLib.Options);
70-
const projectData = Object.assign({}, ProjectDataStub, {
70+
var projectData = Object.assign({}, ProjectDataStub, {
7171
platformsDir: path.join(projectPath, "platforms"),
7272
projectName: projectName,
7373
projectPath: projectPath,
7474
projectFilePath: path.join(projectPath, "package.json"),
7575
projectId: "",
76-
projectIdentifiers: { android: "", ios: "" }
76+
projectIdentifiers: { android: "", ios: "" },
77+
projectDir: "",
78+
appDirectoryPath: ""
7779
});
80+
projectData.projectDir = temp.mkdirSync("projectDir");
81+
projectData.appDirectoryPath = path.join(projectData.projectDir, "app");
7882
testInjector.register("projectData", projectData);
7983
testInjector.register("projectHelper", {});
8084
testInjector.register("xcodeSelectService", {});

0 commit comments

Comments
 (0)