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D,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,yBAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;QACjB,MAAM,IAAI,KAAK,CACb,gFAAgF,WAAW,IAAI,CAChG,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAZD,sDAYC;AAED,SAAgB,0BAA0B,CAAC,EACzC,OAAO,EACP,WAAW,GAIZ;IACC,MAAM,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,oCAAoC,CAAC,CAAC;IACxF,gBAAM,CACJ,uBAAuB,EACvB,mEAAmE,CACpE,CAAC;IACF,gBAAM,CACJ,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,WAAW,EAC3D,qDAAqD,WAAW,eAAe,uBAAuB,CAAC,MAAM,CAAC,IAAI,GAAG,CACtH,CAAC;IACF,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAjBD,gEAiBC","sourcesContent":["// Copied over from `@expo/config-plugins/src/ios/Paths`\nimport assert from 'assert';\nimport { pathExistsSync } from 'fs-extra';\nimport { sync as globSync } from 'glob';\nimport * as path from 'path';\nimport { XcodeProject } from 'xcode';\n\nconst ignoredPaths = ['**/@(Carthage|Pods|node_modules)/**'];\n\nexport function getAllXcodeProjectPaths(projectRoot: string): string[] {\n const iosFolder = 'ios';\n const pbxprojPaths = globSync('**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n .filter(project => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder)\n .sort(project => (path.dirname(project) === iosFolder ? -1 : 1))\n // sort alphabetically to ensure this works the same across different devices (Fail in CI (linux) without this)\n .sort();\n\n if (!pbxprojPaths.length) {\n throw new Error(\n `Failed to locate the ios/*.xcodeproj files relative to path \"${projectRoot}\".`\n );\n }\n return pbxprojPaths.map(value => path.join(projectRoot, value));\n}\n\nexport function getAllPBXProjectPaths(projectRoot: string): string[] {\n const projectPaths = getAllXcodeProjectPaths(projectRoot);\n const paths = projectPaths\n .map(value => path.join(value, 'project.pbxproj'))\n .filter(value => pathExistsSync(value));\n\n if (!paths.length) {\n throw new Error(\n `Failed to locate the ios/*.xcodeproj/project.pbxproj files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getApplicationNativeTarget({\n project,\n projectName,\n}: {\n project: XcodeProject;\n projectName: string;\n}) {\n const applicationNativeTarget = project.getTarget('com.apple.product-type.application');\n assert(\n applicationNativeTarget,\n `Couldn't locate application PBXNativeTarget in '.xcodeproj' file.`\n );\n assert(\n String(applicationNativeTarget.target.name) === projectName,\n `Application native target name mismatch. Expected ${projectName}, but found ${applicationNativeTarget.target.name}.`\n );\n return applicationNativeTarget;\n}\n"]}