You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @EvanBacon , first of all thanks and congratulations to creating this great library. I have been looking for something like for a while, and this is a lot closer to anything else that I have come across.
When create native Apple targets in Swift, one of the common things to do is for them to have their own Pod dependencies. However, it is not immediately obvious how to add one based on the examples provided. Am I missing something obvious?
This is for a project using Expo Prebuild.
The text was updated successfully, but these errors were encountered:
import{withDangerousMod,typeConfigPlugin}from"@expo/config-plugins";import{mergeContents}from"@expo/config-plugins/build/utils/generateCode";importfsfrom"node:fs";importpathfrom"node:path";constSRC_TO_ADD_TO_PODFILE=`target 'widgets' do pod 'KeychainSwift', '~> 20.0'endtarget 'siriIntent' do pod 'KeychainSwift', '~> 20.0'end`;exportconstwithAddPodDepsToTargets: ConfigPlugin=(config)=>{returnwithDangerousMod(config,["ios",async(config)=>{constfile=path.join(config.modRequest.platformProjectRoot,"Podfile");constcontents=awaitfs.promises.readFile(file,"utf8");awaitfs.promises.writeFile(file,addPodDepsToTargets(contents),"utf8");returnconfig;},]);};functionaddPodDepsToTargets(src: string){returnmergeContents({tag: `with-add-pod-deps-to-targets`,
src,newSrc: SRC_TO_ADD_TO_PODFILE.trim(),anchor: /target ['"]([^'"]*)['"] do/,offset: 0,comment: "#",}).contents;}
app.config.ts
import"esbuild-register";// So we can import TypeScript filesconstconfig: ExpoConfig={// ...plugins: [require("./plugins/with-add-pod-deps-to-targets").withAddPodDepsToTargets]}exportdefaultconfig;
To add stuff to your Podfile edit the SRC_TO_ADD_TO_PODFILE in the config plugin
Hi @EvanBacon , first of all thanks and congratulations to creating this great library. I have been looking for something like for a while, and this is a lot closer to anything else that I have come across.
When create native Apple targets in Swift, one of the common things to do is for them to have their own Pod dependencies. However, it is not immediately obvious how to add one based on the examples provided. Am I missing something obvious?
This is for a project using Expo Prebuild.
The text was updated successfully, but these errors were encountered: