From 4129031d0de15feffee1a43712e9a8f5c2162caa Mon Sep 17 00:00:00 2001 From: fatme Date: Sun, 24 Feb 2019 08:01:33 +0200 Subject: [PATCH] fix: show warning when the platform's version in project's podfile will be replaced with another platform's version --- lib/services/cocoapods-platform-manager.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/services/cocoapods-platform-manager.ts b/lib/services/cocoapods-platform-manager.ts index 8f34fd4952..65c0532d11 100644 --- a/lib/services/cocoapods-platform-manager.ts +++ b/lib/services/cocoapods-platform-manager.ts @@ -4,11 +4,14 @@ import * as semver from "semver"; import { PODFILE_NAME } from "../constants"; export class CocoaPodsPlatformManager implements ICocoaPodsPlatformManager { + constructor(private $logger: ILogger) { } + public addPlatformSection(projectData: IProjectData, podfilePlatformData: IPodfilePlatformData, projectPodfileContent: string): string { const platformSectionData = this.getPlatformSectionData(projectPodfileContent); if (platformSectionData && platformSectionData.podfilePlatformData) { const shouldReplacePlatformSection = this.shouldReplacePlatformSection(projectData, platformSectionData.podfilePlatformData, podfilePlatformData); if (shouldReplacePlatformSection) { + 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}`); const newSection = this.buildPlatformSection(podfilePlatformData); projectPodfileContent = projectPodfileContent.replace(platformSectionData.platformSectionContent, newSection); }