1082815dcSEvan Bacon"use strict"; 2082815dcSEvan Bacon 3082815dcSEvan BaconObject.defineProperty(exports, "__esModule", { 4082815dcSEvan Bacon value: true 5082815dcSEvan Bacon}); 6082815dcSEvan Baconexports.getInfoPlistPathFromPbxproj = getInfoPlistPathFromPbxproj; 7*8a424bebSJames Idefunction _Xcodeproj() { 8*8a424bebSJames Ide const data = require("./Xcodeproj"); 9*8a424bebSJames Ide _Xcodeproj = function () { 10082815dcSEvan Bacon return data; 11082815dcSEvan Bacon }; 12082815dcSEvan Bacon return data; 13082815dcSEvan Bacon} 14*8a424bebSJames Idefunction _Target() { 15*8a424bebSJames Ide const data = require("../Target"); 16*8a424bebSJames Ide _Target = function () { 17082815dcSEvan Bacon return data; 18082815dcSEvan Bacon }; 19082815dcSEvan Bacon return data; 20082815dcSEvan Bacon} 21082815dcSEvan Bacon/** 22082815dcSEvan Bacon * Find the Info.plist path linked to a specific build configuration. 23082815dcSEvan Bacon * 24082815dcSEvan Bacon * @param projectRoot 25082815dcSEvan Bacon * @param param1 26082815dcSEvan Bacon * @returns 27082815dcSEvan Bacon */ 28082815dcSEvan Baconfunction getInfoPlistPathFromPbxproj(projectRootOrProject, { 29082815dcSEvan Bacon targetName, 30082815dcSEvan Bacon buildConfiguration = 'Release' 31082815dcSEvan Bacon} = {}) { 32082815dcSEvan Bacon const project = (0, _Xcodeproj().resolvePathOrProject)(projectRootOrProject); 33082815dcSEvan Bacon if (!project) { 34082815dcSEvan Bacon return null; 35082815dcSEvan Bacon } 36082815dcSEvan Bacon const xcBuildConfiguration = (0, _Target().getXCBuildConfigurationFromPbxproj)(project, { 37082815dcSEvan Bacon targetName, 38082815dcSEvan Bacon buildConfiguration 39082815dcSEvan Bacon }); 40082815dcSEvan Bacon if (!xcBuildConfiguration) { 41082815dcSEvan Bacon return null; 42ee216927STomasz Sapeta } 43ee216927STomasz Sapeta // The `INFOPLIST_FILE` is relative to the project folder, ex: app/Info.plist. 44082815dcSEvan Bacon return sanitizeInfoPlistBuildProperty(xcBuildConfiguration.buildSettings.INFOPLIST_FILE); 45082815dcSEvan Bacon} 46082815dcSEvan Baconfunction sanitizeInfoPlistBuildProperty(infoPlist) { 47082815dcSEvan Bacon var _infoPlist$replace$re; 48082815dcSEvan Bacon return (_infoPlist$replace$re = infoPlist === null || infoPlist === void 0 ? void 0 : infoPlist.replace(/"/g, '').replace('$(SRCROOT)', '')) !== null && _infoPlist$replace$re !== void 0 ? _infoPlist$replace$re : null; 49082815dcSEvan Bacon} 50082815dcSEvan Bacon//# sourceMappingURL=getInfoPlistPath.js.map