header-img
Info :

A. pros & cons

pros

  1. ๋นŒ๋“œ๋œ ํ”„๋ ˆ์ž„์›Œํฌ ๋‹จ์œ„ ๊ณต์œ ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ์•…์„ฑ ์œ ์ €๊ฐ€ ์ง์ ‘ ๋””์ปดํŒŒ์ผ ํ•ด๋ณด์ง€ ์•Š๋Š” ์ด์ƒ ๋ณด์•ˆ ๋น„๊ต์  ๋†’์Œ
  2. static / dynamic framework๋ฅผ ๋ฐฐํฌํ•˜๋Š” ์ชฝ์—์„œ ๊ฐ•์ œํ•  ์ˆ˜ ์žˆ์Œ (๋ฐ›๋Š” ์ชฝ์—์„œ ์ˆ˜์ •ํ•  ๋ฐฉ๋ฒ•์ด ์—†์–ด ๋ณด์ž„)
  3. iOS, iOS-simulator ๊ฐ๊ฐ ๋ฐฐํฌํ•ด์ค„ ํ•„์š”๊ฐ€ ์—†์Œ
  4. cocoapod์œผ๋กœ๋Š” ๊ฒฐ๊ณผ๋ฌผ๋งŒ ๋ฒ„์ „ ๊ด€๋ฆฌํ•ด์ฃผ๋ฉฐ ๋ฐฐํฌํ•˜๋ฉด ๋˜๊ณ  ์‹ค์ œ ๊ฐœ๋ฐœ์€ cocoapod์œผ๋กœ๋ถ€ํ„ฐ ์ž์œ ๋กญ๊ธฐ ๋•Œ๋ฌธ์— ์ข€ ๋” ๊ฐœ๋ฐœ์ด ๊ฐ„ํŽธํ•จ
  5. cocoapod์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์—ฐ๋™ ์•ฑ์‚ฌ์— framework๋งŒ ๊ฑด๋‚ด์ค„ ๋•Œ์—” ๊ฐ€์žฅ ๊ฐ„ํŽธํ•จ. ์™œ๋ƒ๋ฉด xcframework๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— repository ์ ‘๊ทผ๋งŒ ๋˜๋ฉด ์ง์ ‘ ๋‹ค์šด๋ฐ›์•„์„œ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋จ.

cons

  1. private repository๋ฅผ ์‚ฌ์šฉํ•  ์‹œ SDK ์‚ฌ์šฉํ•  ์ธก์„ ์ง์ ‘ ๊ถŒํ•œ ์ถ”๊ฐ€ํ•ด์ฃผ์–ด์•ผ ํ•จ. (public repository๋กœ xcframework๋ฅผ ๊ณต์œ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ฑ„ํƒํ•œ๋‹ค๋ฉด ์—†์–ด์งˆ ๋ฌธ์ œ)
  2. ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ๋ฐ›์•„์„œ ์•…์„ฑ ์œ ์ €๊ฐ€ ์ง์ ‘ ๋””์ปดํŒŒ์ผํ•˜๋ฉด ๋‚ด๋ถ€ ์ฝ”๋“œ๊ฐ€ ๋ณด์ผ ๊ฒƒ์ž„

 

B. ์ „์ฒด ๊ณผ์ •

  1. ์ด ๊ด€๋ฆฌํ•  private remote repository bitbucket์— ํ•˜๋‚˜ ์ƒ์„ฑ
  2. xcode์˜ framework project ํ•˜๋‚˜ ์ƒ์„ฑ
  3. 2๋ฒˆ์˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ฝ”๋“œ ์ˆ˜์ •
  4. cmd ์ฐฝ์—์„œ 2๋ฒˆ ํ”„๋กœ์ ํŠธ์˜ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ xcarchive, xcframework ์ฐจ๋ก€๋กœ ๋นŒ๋“œ
  5. git์œผ๋กœ ๊ด€๋ฆฌํ• , 1๋ฒˆ์—์„œ ์ƒ์„ฑํ•œ repository ๊ด€๋ฆฌํ•  ํด๋” ํ•˜๋‚˜ ์ƒ์„ฑ
  6. 5๋ฒˆ์—์„œ ์ƒ์„ฑํ•œ ํด๋”์— 4๋ฒˆ์—์„œ ๋งŒ๋“  xcframework ํด๋” ๋ณต์‚ฌ, ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ•ด์ฃผ๊ธฐ
  7. 5๋ฒˆ์—์„œ ๋งŒ๋“  ํด๋”์—์„œ .podspec ํŒŒ์ผ ๋งŒ๋“ค๊ณ  ๋‚ด์šฉ ์ˆ˜์ •ํ•ด์ฃผ๊ธฐ
  8. 5๋ฒˆ์—์„œ ๋งŒ๋“  ํด๋” git init ํ•ด์ค€ ํ›„ 1๋ฒˆ์˜ repository์— push
  9. ํ…Œ์ŠคํŠธ ํ”„๋กœ์ ํŠธ์—์„œ pod init ํ•ด์ค€ ํ›„ .podfile์— ์ข…์†์„ฑ ์ถ”๊ฐ€ํ•ด์ค€ ํ›„ pod update ํ›„ ํ…Œ์ŠคํŠธ!

 

C. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 1

์ด ๊ด€๋ฆฌํ•  private remote repository bitbucket์— ํ•˜๋‚˜ ์ƒ์„ฑ

๊ทธ๋ƒฅ bitbucket์— private์œผ๋กœ repository ํ•˜๋‚˜ ์ƒ์„ฑํ•ด์ฃผ๋ฉด ๋จ.

 

D. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 2, 3, 4

xcode์˜ framework project ํ•˜๋‚˜ ์ƒ์„ฑ2๋ฒˆ์˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ฝ”๋“œ ์ˆ˜์ •
cmd ์ฐฝ์—์„œ 2๋ฒˆ ํ”„๋กœ์ ํŠธ์˜ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ xcarchive, xcframework ์ฐจ๋ก€๋กœ ๋นŒ๋“œ

ํ•˜๋ฉด ๋จ

 

E. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 5

git์œผ๋กœ ๊ด€๋ฆฌํ• , 1๋ฒˆ์—์„œ ์ƒ์„ฑํ•œ repository ๊ด€๋ฆฌํ•  ํด๋” ํ•˜๋‚˜ ์ƒ์„ฑ

  1. ์›ํ•˜๋Š” ์œ„์น˜์—์„œ cmd open
  2. mkdir ๋””๋ ‰ํ† ๋ฆฌ๋ช…

 

F. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 6

5๋ฒˆ์—์„œ ์ƒ์„ฑํ•œ ํด๋”์— 4๋ฒˆ์—์„œ ๋งŒ๋“  xcframework ํด๋” ๋ณต์‚ฌ, ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ•ด์ฃผ๊ธฐ

ํ•˜๋ฉด ๋จ

 

G. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 7

5๋ฒˆ์—์„œ ๋งŒ๋“  ํด๋”์—์„œ .podspec ํŒŒ์ผ ๋งŒ๋“ค๊ณ  ๋‚ด์šฉ ์ˆ˜์ •ํ•ด์ฃผ๊ธฐ

// cmd
touch [framework_์ด๋ฆ„].podspec

.podspec ํŒŒ์ผ ์—ด๊ณ  ์•„๋ž˜ ๋ถ€๋ถ„ ๊ธฐ์ž…ํ•ด์„œ ์ €์žฅ (์ผ๋ฐ˜ ์†Œ์Šค์ฝ”๋“œ๋ฅผ pod์œผ๋กœ ๊ณต์œ ํ•˜๋Š” ๊ฒƒ๊ณผ podspec ๋‚ด์šฉ์ด ์กฐ๊ธˆ ๋‹ค๋ฆ„)

Pod::Spec.new do |s|
    s.name         = "ํ”„๋ ˆ์ž„์›Œํฌ๋ช…"
    s.version      = "๋ฒ„์ „_์ •๋ณด"
    s.summary      = "ํ”„๋ ˆ์ž„์›Œํฌ_์š”์•ฝ"
    s.description  = <<-DESC
    ํ”„๋ ˆ์ž„์›Œํฌ_์ƒ์„ธ_์„ค๋ช…
    DESC
    s.homepage     = "ํ™ˆํŽ˜์ด์ง€_์ฃผ์†Œ"
    s.license = { :type => 'Copyright', :text => <<-LICENSE
                   Copyright 2018
                   Permission is granted to...
                  LICENSE
                }
    s.author           = { '์ด๋ฆ„' => 'git_mail' }
    s.source       = { :git => "1๋ฒˆ์—์„œ_๋งŒ๋“ _remote_repo_์ฃผ์†Œ", :tag => s.version.to_s }
    s.vendored_frameworks = "ํ”„๋ ˆ์ž„์›Œํฌ๋ช….xcframework"
    s.platform = :ios
    s.swift_version = "์Šค์œ„ํ”„ํŠธ_๋ฒ„์ „"
    s.ios.deployment_target  = 'target_iOS_๋ฒ„์ „'
end

 

 

H. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 8

5๋ฒˆ์—์„œ ๋งŒ๋“  ํด๋” git init ํ•ด์ค€ ํ›„ 1๋ฒˆ์˜ repository์— push

