I have a framework project written in Objective C that i want to publish on JFrog Artifactory.
My .podspec file is like this
Pod::Spec.new do |s|
s.name = 'Name'
s.version = '0.0.1'
s.summary = 'summry'
s.description = <<-DESC
description
DESC
s.homepage = 'homepage'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'user' => 'email' }
s.source = { :git => 'url.git', :tag => s.version.to_s }
s.ios.deployment_target = '11.4'
s.source_files = 'Name/*{.h}','Name/**/*{.h}'
s.dependency "AFNetworking"
end
it is working fine if i define something like this in my Podfile
pod ‘Name’,:git =>'url.git', :tag=>'0.0.1'
but the requirement is to publish this framework on JFrog and fetch from there, in JFrog video tutorial they are saying to upload project in tar.gz form and it will generate podspec file in Artifactory but its not happening in my case.
Could someone please help me?
Thanks
Try adding an empty line at the beginning and the end of the .podspec file. This somehow fixed the problem for me.
Also make sure your .podspec file passes all tests of pod spec lint Name.podspec
Related
I am writing a Cocoapod myself and I am stuck in the .podspec file to set up the path.
I have used many ways to set the path of s.source_files & s.resource_bundles but still, I am getting the same error.
Command
1. pod trunk register -> Successfully
2. pod lib lint. -> Successfully
3. pod trunk push -> Error
ERROR | [iOS] file patterns: The source_files pattern did not match any file.
I am sharing my file hierarchy please help me to set Path.
.podspec file code
Pod::Spec.new do |s|
s.name = 'RandomDataGenerator'
s.version = '1.0.0'
s.summary = 'RandomDataGenerator is very easy to use and very usefull for Lorem Data'
s.description = <<-DESC
'A RandomDataGenerator is a library which is basically used to Generate a number of Random Data for UITAbleView and UICollectionView or for normal bunch of Data. Suppose that if you your app is in Developement Phase and You have not yet implemeted any API for your app but still you want to display Random data in your UI so you can use this to generate Random Data.'
DESC
s.homepage = 'https://github.com/kumarlav0/RandomDataGenerator/tree/master'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'kumarlav0' => 'kumarstslav#gmail.com' }
s.source = { :git => 'https://github.com/kumarlav0/RandomDataGenerator.git', :tag => s.version.to_s }
s.social_media_url = 'https://www.instagram.com/kumarstslav/'
s.ios.deployment_target = '12.0'
s.source_files = 'RandomDataGenerator'
s.requires_arc = true
s.swift_version = '5.0'
s.platforms = {
"ios": "12.0"
}
end
.podspec file
File Hierarchy
File Hierarchy Closed
s.source should point to a tagged version of the repository with that directory structure. See spec.version and spec.source in the example at https://guides.cocoapods.org/syntax/podspec.html
I have a project XyzAbc with proj structure
--LICENSE
--XyzAbc
----XyzAbc.h
----Info.plist
----file1.swift
----file2.swift
--Products
----XyzAbc.framework
After building this project I pick this XyzAbc.framework and push it in github account that has folder structure
--XyzAbc.framework
--.gitignore
--LICENSE
--XyzAbc.podspec
--README.md
I created XyzAbc.podspec file in my local machine its structure is
Pod::Spec.new do |s|
s.name = ""
s.version = "0.1.1"
s.summary = ""
s.description = ""
s.homepage = ""
s.swift_versions = "4.2"
s.license = {
:type => "MIT",
:file => "LICENSE"
}
s.author = "xyyyy"
s.platform = :ios, "10.0"
s.source = {
:git => "https://github.com/xyz/pqr.git", # github link where I uploaded my compiled library
:tag => "0.1.1"
}
s.source_files = "XyzAbc.framework/Headers/*.h"
s.public_header_files = "XyzAbc.framework/Headers/*.h"
s.vendored_frameworks = "XyzAbc.framework"
s.framework = 'Foundation'
end
I am refering this podspec file in my app like
target 'TestApp' do
use_frameworks!
pod 'XyzAbc', :path => "../../../../Desktop/XyzAbc.podspec"
end
But I am not able to see any header inside pod library. In my project TestApp it looks something like this
--Pods
----Podfile
----Development Pods
------XyzAbc
--------Pods
--------SupportFiles
--------<Frameworks is missing>
I tried using :http then when I provide zip .framework folder in http link, it is not working but when I provide unziped .framework folder then I am able to use this library.
I am following this https://medium.com/onfido-tech/distributing-compiled-swift-frameworks-via-cocoapods-8cb67a584d57
UPDATE - elaborated
I created one pod for facebook login. In the local repository, podspec validated properly. After that, I committed code on my GitHub account.
Then I release a new version and then I performed pod trunk command.
pod trunk push FBSDKLoginKit.podspec
This command will one weird error like below.
You are not allowed to push new versions for this pod. The
owners of this pod are nlutsenko#me.com and cocoapods#fb.com.
Below is my podSpec.
Pod::Spec.new do |s|
s.name = 'FacebookLogin'
s.version = '1.0.0'
s.summary = 'The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.'
s.description = 'The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.'
s.homepage = 'https://github.com/simformsolutions/FacebookLogin.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Xxxxx' => '<Email>' }
s.source = { :git =>
'https://github.com/simformsolutions/FacebookLogin.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'ReuseabelLogInComponets/Classes/*.swift'
s.dependency 'FBSDKLoginKit', '4.30.0'
Because someone with email the email nlutsenko#me.com (https://github.com/facebook/facebook-sdk-swift) has registered the pod with the name 'FacebookLogin' before you. So you must choose other name for your new pod.
I made a Swift framework I want to make a CocoaPods for it.
I've followed all the instructions:
created podspec file, added version tag, pushed it to github
When I run pod lib lint it passes but when I run pod spec lint it fails.
Here is my podspec file
Pod::Spec.new do |s|
s.name = "Seru"
s.version = "0.0.3"
s.summary = "Seru is Simple Core Data stack"
s.description = <<-DESC
Seru is Swift framework for working wit Core Data. It setup your core data stack and
gives you nica actions to work with it
DESC
s.homepage = "https://github.com/kostiakoval/Seru"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Kostiantyn Koval" => "konstantin.koval1#gmail.com" }
s.social_media_url = "http://twitter.com/kostiakoval"
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/kostiakoval/Seru.git", :tag => s.version }
s.source_files = "Seru/Source", "Seru/Source/**/*.{swift}"
s.requires_arc = true
s.ios.vendored_frameworks = 'Carthage/Build/iOS/Sweet.framework'
end
It has external framework dependency. I'm guessing this is a problem.
When I do pod speck lint, it says that I can't find that external framework
The problem was that CocoaPods don't include vendored_frameworks folder.
To fix it is to specify that this folder should be included to a CocoaPod by using preserve_paths.
s.preserve_paths = 'Carthage/Build/iOS/Sweet.framework'
I have been following this guide to get a project on mine on CocoaPods. I am currently on the Testing section and am getting the error:
[!] No podspec found for `AppUpdateTracker` in /Users/aaron/Downloads/AUTCocoaPodsTest/AUTPodTest/Pods/AppUpdateTracker/AppUpdateTracker.podspec.json
Linting againt my repo works fine:
pod spec lint App-Update-Tracker.podspec
-> App-Update-Tracker (1.0.0)
Analyzed 1 podspec.
App-Update-Tracker.podspec passed validation.
And this is my Podspec:
Pod::Spec.new do |s|
s.name = "App-Update-Tracker"
s.version = "1.0.0"
s.summary = "AppUpdateTracker is a simple, lightweight iOS library intended to determine basic app install/update behavior."
s.description = <<-DESC
This library allows you to easily determine when the user uses your app after a fresh install, when the user updates your app (and the version from which (s)he updated, and how many times the user has opened a given version of your app. This library was created in order to help determine update information so that appropriate data migration logic could be run after an app update.
DESC
s.homepage = "https://github.com/Stunner/App-Update-Tracker"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = { "Stunner" => "" }
s.social_media_url = "http://twitter.com/ajubbal"
s.platform = :ios
s.source = { :git => "https://github.com/Stunner/App-Update-Tracker.git", :tag => "1.0.0" }
s.source_files = "AppUpdateTracker"
s.requires_arc = true
end
Any idea on how to get around this issue?
It looks like your Pod names doesn't match:
The name of the pod is App-Update-Tracker but it's references as AppUpdateTracker.