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