Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MPPでSwift_Packagesを使ってみました.pdf

E7d2ba28bc3f05d80903053048ec1a90?s=47 gmvalentino-tl
August 05, 2021
38

 MPPでSwift_Packagesを使ってみました.pdf

E7d2ba28bc3f05d80903053048ec1a90?s=128

gmvalentino-tl

August 05, 2021
Tweet

Transcript

  1. MPPでSwift Packagesを使ってみました 07/29/2021 Marco Valentino

  2. About Me - Graduated with Master’s Degree from University of

    Illinois Urbana Champaign - Joined teamLab in April 2019 doing iOS (0.5 years) and Android (~1.5 years) development - Started working with Kotlin Multiplatform since early 2020
  3. Swift Package Manager Overview - First-party Dependency Manager integrated with

    the Swift build system - Group of source files that are compiled to form a module - Uses a manifest file Package.swift to define contents and dependencies https://swift.org/package-manager/ https://developer.apple.com/documentation/swift_packages https://github.com/apple/swift-package-manager
  4. Multiplatform Swift Package Plugin

  5. Multiplatform Swift Package Plugin - Setup https://github.com/ge-org/multiplatform-swiftpackage build.gradle.kts (shared) plugins

    { ... id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3" }
  6. Multiplatform Swift Package Plugin - Configuration https://github.com/ge-org/multiplatform-swiftpackage build.gradle.kts (shared) kotlin

    { ... multiplatformSwiftPackage { swiftToolsVersion("5.3") targetPlatforms { iOS { v("14") } } outputDirectory(File(project.projectDir, "SwiftPackage")) } }
  7. Multiplatform Swift Package Plugin - Usage https://github.com/ge-org/multiplatform-swiftpackage sh (terminal). ./gradlew

    createSwiftPackage
  8. Multiplatform Swift Package Plugin - Usage https://github.com/ge-org/multiplatform-swiftpackage sh (terminal). ./gradlew

    createSwiftPackage
  9. Link Swift Package in Xcode - Local

  10. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  11. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  12. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  13. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  14. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  15. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  16. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  17. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  18. Link Swift Package in Xcode - Local https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-local

  19. Link Swift Package in Xcode - Remote

  20. Link Swift Package in Xcode - Remote - Create Github

    repository - Initialize git inside SwiftPackage folder - git init, add, commit, branch, remote add origin, push https://github.com/gmvalentino8/MppSwiftPackageArtifacts
  21. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  22. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  23. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  24. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  25. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  26. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  27. Link Swift Package in Xcode - Remote https://github.com/gmvalentino8/MppSwiftPackagesExample/tree/example/swift-packages-remote

  28. Conclusion

  29. Pros/Cons Pros: - First-party Dependency Manager - Minimal setup required

    - Works for either local or remote linking - Faster build and publishing Cons: - Third-party plugin - Haven’t found a way to include both local and remote in the same project
  30. Thanks for listening!