Skip to content

Commit 408bf2f

Browse files
author
Fatme
authored
Merge pull request #4386 from NativeScript/fatme/podfile-platfrom-warning
fix: show warning when the platform's version in project's podfile will be replaced with another platform's version
2 parents 0fabc39 + 4129031 commit 408bf2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/services/cocoapods-platform-manager.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import * as semver from "semver";
44
import { PODFILE_NAME } from "../constants";
55

66
export class CocoaPodsPlatformManager implements ICocoaPodsPlatformManager {
7+
constructor(private $logger: ILogger) { }
8+
79
public addPlatformSection(projectData: IProjectData, podfilePlatformData: IPodfilePlatformData, projectPodfileContent: string): string {
810
const platformSectionData = this.getPlatformSectionData(projectPodfileContent);
911
if (platformSectionData && platformSectionData.podfilePlatformData) {
1012
const shouldReplacePlatformSection = this.shouldReplacePlatformSection(projectData, platformSectionData.podfilePlatformData, podfilePlatformData);
1113
if (shouldReplacePlatformSection) {
14+
this.$logger.warn(`Multiple identical platforms with different versions have been detected during the processing of podfiles. The current platform's content "${platformSectionData.podfilePlatformData.content}" from ${platformSectionData.podfilePlatformData.path} will be replaced with "${podfilePlatformData.content}" from ${podfilePlatformData.path}`);
1215
const newSection = this.buildPlatformSection(podfilePlatformData);
1316
projectPodfileContent = projectPodfileContent.replace(platformSectionData.platformSectionContent, newSection);
1417
}

0 commit comments

Comments
 (0)