0

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?

kerry
  • 2,362
  • 20
  • 33
  • https://github.com/CocoaPods/Rome might be helpful – Paul Beusterien Jan 02 '19 at 15:27
  • thanks for the link @PaulBeusterien but this will force me to write pre compile and post compile script in the main project's Podfile and I do not want to pollute that file or any other part of the main project. – kerry Jan 03 '19 at 04:41

0 Answers0