"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getProjectConfig=getProjectConfig,exports.findAllPodfilePaths=findAllPodfilePaths;const tslib_1=require("tslib"),path=tslib_1.__importStar(require("path")),fs=tslib_1.__importStar(require("fs")),glob=tslib_1.__importStar(require("glob")),GLOB_EXCLUDE_PATTERN=["**/@(Pods|node_modules|Carthage)/**"];function getProjectConfig(e,t={}){const r=findXcodeProject(e);return r?Object.assign({sourceDir:e},r):null}function findXcodeProject(e){const t=fs.readdirSync(e);for(let e=t.sort().length-1;e>=0;e--){const r=t[e],o=path.extname(r);if(".xcworkspace"===o)return{name:r,isWorkspace:!0};if(".xcodeproj"===o)return{name:r,isWorkspace:!1}}return null}function findAllPodfilePaths(e){return glob.sync("**/Podfile",{cwd:e,ignore:GLOB_EXCLUDE_PATTERN})}