SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
HONZA DVORSKY
@czechboy0
honzadvorsky.com
29.09.2016
Swift
• created by Apple
• announced in June 2014
• open sourced December 2015
• Swift 3.0 - September 2016
Swift Package Manager
SwiftPM
• an iOS/macOS developer
• backend developer
• an Android developer
• interested in what Apple sees as the future of programming
Listen carefully if you’re…
• introduction to SwiftPM
• demo
• advanced topics
Agenda
[SwiftPM] is a tool for managing the distribution of Swift code.
It’s integrated with the Swift build system to automate the
process of downloading, compiling and linking dependencies.
— swift.org/package-manager
• dependency manager
• build tool
• test tool
SwiftPM is a
• command line based
• cross-platform (macOS, Linux)
• decentralized
• opinionated
• convention over configuration
SwiftPM is
• swift.org/package-manager
• github.com/apple/swift-package-manager
• Mailing list: swift-build-dev
• Slack: https://swift-package-manager.herokuapp.com
Where to learn more about it
Swift Package Manager
Swift Package Manager
• is a folder
• Package.swift
• source files
• contains modules
Package
• collection of source files (e.g. .swift files)
• build instructions (e.g. “build as a library”)
• e.g. Foundation, XCTest, Dispatch, …
Module
Example Package: Environment
• 1 library module
• 1 test module
“I already use CocoaPods/Carthage, is this just
another dependency manager?”
— you
“I already support CocoaPods, how can I support
SwiftPM?”
— you
• https://github.com/neonichu/schoutedenapus
• converts CocoaPods Spec to Package.swift
• helpful starting point for existing projects
CocoaPods -> SwiftPM
“Why should i support SwiftPM?”
— you
• >3500 SwiftPM packages on GitHub
• stats: github.com/czechboy0/swiftpm-packages-statistics
• server-side Swift community
• models, parsers, networking
• Foundation, XCTest, Dispatch available on macOS, Ubuntu
SwiftPM Adopters
• apple/swift port to Android Pull Request
• Getting Started with Swift on Android
• How we put an app in the Android Play Store using Swift
• Google considering Swift for Android
Swift on Android
• Xcode 8
• part of Swift 3 toolchains (swift.org/download)
• swiftenv: github.com/kylef/swiftenv
Installing SwiftPM
Getting our 🙌 dirty
1. mDevTool
1.1.extension on String to prepend “mDev” (“Talk” ->
“mDevTalk”)
1.2.command line tool to use (1)
2. mDevServer
2.1.Swift server to generate HTML template using (1)
Demo
To Xcode!
Back To Slides!
• no need to run Linux locally
• scales to more platforms in
the future (Linux flavors,
Windows, Android)
• free for OSS projects
• example: Environment
Testing with Travis CI
.travis.yml in Environment
• established:
• CocoaPods Search
• new:
• Swift Package Catalog: swiftpkgs.ng.bluemix.net
• libraries.io
• Twitter, GitHub
Package discovery
• Vapor: vapor.codes
• IBM: github.com/IBM-Swift
• Zewo: zewo.io
• Open Swift: github.com/open-swift
• many more
Server-side Swift community
Advanced 📦
Swift Package Manager
• Swift
• C
• Objective-C
• C++
• Objective-C++
Languages supported
• swift build
• swift test
• swift package
SwiftPM commands
swift build
swift test
swift package
• collection of modules (targets)
• module is a collection of sources
• module types
• library (source files, no main.swift)
• executable (source files, 1 main.swift)
• system module
Package
• using system libraries (e.g. openssl, curl) in SwiftPM
• modulemap
System module
• how to use:
• http://ankit.im/swift/2016/04/06/compiling-and-
interpolating-C-using-swift-package-manager/
• http://ankit.im/swift/2016/05/21/creating-objc-cpp-
packages-with-swift-package-manager/
Modules
Implicit
Explicit
Dependencies
swift package show-dependencies
http://swiftpm-deps.honza.tech
• Community Proposal
• SE-0019 Package Manager Testing
• SE-0038 C Language Target Support
• SE-0063 System Module Search Paths
• SE-0082 Editable Packages
• SE-0085 Command Names
• SE-0129 Test Naming Conventions
• SE-0135 Support for Differentiating Packages by Swift version
SwiftPM Evolution
• Deeper Xcode integration
• better iOS/watchOS/tvOS support
• “you tell me”
Missing features
https://realm.io/news/tryswift-jesse-squires-contributing-open-
source-swift/
Contributing to OSS Swift
• start reading the mailing list
• read documentation, source code
• join the Slack
• follow people on Twitter and GitHub
Getting Involved 💙
• Honza Dvorsky
• @czechboy0
• honzadvorsky.com
• slides: https://honzadvorsky.com/articles/2016-09-29-19-00-
mdevtalk_swift_package_manager
👋
WWW.MDEVTALK.CZ
mdevtalk

