0

For a iOS project we are using a lot of private SDK's. Maybe 10 .framework files and growing. We would like to create a private git repo and dump all the .framework files in the repo. Is it possible cocoapods uses this git repo as a source so we can specify the frameworks we need? Maybe use the vendored_frameworks prop?

Can not find a solution online. Tried it myself without success.

Thanks!

UPDATE

I have a git repo with a branch TEST including 1 .framework file and 1 podspec file

Pod::Spec.new do |s|  
    s.name              = 'xSDK'
    s.version           = '0.0.1'
    s.summary           = 'x SDK'
    s.homepage          = 'https://www.google.com'

    s.author            = { 'Sample' => 'sample@sample.com' }
    s.license = { :type => "MIT", :text => "MIT License" }

    s.platform          = :ios
    s.ios.deployment_target = '13.0'
    s.ios.vendored_frameworks = 'x.framework'
end 

I have a react native module including swift code that is using the .framework with a podspec file

require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
  s.name         = "react-native-x-module"
  s.version      = package["version"]
  s.summary      = package["description"]
  s.homepage     = "https://github.com/x"
  s.license      = "MIT"
  s.authors      = { "x" => "x@x" }

  s.platforms    = { :ios => "13.0" }
  s.source       = { :git => "", :tag => "#{s.version}" }

  s.source_files = "ios/**/*.{h,m,mm,swift}"

  s.dependency 'xSDK', :git => 'https://git.x.org/x/cocoapods/-/tree/TEST'
end

I want to do something like this, but s.dependency is indeed not correct

We have more react-native-x-module's so it would be nice if we could collect all the .frameworks in a git repo

Hans
  • 171
  • 2
  • 10

1 Answers1

0

You host a private pod repository. See the Private Pods guide for a start. The details vary very much based on your local infrastructure. For example, our in-house repo and pods all make use of our GitLab installation.

Basically, you need to set up a Git repo for the specs, and you need to add source <url_to_repo> to your Podfile so CocoaPods can find the private pods. The pods can reference internal Git repositories or other sources. In the end, you'd use an in-house pod repo, and the pods would refer to in-house sources.

For some example, search for something like "cocoapods private repo" to find articles like this describing this in more detail. Most articles I've found set up a private pod repo on GitHub, but you can use your own in-house Git server (which is what my company is doing).

DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • yeah I know, but we only have the .framework files. I think its a bit overhead to create a git repo for every . framework file and then add them to the global private cocoapods repo. I would rather like to see 1 repo with all the .framework files in. Otherwise we can just leave them in the project as it is. – Hans Jan 18 '23 at 12:38
  • @Hans: I don't get what you mean with "1 repo with all the .framework file". Do you mean one _pod_ with all the frameworks? If so, you might want something like `pod 'AllMyFrameworks', :git => 'https://git.company.example/path/AllMyFrameworks.git'`. See also the [`pod` reference](https://guides.cocoapods.org/syntax/podfile.html#pod), specifically _"From a podspec in the root of a library repository."_ – DarkDust Jan 18 '23 at 13:29
  • yes if we call it 'a pod with all the frameworks', how would the podspec file look like then? If I understand it correctly, you always need some kind of source param? only defining vendored_frameworks in not enough? – Hans Jan 19 '23 at 13:03
  • or is cocoapods not suitable for that use case? – Hans Jan 19 '23 at 13:04
  • @Hans: You can do that with CocoaPods. How your `source` looks like depends on whether you want the frameworks to be built from sources (reference a Git repo) or whether you want to package pre-built frameworks (reference a ZIP, for example). See for example [this answer](https://stackoverflow.com/a/64782335/400056). – DarkDust Jan 19 '23 at 13:16
  • ok we are getting somewhere, I updated the question with all the info you gave me, maybe you understand the question better now. – Hans Jan 19 '23 at 14:01