Slide 1

Slide 1 text

Swift Package Manager (SwiftPM, SPM) 2016-05-25 potatotips #29 JPMartha 1

Slide 2

Slide 2 text

ࣗݾ঺հ @JPMartha_jp JPMartha 2

Slide 3

Slide 3 text

Swift Package Manager 3

Slide 4

Slide 4 text

࿩͢͜ͱ ᶃ Swift Package Manager ೖ໳ ᶄ ͜ΕΛۦ࢖ͨ͠πʔϧ঺հ 4

Slide 5

Slide 5 text

apple / swift-package-manager
 (GitHub) 5

Slide 6

Slide 6 text

Merged ! 6

Slide 7

Slide 7 text

ͨͩ͠։ൃ͢Δʹ͸ apple / master ͷ࠷৽͕ඞཁ ʢDevelopment Snapshots ͸ෆཁʣ ͍Ζ͍Ζ΍΍͍͜͠ͷͰ ڵຯ͕͋Δํ͸ͷͪ΄Ͳฉ͍͍ͯͩ͘͞ɻ 7

Slide 8

Slide 8 text

͝ଘ஌ͳ͍ํ޲͚ʹ • ैདྷͷϥΠϒϥϦΛύοέʔδͱݺͼ·͢ɻ • CocoaPods, Carthage ͷΑ͏ʹϥΠϒϥϦΛ؅ཧ ͢ΔπʔϧͰ͢ɻ • ͨͩ͠গ͠ҧ͍·͢ɻ 8

Slide 9

Slide 9 text

ύοέʔδΛ Ϗϧυ͢Δ $ swift build 9

Slide 10

Slide 10 text

$ swift build • Xcode Λ࢖Θͳ͍ͰύοέʔδશମΛϏϧυ͠·͢ɻ • Swift 3.0-devʢSwift 2.2 ʹ͸ͳ͍ʣͰ͢ɻ • Apple ͷϦϙδτϦʹকདྷ૾͕هࡌ͞Ε͍ͯ·͕͢۩ମ తʹ͸·ͩΘ͔Γ·ͤΜɻ • Archive ͕ͳ͍Ͱ͕͢ Xcode ϓϩδΣΫτΛੜ੒͢ΔίϚ ϯυ͕͋Γ·͢ɻ`$ swift build -X`
 ʢকདྷతʹ Xcode ʹ૊Έࠐ·ΕΔΑ͏Ͱ͢ʣ 10

Slide 11

Slide 11 text

Tips ୯ʹʮ͜͏͍͏͜ͱ͕Ͱ͖·͢ʯͱ͍͏࿩Ͱ͢ɻ 11

Slide 12

Slide 12 text

Module • Sources ͱ Tests ҎԼΛσΟϨΫτϦͰΘ͚Δ͜ͱ ʹΑΓɺ໊લۭؒΛΘ͚Δ͜ͱ͕Ͱ͖·͢ɻ Directory.isAccessible() File.isAccessible() • αʔυύʔςΟͷϥΠϒϥϦͰ໊લ͕όοςΟϯ άͯ͠΋Αͦ͞͏Ͱ͢ɻʢσΟϨΫτϦ͕ผʣ 12

Slide 13

Slide 13 text

Directory / File #if os(Linux) import Glibc #else import Darwin #endif #if os(Linux) public func isAccessible(name: String) -> Bool { guard !name.isEmpty else { return false } return access(name, F_OK) == 0 } #else public func isAccessible(path: String) -> Bool { guard !path.isEmpty else { return false } return access(path, F_OK) == 0 } #endif 13

Slide 14

Slide 14 text

Travis CI Cross-Platform (OS X, Linux) 14

Slide 15

Slide 15 text

.travis.yml 15

Slide 16

Slide 16 text

run-tests.sh 16

Slide 17

Slide 17 text

JPMartha / FounDarwin 17

Slide 18

Slide 18 text

͜͜·Ͱ͕ Swift Package Manager ೖ໳ͷ ࿩Ͱͨ͠ɻ 18

Slide 19

Slide 19 text

Swift Package Manager Ͱ ίϚϯυϥΠϯπʔϧΛ ࡞੒͠·ͨ͠ tryswift on GitHub 19

Slide 20

Slide 20 text

tryswiftdev Φʔϓϯιʔε༻ίϚϯυϥΠϯπʔϧ܈Ͱ͢ɻ 20

Slide 21

Slide 21 text

README Generator ৽͍͠ϓϩδΣΫτͷ README Λ؆୯ʹ࡞Ε·͢ʂ • It duplicates an existing README.md • It replaces strings (e.g. Name) in a README.md 21

Slide 22

Slide 22 text

Slide 23

Slide 23 text

Slide 24

Slide 24 text

Find it "image not found” Λ୳͠·͢ʂ • "Find It" searches for a specified file in some directories. • It makes easy for you to compare your Xcode Build Settings and find a mistake. 24

Slide 25

Slide 25 text

Slide 26

Slide 26 text

Version Strings Updater ֤छυΩϡϝϯτͷόʔδϣϯ จࣈྻΛҰׅม׵͠·͢ʂ 26

Slide 27

Slide 27 text

Slide 28

Slide 28 text

Development Snapshots Installer ৽͍͠ Snapshots Λ؆୯ʹΠϯετʔϧͰ͖·͢ʂ • It downloads a specified Developer Snapshot into your current working directory. • It installs the package via the sudo command. • It removes the pkg file. 28

Slide 29

Slide 29 text

Slide 30

Slide 30 text

try! Swift 3.0 Swift 3.0 ޲͚ͷ؀ڥม਺Λ؆୯ʹ ઃఆͰ͖·͢ʂ 30

Slide 31

Slide 31 text

Slide 32

Slide 32 text

A WORK IN PROGRESS " 32

Slide 33

Slide 33 text

Thanks! 33