Más contenido relacionado

La actualidad más candente

Scaling monitoring with Datadog
Scaling monitoring with DatadogScaling monitoring with Datadog
Scaling monitoring with Datadog
alexismidon
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing Fails
Rand Fishkin
 

La actualidad más candente (20)

BCA documents
BCA documentsBCA documents
BCA documents
 
Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?
 
Scaling monitoring with Datadog
Scaling monitoring with DatadogScaling monitoring with Datadog
Scaling monitoring with Datadog
 
8 Secrets to Winning Pitches - LIKE A BOSS
8 Secrets to Winning Pitches - LIKE A BOSS8 Secrets to Winning Pitches - LIKE A BOSS
8 Secrets to Winning Pitches - LIKE A BOSS
 
Integrating Postgres with ActiveMQ and Camel
Integrating Postgres with ActiveMQ and CamelIntegrating Postgres with ActiveMQ and Camel
Integrating Postgres with ActiveMQ and Camel
 
10 Best Productivity Hacks for Customer Service
10 Best Productivity Hacks for Customer Service10 Best Productivity Hacks for Customer Service
10 Best Productivity Hacks for Customer Service
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing Fails
 
A Guide to the Holiday Job Search
A Guide to the Holiday Job Search A Guide to the Holiday Job Search
A Guide to the Holiday Job Search
 
APIs as a Product Strategy
APIs as a Product StrategyAPIs as a Product Strategy
APIs as a Product Strategy
 
How to Build a Media Empire for Free
How to Build a Media Empire for FreeHow to Build a Media Empire for Free
How to Build a Media Empire for Free
 
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
 
The Build Trap
The Build TrapThe Build Trap
The Build Trap
 
Learn, Unlearn and Relearn
Learn, Unlearn and RelearnLearn, Unlearn and Relearn
Learn, Unlearn and Relearn
 
Mikes Guides AI tools ebook.pdf
Mikes Guides AI tools ebook.pdfMikes Guides AI tools ebook.pdf
Mikes Guides AI tools ebook.pdf
 
types of prompts 1.0.pdf
types of prompts 1.0.pdftypes of prompts 1.0.pdf
types of prompts 1.0.pdf
 
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
KPIs for APIs (and how API Calls are the new Web Hits, and you may be measuri...
 
The Minimum Loveable Product
The Minimum Loveable ProductThe Minimum Loveable Product
The Minimum Loveable Product
 
50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)
 
Cloud History 101
Cloud History 101Cloud History 101
Cloud History 101
 
How to Submit Your Content to Reddit
How to Submit Your Content to RedditHow to Submit Your Content to Reddit
How to Submit Your Content to Reddit
 

Destacado

Lista de 5 candidatos ao grupo de inglês 330
Lista de 5 candidatos ao grupo de inglês   330Lista de 5 candidatos ao grupo de inglês   330
Lista de 5 candidatos ao grupo de inglês 330
lourde cruz
 
Atelier de renforcement et de sensibilisation des communautés
Atelier de renforcement et de sensibilisation des communautésAtelier de renforcement et de sensibilisation des communautés
Atelier de renforcement et de sensibilisation des communautés
Bernard Yongabi Ngalim
 
Gamification of Greene County
Gamification of Greene County Gamification of Greene County
Gamification of Greene County
drvit20
 
Tema 7 - Cuestionario
Tema 7  -  Cuestionario Tema 7  -  Cuestionario
Tema 7 - Cuestionario
MCONECA Oneca
 
