Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Bringing CocoaPods to Linux
Search
Boris Bügling
September 16, 2015
Programming
0
1k
Bringing CocoaPods to Linux
Talk on build systems and abstracting them inside CocoaPods. Given at NSSpain 2015. 🍷
Boris Bügling
September 16, 2015
Tweet
Share
More Decks by Boris Bügling
See All by Boris Bügling
Testing ⌚️ Apps and Other Extensions
neonichu
1
4.6k
Cross-platform Swift
neonichu
4
18k
Building better API clients in Swift
neonichu
1
290
Cross-platform Swift
neonichu
3
890
Swift Package Manager
neonichu
2
320
Swift Package Manager
neonichu
0
50
📺
neonichu
0
2k
Cross-Platform Swift
neonichu
0
75
Swift Package Manager
neonichu
6
4.3k
Other Decks in Programming
See All in Programming
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
AHC041解説
terryu16
0
380
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.1k
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
700
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
140
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5.2k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Mobile First: as difficult as doing things right
swwweet
222
9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Scaling GitHub
holman
459
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
A Tale of Four Properties
chriscoyier
157
23k
Transcript
Bringing CocoaPods to Linux NSSpain, September 2015 Boris Bügling -
@NeoNacho
CocoaPods dependency management ✅
Contentful content management ✅
Xcode?
Agenda 4 Why? 4 Xcode's build system 4 How does
CocoaPods interact with it? 4 Alternatives 4 Plan
None
None
None
No Xcode on Linux
Xcode is broken
ya tu sabes
Quora Post from early 2014
Just two examples 4 Archiving watchOS 2.0 apps 4 CLANG_ENABLE_MODULES
[Xcode 7 beta] Linking dual (iphoneos and watchos) frameworks with
same product name causes archive to fail http://openradar.appspot.com/22392501
None
CLANG_ENABLE_MODULES
Enables the use of modules for system APIs. System headers
are imported as semantic modules instead of raw headers.
"system APIs" == any framework outside your target !
None
Bring back CocoaPods to its core and move rest (e.g.
Xcode integration) into plugins. #2729 From October 2014 https://github.com/CocoaPods/CocoaPods/issues/ 2729
Solve everyday problems for Cocoa and Xcode developers.
Let's face it, programming sucks.
Xcode's build system
4 Fairly old (Xcode3Core.ideplugin) 4 Entirely based on mtimes 4
Poorly documented
De-facto documentation 4 http://pewpewthespells.com/blog/ managing_xcode.html 4 http://pewpewthespells.com/blog/ buildsettings.html
Xcode project files !"#
Tomorrow 16:30 - 17:00 Grant Paul - Making Sense of
Xcode
How does CocoaPods interact with it?
4 Pods project 4 Integration into the user project 4
Linting
Pods project 4 Generated by our Xcodeproj gem 4 Targets
for all Pods 4 XCConfig files
Private XCConfig #include "ContentfulDeliveryAPI.xcconfig" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS =
"${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ContentfulDeliveryAPI" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Bypass" "${PODS_ROOT}/Headers/Public/CGLMail" "${PODS_ROOT}/Headers/Public/ContentfulDeliveryAPI" "${PODS_ROOT}/Headers/Public/ContentfulDialogs" "${PODS_ROOT}/Headers/Public/ContentfulPersistence" "${PODS_ROOT}/Headers/Public/ContentfulStyle" "${PODS_ROOT}/Headers/Public/DDPageControl" "${PODS_ROOT}/Headers/Public/EDColor" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/ISO8601DateFormatter" "${PODS_ROOT}/Headers/Public/LatoFont" "${PODS_ROOT}/Headers/Public/TSMiniWebBrowser@dblock" OTHER_LDFLAGS = ${CONTENTFULDELIVERYAPI_OTHER_LDFLAGS} -ObjC PODS_ROOT = ${SRCROOT} SKIP_INSTALL = YES
Build settings 4 GCC_PREPROCESSOR_DEFINITIONS 4 HEADER_SEARCH_PATHS 4 OTHER_LDFLAGS
None
User project 4 Optional integration (--no-integrate) 4 Implicit target dependencies
4 XCConfig files
Public XCConfig CONTENTFULDELIVERYAPI_OTHER_LDFLAGS = -framework "MapKit" -framework "UIKit"
If you edit OTHER_LDFLAGS in your project, settings will be
copied.
Build phases
Linting 4 Shells out to xcodebuild
Alternatives
Makefiles
package: $(EXECUTABLE_NAME) $(INFO_PLIST) mkdir -p "$(PRODUCT_NAME).app" @/bin/echo -n 'AAPL' >
"$(PRODUCT_NAME).app/PkgInfo" @$(PLBUDDY) -c 'Print CFBundleSignature' $(INFO_PLIST) \ >> "$(PRODUCT_NAME).app/PkgInfo" cp $(EXECUTABLE_NAME) "$(PRODUCT_NAME).app" $(BASE_DIR)/sh/build_plist $(INFO_PLIST) "$(PRODUCT_NAME).app/Info.plist" $(BASE_DIR)/sh/build_ipa "$(PRODUCT_NAME).app" $(EXECUTABLE_NAME): $(OBJS) $(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^
Makefiles 4 Build rules to transform files (e.g. .m =>
.o) 4 Based on mtimes 4 "Phony" rules which run unconditionally 4 Dependencies to files or other rules 4 Exists everywhere
Rules target: dependencies build step(s)
Execution make [options] [target1 target2 ...]
Buck
None
None
None
None
None
=> no more DerivedData nonsense !
Installation $ brew update $ brew tap facebook/fb $ brew
install --HEAD buck
Quickstart $ buck quickstart --type ios --dest-dir . [...] $
buck build demo_app_ios [...] $ ls buck-out/gen/ios/BuckDemoApp BuckDemoApp.app BuckDemoApp.dSYM
Initial build $ buck build demo_app_ios [...] [-] BUILDING...FINISHED 2.4s
(8/8 JOBS, 8 UPDATED, 0.0% CACHE HITS) Subsequent builds $ buck build demo_app_ios [...] [-] BUILDING...FINISHED 0.0s (1/8 JOBS, 0 UPDATED)
Faster iterations
BUCK apple_binary( [...] ) xcode_project_config( name = 'Hello', src_target =
':Hello', action_config_names={'profile': 'Profile'} )
Source files srcs = [ 'Code/AppDelegate.m' 'Code/ViewController.m', 'Code/main.m', ],
Headers headers = [ 'Code/AppDelegate.h' 'Code/ViewController.h', ],
Linked frameworks frameworks = [ '$SDKROOT/System/Library/Frameworks/Foundation.framework', '$SDKROOT/System/Library/Frameworks/UIKit.framework', ],
Dependencies deps = [ '//Libraries/EXExample:EXExample', ],
Buck does not support Swift !
Plan
Plan 4 Prototype with plugins ! 4 Abstraction for the
build system 4 Mapping for build settings (*_xcconfig attributes) 4 ??? 4 Profit!
Add a new platform
Adding a new platform (tvos)
Gemfile source 'https://rubygems.org' gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', :branch =>
'tvos' gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git', :branch => 'tvos-support' gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git', :branch => 'tvos-support' Usage: $ bundle exec pod install
Xcode is a leaky abstraction, try to learn what's underneath
it.
Thanks!
https://www.facebook.com/events/ 1495505997428211/ _ @NeoNacho
[email protected]
http://buegling.com/talks