1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.getInfoPlistPathFromPbxproj = getInfoPlistPathFromPbxproj;
7function _Xcodeproj() {
8  const data = require("./Xcodeproj");
9  _Xcodeproj = function () {
10    return data;
11  };
12  return data;
13}
14function _Target() {
15  const data = require("../Target");
16  _Target = function () {
17    return data;
18  };
19  return data;
20}
21/**
22 * Find the Info.plist path linked to a specific build configuration.
23 *
24 * @param projectRoot
25 * @param param1
26 * @returns
27 */
28function getInfoPlistPathFromPbxproj(projectRootOrProject, {
29  targetName,
30  buildConfiguration = 'Release'
31} = {}) {
32  const project = (0, _Xcodeproj().resolvePathOrProject)(projectRootOrProject);
33  if (!project) {
34    return null;
35  }
36  const xcBuildConfiguration = (0, _Target().getXCBuildConfigurationFromPbxproj)(project, {
37    targetName,
38    buildConfiguration
39  });
40  if (!xcBuildConfiguration) {
41    return null;
42  }
43  // The `INFOPLIST_FILE` is relative to the project folder, ex: app/Info.plist.
44  return sanitizeInfoPlistBuildProperty(xcBuildConfiguration.buildSettings.INFOPLIST_FILE);
45}
46function sanitizeInfoPlistBuildProperty(infoPlist) {
47  var _infoPlist$replace$re;
48  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;
49}
50//# sourceMappingURL=getInfoPlistPath.js.map