简体   繁体   English

Flutter - 插件,如何依赖 ios 本地 pod

[英]Flutter - Plugin, how dependency a ios local pod

I write a Flutter plugin, and in the plugin's ios folder.我写了一个 Flutter 插件,在插件的 ios 文件夹中。 There is a.podspec file.有一个 .podspec 文件。 This file shown below:该文件如下所示:

# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'qr_code_scanner'
  s.version          = '0.0.2'
  s.summary          = 'QR Code Scanner for flutter.'
  s.description      = <<-DESC
A new Flutter project.
                       DESC
  s.homepage         = 'https://github.com/juliuscanute/qr_code_scanner'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'juliuscanute[*]touchcapture.net' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.dependency 'how to dependency a local library'   //here
  s.ios.deployment_target = '8.0' 
  s.swift_version = '4.0'
end

As we all know, if I want dependency a pod library.众所周知,如果我想要依赖一个 pod 库。 I can write:我可以写:

s.dependency 'JSONModel'

but now, I download the JSONModel, and do some changes, then generate local pod.但现在,我下载了 JSONModel,并进行了一些更改,然后生成本地 pod。 so the question is how to dependency a local modified "JSONModel" pod?所以问题是如何依赖本地修改的“JSONModel”pod?

you can dependcy your own framework like this: write in plugin's podspec file:您可以像这样依赖自己的框架:在插件的 podspec 文件中写入:

  s.ios.vendored_frameworks = 'Frameworks/TencentLBS.framework'
  s.vendored_frameworks = 'TencentLBS.framework'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM