SlideShare a Scribd company logo
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift


macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
㊗
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift

macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
😘
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
import PackageDescription
let package = Package(
name: "SwiftPM",
dependencies: [
.Package(
url: "https://github.com/ikesyo/Himotoki",
majorVersion: 3, minor: 1
)
]
)
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
// 少し長くなるので
// 次ページ以降のスライドでコードを紹介
import Foundation
let environment = ProcessInfo.processInfo.environment
let buildRoot = environment["BUILD_ROOT"]!
let configuration = environment["CONFIGURATION"]!
let configurationBuildDir = environment["CONFIGURATION_BUILD_DIR"]!
Process.launchedProcess(launchPath: "/usr/bin/swift", arguments:
["package", "--build-path", buildRoot, "resolve"]).waitUntilExit()
Process.launchedProcess(launchPath: "/usr/bin/swift", arguments:
["build", "--build-path", buildRoot, "-c",
configuration.lowercased()]).waitUntilExit()
for buildPath in try! FileManager.default
.contentsOfDirectory(atPath: configurationBuildDir)
where buildPath.hasSuffix(".build") {
// ここでパッケージ単位で、
// バイナリファイルをライブラリ化する
//
// 次のスライドのコードを参照
}
let packageName = buildPath.dropLast(".build".count)
let packageBuildDir = "(configurationBuildDir)/(buildPath)"
let libraryName = "(configurationBuildDir)/lib(packageName).a"
let objects = try! FileManager.default
.contentsOfDirectory(atPath: packageBuildDir)
.filter { $0.hasSuffix(".o") }
let process = Process()
process.currentDirectoryPath = packageBuildDir
process.launchPath = "/usr/bin/libtool"
process.arguments = ["-o", libraryName] + objects
process.launch()
process.waitUntilExit()
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift


macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift

🤤
🌻


macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
mkdir SwiftPM-Modules
cd SwiftPM-Modules
swift package init
let package = Package(
name: "SwiftPM-Modules",
products: [
.library(
name: "SwiftPM-Modules", targets: ["SwiftPM-Modules"])],
dependencies: [
.package(url: "https://github.com/ikesyo/Himotoki", from: "3.1.0")
],
targets: [
.target(name: "SwiftPM-Modules", dependencies: ["Himotoki"] ),
],
swift package generate-xcodeproj
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift


macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
🌻
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift

More Related Content

PPTX
A Brief Introduction to Writing and Understanding Puppet Modules
PPTX
Creating beautiful puppet modules with puppet-lint
PDF
Solaris 11 base box for Vagrant using Packer
PPT
Configuration Management with Cfengine
PPTX
Nagios
PDF
Стажировка 2015. Разработка. Занятие 5. Использование nginx
PDF
2 docker engine_hands_on
 
PDF
Getting Started on Packaging Apps with Open Build Service
A Brief Introduction to Writing and Understanding Puppet Modules
Creating beautiful puppet modules with puppet-lint
Solaris 11 base box for Vagrant using Packer
Configuration Management with Cfengine
Nagios
Стажировка 2015. Разработка. Занятие 5. Использование nginx
2 docker engine_hands_on
 
Getting Started on Packaging Apps with Open Build Service

What's hot (19)

PDF
YOU CAN DO ANYTHING 1
PDF
How to make multi-boot USB drive for LiveCD iso images on EFI/UEFI and BIOS
PDF
F2e security
PDF
Introduction to FreeBSD commands(beta)
PDF
Tech talk Introduction to containers
PDF
Setting up iSCSI Providers and Clients in openSUSE
PDF
Booting directly opensuse iso file by grub2 @ openSUSE Asia Summit2015
PPTX
Tutorial to make sure of nginx files starterpack.
ODP
Introduction to Pelican
ODP
AutoYast
PDF
Openstack kilo installation using rdo
PDF
Openstack installation using rdo
DOCX
Proxy server ubuntu 12.04
PPTX
Environments line-up! Vagrant & Puppet 101
PDF
It’s about time to embrace Node.js Streams - Austin Node.js meetup
PDF
Ubuntu Cheat Sheet
TXT
Ftp configuration
PPTX
Mini-Training: Docker
ODP
Mule ESB : ssh connector
YOU CAN DO ANYTHING 1
How to make multi-boot USB drive for LiveCD iso images on EFI/UEFI and BIOS
F2e security
Introduction to FreeBSD commands(beta)
Tech talk Introduction to containers
Setting up iSCSI Providers and Clients in openSUSE
Booting directly opensuse iso file by grub2 @ openSUSE Asia Summit2015
Tutorial to make sure of nginx files starterpack.
Introduction to Pelican
AutoYast
Openstack kilo installation using rdo
Openstack installation using rdo
Proxy server ubuntu 12.04
Environments line-up! Vagrant & Puppet 101
It’s about time to embrace Node.js Streams - Austin Node.js meetup
Ubuntu Cheat Sheet
Ftp configuration
Mini-Training: Docker
Mule ESB : ssh connector
Ad

Similar to macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift (20)

PPT
Dance for the puppet master: G6 Tech Talk
PDF
EuroBSDCon 2023 - (auto)Installing BSD Systems - Cases using pfSense, TrueNAS...
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
PDF
WordPress mit Composer und Git verwalten
PPT
How to host an app for $20 in 20min using buildout and hostout
PPT
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
PDF
Node.js in action
PDF
Effective Python Package Management [PyCon Canada 2017]
PDF
20090514 Introducing Puppet To Sasag
PDF
Web development automatisation for fun and profit (Artem Daniliants)
PDF
DevFest 2022 - Cloud Workstation Introduction TaiChung
PDF
An Overview of the IHK/McKernel Multi-kernel Operating System
PDF
Globus toolkit4installationguide
PDF
Provisioning with Puppet
PDF
A re introduction to webpack - reactfoo - mumbai
PDF
Denys Serhiienko "ASGI in depth"
PPTX
installation of hadoop on ubuntu.pptx
ODP
Dexterity in 15 minutes or less
PDF
Bundling Packages and Deploying Applications with RPM
Dance for the puppet master: G6 Tech Talk
EuroBSDCon 2023 - (auto)Installing BSD Systems - Cases using pfSense, TrueNAS...
Dependencies Managers in C/C++. Using stdcpp 2014
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
WordPress mit Composer und Git verwalten
How to host an app for $20 in 20min using buildout and hostout
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Node.js in action
Effective Python Package Management [PyCon Canada 2017]
20090514 Introducing Puppet To Sasag
Web development automatisation for fun and profit (Artem Daniliants)
DevFest 2022 - Cloud Workstation Introduction TaiChung
An Overview of the IHK/McKernel Multi-kernel Operating System
Globus toolkit4installationguide
Provisioning with Puppet
A re introduction to webpack - reactfoo - mumbai
Denys Serhiienko "ASGI in depth"
installation of hadoop on ubuntu.pptx
Dexterity in 15 minutes or less
Bundling Packages and Deploying Applications with RPM
Ad

More from Tomohiro Kumagai (20)

PDF
最近気づいた勉強法 — 勉強会開催の習慣化 #yumemi_grow
PDF
Swift 所有権 要諦 #ゆるちとせ
PDF
_Function Builders in Swift #love_swift
PDF
Property Wrappers の特徴を眺める #swiftzoomin
PDF
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
PDF
みんなで Swift 復習会
GO! in 札幌 – 10th′′
PDF
イニシャライザー Part 2.5 #hakataswift
PDF
ニコニコ超会議・文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
PDF
Swift クラスのイニシャライザー #devsap
PDF
iOSCon 2019 in London #ioscon #love_swift
PDF
Around the 変数 let #love_swift
PDF
もくもく執筆会 #技術同人誌再販Night
PDF
みんなで Swift 復習会 GO! in 岩手 – 9th′
PDF
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
PDF
Getting Started with Attending iOSCon in London 高画質・追記版 #love_swift #ioscon
PDF
みんなで Swift 復習会
GO! in 京都 – 6th′
PDF
みんなで Swift 復習会 GO! in 福岡 – 5th′
PDF
勉強会の東京外開催の気持ち #yuru_bounen2017
PDF
みんなで Swift 復習会 GO! in 福岡・発表資料
PDF
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
最近気づいた勉強法 — 勉強会開催の習慣化 #yumemi_grow
Swift 所有権 要諦 #ゆるちとせ
_Function Builders in Swift #love_swift
Property Wrappers の特徴を眺める #swiftzoomin
みんなで Swift 復習会 GO! in "Swift Days Fukuoka" – 12nd′ オープニング&資料
みんなで Swift 復習会
GO! in 札幌 – 10th′′
イニシャライザー Part 2.5 #hakataswift
ニコニコ超会議・文化の交差点 #techpub #ニコニコ超会議 #さくらシンデレラ
Swift クラスのイニシャライザー #devsap
iOSCon 2019 in London #ioscon #love_swift
Around the 変数 let #love_swift
もくもく執筆会 #技術同人誌再販Night
みんなで Swift 復習会 GO! in 岩手 – 9th′
みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
Getting Started with Attending iOSCon in London 高画質・追記版 #love_swift #ioscon
みんなで Swift 復習会
GO! in 京都 – 6th′
みんなで Swift 復習会 GO! in 福岡 – 5th′
勉強会の東京外開催の気持ち #yuru_bounen2017
みんなで Swift 復習会 GO! in 福岡・発表資料
Protocol-Oriented Integers に想うジェネリックプログラミングの未来

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PPTX
history of c programming in notes for students .pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ai tools demonstartion for schools and inter college
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
top salesforce developer skills in 2025.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
wealthsignaloriginal-com-DS-text-... (1).pdf
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms I-SECS-1021-03
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms II-SECS-1021-03
Digital Strategies for Manufacturing Companies
history of c programming in notes for students .pptx
Softaken Excel to vCard Converter Software.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Understanding Forklifts - TECH EHS Solution
ai tools demonstartion for schools and inter college
Operating system designcfffgfgggggggvggggggggg
L1 - Introduction to python Backend.pptx
Reimagine Home Health with the Power of Agentic AI​
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
top salesforce developer skills in 2025.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx

macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift

  • 3.
  • 13.
  • 19.
  • 21. 😘
  • 27. import PackageDescription let package = Package( name: "SwiftPM", dependencies: [ .Package( url: "https://github.com/ikesyo/Himotoki", majorVersion: 3, minor: 1 ) ] )
  • 34. import Foundation let environment = ProcessInfo.processInfo.environment let buildRoot = environment["BUILD_ROOT"]! let configuration = environment["CONFIGURATION"]! let configurationBuildDir = environment["CONFIGURATION_BUILD_DIR"]!
  • 35. Process.launchedProcess(launchPath: "/usr/bin/swift", arguments: ["package", "--build-path", buildRoot, "resolve"]).waitUntilExit() Process.launchedProcess(launchPath: "/usr/bin/swift", arguments: ["build", "--build-path", buildRoot, "-c", configuration.lowercased()]).waitUntilExit()
  • 36. for buildPath in try! FileManager.default .contentsOfDirectory(atPath: configurationBuildDir) where buildPath.hasSuffix(".build") { // ここでパッケージ単位で、 // バイナリファイルをライブラリ化する // // 次のスライドのコードを参照 }
  • 37. let packageName = buildPath.dropLast(".build".count) let packageBuildDir = "(configurationBuildDir)/(buildPath)" let libraryName = "(configurationBuildDir)/lib(packageName).a" let objects = try! FileManager.default .contentsOfDirectory(atPath: packageBuildDir) .filter { $0.hasSuffix(".o") } let process = Process() process.currentDirectoryPath = packageBuildDir process.launchPath = "/usr/bin/libtool" process.arguments = ["-o", libraryName] + objects process.launch() process.waitUntilExit()
  • 40.
  • 42.
  • 43. 🤤
  • 44. 🌻
  • 45.
  • 49. let package = Package( name: "SwiftPM-Modules", products: [ .library( name: "SwiftPM-Modules", targets: ["SwiftPM-Modules"])], dependencies: [ .package(url: "https://github.com/ikesyo/Himotoki", from: "3.1.0") ], targets: [ .target(name: "SwiftPM-Modules", dependencies: ["Himotoki"] ), ],
  • 52.
  • 55. 🌻