Otros ej 5 y 6 2ª parte
Otros ej  5 y 6 2ª parteOtros ej  5 y 6 2ª parte
Otros ej 5 y 6 2ª parte
MCONECA Oneca
 

Destacado (19)

Higiene y seguridad 3 corte
Higiene y seguridad 3 corteHigiene y seguridad 3 corte
Higiene y seguridad 3 corte
 
Otros ej tema 5 sol
Otros ej tema 5 solOtros ej tema 5 sol
Otros ej tema 5 sol
 
Readme
ReadmeReadme
Readme
 
Lista de 5 candidatos ao grupo de inglês 330
Lista de 5 candidatos ao grupo de inglês   330Lista de 5 candidatos ao grupo de inglês   330
Lista de 5 candidatos ao grupo de inglês 330
 
Gestion 1
Gestion 1Gestion 1
Gestion 1
 
Apresentação1
Apresentação1Apresentação1
Apresentação1
 
Atelier de renforcement et de sensibilisation des communautés
Atelier de renforcement et de sensibilisation des communautésAtelier de renforcement et de sensibilisation des communautés
Atelier de renforcement et de sensibilisation des communautés
 
Charles Du: Introduction to Mobile UX Design
Charles Du: Introduction to Mobile UX DesignCharles Du: Introduction to Mobile UX Design
Charles Du: Introduction to Mobile UX Design
 
David Bureš - Xamarin, IoT a Azure
David Bureš - Xamarin, IoT a AzureDavid Bureš - Xamarin, IoT a Azure
David Bureš - Xamarin, IoT a Azure
 
Curricula de redes II
Curricula de redes IICurricula de redes II
Curricula de redes II
 
Gamification of Greene County
Gamification of Greene County Gamification of Greene County
Gamification of Greene County
 
Tema 7 - Cuestionario
Tema 7  -  Cuestionario Tema 7  -  Cuestionario
Tema 7 - Cuestionario
 
Walid N Kaba
Walid N KabaWalid N Kaba
Walid N Kaba
 
Otros ej 5 y 6 2ª parte
Otros ej  5 y 6 2ª parteOtros ej  5 y 6 2ª parte
Otros ej 5 y 6 2ª parte
 
Petr Šíma: Principy funkcionálně reaktivního programovaní na mobilních platfo...
Petr Šíma: Principy funkcionálně reaktivního programovaní na mobilních platfo...Petr Šíma: Principy funkcionálně reaktivního programovaní na mobilních platfo...
Petr Šíma: Principy funkcionálně reaktivního programovaní na mobilních platfo...
 
Tema 7 ejercicios
Tema 7 ejerciciosTema 7 ejercicios
Tema 7 ejercicios
 
Link list
Link listLink list
Link list
 
titulo
titulotitulo
titulo
 
Web analytics -kpi e cruscotti
Web analytics -kpi e cruscottiWeb analytics -kpi e cruscotti
Web analytics -kpi e cruscotti
 

Similar a Honza Dvorský: Swift Package Manager

Similar a Honza Dvorský: Swift Package Manager (20)

Swift Buildpack for Cloud Foundry
Swift Buildpack for Cloud FoundrySwift Buildpack for Cloud Foundry
Swift Buildpack for Cloud Foundry
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
Moving microsoft .net applications one container at a time
 Moving microsoft .net applications one container at a time  Moving microsoft .net applications one container at a time
Moving microsoft .net applications one container at a time
 
iOS Application Exploitation
iOS Application ExploitationiOS Application Exploitation
iOS Application Exploitation
 
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application Security
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
 
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
 
A tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWSA tale of two pizzas: Developer tools at AWS
A tale of two pizzas: Developer tools at AWS
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewbox
 
Evolution of VS code Java ecosystem
Evolution of VS code Java ecosystemEvolution of VS code Java ecosystem
Evolution of VS code Java ecosystem
 
Pyfest Tunisia 2015 - Python & DevOps
Pyfest Tunisia 2015 - Python & DevOpsPyfest Tunisia 2015 - Python & DevOps
Pyfest Tunisia 2015 - Python & DevOps
 
Java1
Java1Java1
Java1
 
Java1
Java1Java1
Java1
 
Contributing to OpenStack
Contributing to OpenStackContributing to OpenStack
Contributing to OpenStack
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 

Más de mdevtalk

Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve SwiftuJan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
mdevtalk
 
Jarda Machaň: Proč je dobré míti Developer Evangelistu
Jarda Machaň: Proč je dobré míti Developer EvangelistuJarda Machaň: Proč je dobré míti Developer Evangelistu
Jarda Machaň: Proč je dobré míti Developer Evangelistu
mdevtalk
 
Nikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutionsNikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutions
mdevtalk
 

Más de mdevtalk (20)

Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve SwiftuJan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
 
Jarda Machaň: Proč je dobré míti Developer Evangelistu
Jarda Machaň: Proč je dobré míti Developer EvangelistuJarda Machaň: Proč je dobré míti Developer Evangelistu
Jarda Machaň: Proč je dobré míti Developer Evangelistu
 
Pavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOS
Pavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOSPavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOS
Pavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOS
 
Anastasiia Vixentael: 10 things you need to know before implementing cryptogr...
Anastasiia Vixentael: 10 things you need to know before implementing cryptogr...Anastasiia Vixentael: 10 things you need to know before implementing cryptogr...
Anastasiia Vixentael: 10 things you need to know before implementing cryptogr...
 
Michal Havryluk: How To Speed Up Android Gradle Builds
Michal Havryluk: How To Speed Up Android Gradle BuildsMichal Havryluk: How To Speed Up Android Gradle Builds
Michal Havryluk: How To Speed Up Android Gradle Builds
 
Vladislav Iliushin: Dark side of IoT
Vladislav Iliushin: Dark side of IoTVladislav Iliushin: Dark side of IoT
Vladislav Iliushin: Dark side of IoT
 
Georgiy Shur: Bring onboarding to life
Georgiy Shur: Bring onboarding to lifeGeorgiy Shur: Bring onboarding to life
Georgiy Shur: Bring onboarding to life
 
David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?
 
Maxim Zaks: Deep dive into data serialisation
Maxim Zaks: Deep dive into data serialisationMaxim Zaks: Deep dive into data serialisation
Maxim Zaks: Deep dive into data serialisation
 
Nikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutionsNikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutions
 
Milan Oulehla: Bezpečnost mobilních aplikací na Androidu
Milan Oulehla: Bezpečnost mobilních aplikací na AndroiduMilan Oulehla: Bezpečnost mobilních aplikací na Androidu
Milan Oulehla: Bezpečnost mobilních aplikací na Androidu
 
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundůTomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
 
David Vávra: Firebase + Kotlin + RX + MVP
David Vávra: Firebase + Kotlin + RX + MVPDavid Vávra: Firebase + Kotlin + RX + MVP
David Vávra: Firebase + Kotlin + RX + MVP
 
Adam Šimek: Optimalizace skrolování, RecyclerView
Adam Šimek: Optimalizace skrolování, RecyclerViewAdam Šimek: Optimalizace skrolování, RecyclerView
Adam Šimek: Optimalizace skrolování, RecyclerView
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & sync
 
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptatDominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
 
Jiří Dutkevič: Ochrana citlivých dat v iOS
Jiří Dutkevič: Ochrana citlivých dat v iOSJiří Dutkevič: Ochrana citlivých dat v iOS
Jiří Dutkevič: Ochrana citlivých dat v iOS
 
Petr Dvořák: Push notifikace ve velkém
Petr Dvořák: Push notifikace ve velkémPetr Dvořák: Push notifikace ve velkém
Petr Dvořák: Push notifikace ve velkém
 
Ondřej David: Zabezpečení Androidu na úrovni hardwaru
Ondřej David: Zabezpečení Androidu na úrovni hardwaruOndřej David: Zabezpečení Androidu na úrovni hardwaru
Ondřej David: Zabezpečení Androidu na úrovni hardwaru
 
Petr Hamerník: Textová analytika v mobilních aplikacích
Petr Hamerník: Textová analytika v mobilních aplikacíchPetr Hamerník: Textová analytika v mobilních aplikacích
Petr Hamerník: Textová analytika v mobilních aplikacích
 

Último

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Último (8)

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 

Honza Dvorský: Swift Package Manager