일반적으로 Xcode 프로젝트을 생성하면 됩니다.
예)
RenoLibrary
└── iOSExample
├── iOSExample
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── Base.lproj
│ ├── Info.plist
│ ├── SceneDelegate.swift
│ └── ViewController.swift
└── iOSExample.xcodeproj
RenoLibrary 폴더에서 아래 명령어을 치면
RenoLibrary.podspec이 생성이 됩니다.
$ pod spec create RenoLibrary아래와 같이 기본적으로 작성하시면 됩니다.
cocoapod버전은github의tag에 버전명으로push가 되고,
spec을 이용해서cocoapod에push을 해야 됩니다.
Pod::Spec.new do |spec|
spec.name = "RenoLibrary"
spec.version = "0.0.1"
spec.summary = "A short description of RenoLibrary."
spec.homepage = "https://www.renomedia.co.kr"
# spec.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
spec.license = { :type => "MIT", :file => "LICENSE" } # 라이센스 종류 및 파일 이름
spec.author = { "Reno" => "dev@RenoMedia.co.kr" }
spec.source = { :git => "https://github.com/Reno/RenoLibrary.git", :tag => "#{spec.version}" }
spec.source_files = "Source/**/*"
# spec.resource = "icon.png"
# spec.resources = "Resources/*.png"
# spec.dependency "JSONKit", "~> 1.4" #
endSource 폴더 생성
예)
RenoLibrary
├── RenoLibrary.podspec # 생성된 pod
├── Source # 생성된 podspec에 source_files에 있는 path
└── iOSExample
├── iOSExample
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── Base.lproj
│ ├── Info.plist
│ ├── SceneDelegate.swift
│ └── ViewController.swift
└── iOSExample.xcodeproj
iOSExample: $ pod initpodfile 수정
target 'iOSExample' do
use_frameworks!
pod 'RenoLibrary', :path => '../'
end$ pod install$ pod spec lint 아래와 같이
error / warning에 대해서 수정이 필요합니다.
-> RenoLibrary (0.0.1)
- ERROR | license: Sample license type.
- WARN | homepage: The homepage has not been updated from default
- ERROR | source: The Git source still contains the example URL.
- WARN | summary: The summary is not meaningful.
- ERROR | description: The description is empty.
- WARN | url: There was a problem validating the URL http://EXAMPLE/RenoLibrary.
- ERROR | [OSX] unknown: Encountered an unknown error (The `RenoLibrary` pod failed to validate due to 3 errors:
- ERROR | license: Sample license type.
- WARN | homepage: The homepage has not been updated from default
- ERROR | source: The Git source still contains the example URL.
- WARN | summary: The summary is not meaningful.
- ERROR | description: The description is empty.
) during validation.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 4 errors and 3 warnings.