I am creating a cocoapods plugin to seamlessly integrate flutter into an existing iOS project without polluting the main project.
The cocoapods plugin will be applied to the main project Podfile and will run this ruby file from the flutter repository. I am almost done with the plugin development, in fact, this will run with no problems if the flutter project does not contain any plugins.
But there is a code that runs when the flutter project contains plugins. This script creates a symlink hidden directory inside the flutter application path and adds plugins' directories in it. Then it calls pod install
with that path to install plugins as pod
dependencies in the main project. I want to do all of this inside the plugin.
Currently running this plugin gives me following error:
NoMethodError - undefined method pod for <CocoapodsIntegrateFlutter::IntegrateFlutter:0x00007fa5b1f7c110>
which is understandable since pod
essentially is an executable.
Is it possible to call pod install
or Pod::Command::Install.run
or something like this to add new dependencies from the plugin to the Podfile?