5๋ฒˆ์—์„œ ๋งŒ๋“  ํด๋”์—์„œ cmd open. ์ด ํด๋” ์•ˆ์—๋Š” ํ”„๋ ˆ์ž„์›Œํฌ ํด๋”์™€ .podspec ํŒŒ์ผ์ด ๋“ค์–ด์žˆ์–ด์•ผ ํ•จ.

git init
git remote add origin [1๋ฒˆ์—์„œ_๋งŒ๋“ _private_repository_์ฃผ์†Œ]
git status // ํŒŒ์ผ ์ƒํƒœ ๋ณด๋ ค๊ณ  ํ•œ ๊ฒƒ. ์ƒ๋žตํ•ด๋„ ๋จ
git add .
git commit -m "์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€"
git tag ๋ฒ„์ „๋ช… // ex. git tag 0.1.0
git push origin master tag ๋ฒ„์ „๋ช…

 

I. ๊ฐ ๊ณผ์ • ์„ค๋ช… - 9

ํ…Œ์ŠคํŠธ ํ”„๋กœ์ ํŠธ์—์„œ pod init ํ•ด์ค€ ํ›„ .podfile์— ์ข…์†์„ฑ ์ถ”๊ฐ€ํ•ด์ค€ ํ›„ pod update ํ›„ ํ…Œ์ŠคํŠธ!

  1. ํ…Œ์ŠคํŠธ ํ”„๋กœ์ ํŠธ ๋งŒ๋“ค๊ธฐ
  2. ํ”„๋กœ์ ํŠธ ์œ„์น˜์—์„œ cmd open
  3. pod init
  4. 3๋ฒˆ ๋ช…๋ น์–ด๋กœ ๋งŒ๋“ค์–ด์ง„ .podfile open
  5. podfile์— ๋‹ค์Œ ์ฝ”๋“œ ์ถ”๊ฐ€ pod 'ํ”„๋ ˆ์ž„์›Œํฌ๋ช…', :git => "remote_์ฃผ์†Œ", :tag => '๋ฒ„์ „๋ช…'
  6. 2๋ฒˆ์˜ cmd์—์„œ pod update
  7. ์™„๋ฃŒ

 

J. framework update?

ํ”„๋ ˆ์ž„์›Œํฌ ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ๋ฐ”๊ฟ”์„œ ์ƒˆ๋กœ์šด ๋ฒ„์ „์œผ๋กœ ๋ฆด๋ฆฌ์ฆˆํ•  ํ•„์š”๊ฐ€ ์ƒ๊ธด๋‹ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ณผ์ •์„ ๊ฑฐ์น˜๋ฉด ๋จ.

  1. ํ”„๋ ˆ์ž„์›Œํฌ ์ฝ”๋“œ ์ˆ˜์ •
  2. xcarchive, xcframework๋กœ ๋นŒ๋“œ
  3. xcframework ํด๋” ๋‹ค์‹œ git ๊ด€๋ฆฌ๋˜๋Š” ํด๋”๋กœ ๋ณต๋ถ™ (์ด์ „ xcframework ํด๋”๋Š” ์‚ญ์ œ)
  4. .podspec ํŒŒ์ผ์˜ ๋ฒ„์ „ ๋ฐ”๊ฟ”์ฃผ๊ธฐ
  5. cmd ์ฐฝ์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด ์ˆ˜ํ–‰
  6. git status // ํŒŒ์ผ ์ƒํƒœ ๋ณด๋ ค๊ณ  ํ•œ ๊ฒƒ. ์ƒ๋žตํ•ด๋„ ๋จ git add . git commit -m "์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€" git tag ๋ฒ„์ „๋ช… // ex. git tag 1.0.4 git push origin master tag ๋ฒ„์ „๋ช…
  7. ํ…Œ์ŠคํŠธ ํ”„๋กœ์ ํŠธ์˜ .podfile์—์„œ๋„ tag ๋’ค ๋ฒ„์ „ ์ˆ˜์ •
  8. ํ…Œ์ŠคํŠธ ํ”„๋กœ์ ํŠธ ์œ„์น˜์—์„œ cmd open, pod update ๋ช…๋ น์–ด ์‹คํ–‰

7๋ฒˆ ๊ณผ์ •์ด ๊ท€์ฐฎ๋‹ค๋ฉด ์›Œํฌ์ŠคํŽ˜์ด์Šค ๋ฐฉ์‹ ์‚ฌ์šฉ. ๋‹จ ์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ์— ์ด์‹ํ•ด๋ณด๋Š” ํ…Œ์ŠคํŠธ๋Š” ๊ผญ ํ•„์š”ํ•จ.

 

Z. ๋ ˆํผ๋Ÿฐ์Šค

๋”๋ณด๊ธฐ
CS/iOS, Swift