( nativeProjectDirAbs: string, nativeTargetDirAbs: string, nativeXcodeProjDirAbs: string, )
| 337 | } |
| 338 | |
| 339 | async function determineIOSWebDirAbs( |
| 340 | nativeProjectDirAbs: string, |
| 341 | nativeTargetDirAbs: string, |
| 342 | nativeXcodeProjDirAbs: string, |
| 343 | ): Promise<string> { |
| 344 | const re = /path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/; |
| 345 | const pbxprojPath = resolve(nativeXcodeProjDirAbs, 'project.pbxproj'); |
| 346 | try { |
| 347 | const pbxproj = await readFile(pbxprojPath, { encoding: 'utf8' }); |
| 348 | |
| 349 | const m = pbxproj.match(re); |
| 350 | |
| 351 | if (m && m[1] === 'SOURCE_ROOT') { |
| 352 | logger.warn( |
| 353 | `Using the iOS project root for the ${c.strong('public')} directory is deprecated.\n` + |
| 354 | `Please follow the Upgrade Guide to move ${c.strong('public')} inside the iOS target directory: ${c.strong( |
| 355 | 'https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory', |
| 356 | )}`, |
| 357 | ); |
| 358 | |
| 359 | return resolve(nativeProjectDirAbs, 'public'); |
| 360 | } |
| 361 | } catch (e) { |
| 362 | // ignore |
| 363 | } |
| 364 | |
| 365 | return resolve(nativeTargetDirAbs, 'public'); |
| 366 | } |
| 367 | |
| 368 | async function determineAndroidStudioPath(os: OS): Promise<string> { |
| 369 | if (process.env.CAPACITOR_ANDROID_STUDIO_PATH) { |
no test coverage detected