Skip to content

Conversation

@hanrw
Copy link
Contributor

@hanrw hanrw commented Dec 18, 2025

Summary

Add a new root-level plugin co.touchlab.kmmbridge.spm that automatically generates Package.swift for multi-module KMP projects.

New Features

  • spmDevBuildAll: Builds all XCFrameworks locally and generates Package.swift with local paths for development
  • kmmBridgePublishAll: Publishes all modules and generates Package.swift with URLs for distribution
  • generatePackageSwift: Generates Package.swift from published metadata

Changes

  • Add KmmBridgeSpmPlugin for root-level SPM management
  • Add KmmBridgeSpmExtension for configuration options
  • Add SpmModuleMetadata for JSON metadata exchange between modules
  • Add writeSpmMetadata task to each module for metadata generation
  • Disable module-level spmDevBuild when root SPM plugin is applied
  • Add comprehensive documentation in docs/SPM_MULTI_MODULE.md

Benefits

  • No manual Package.swift editing required
  • No need for useCustomPackageFile or perModuleVariablesBlock flags
  • Unified workflow for both local development and CI publishing
  • Automatic platform version resolution (takes maximum)
  • Automatic Swift tools version resolution

Add a new root-level plugin `co.touchlab.kmmbridge.spm` that automatically
generates Package.swift for multi-module KMP projects.

## New Features

- **spmDevBuildAll**: Builds all XCFrameworks locally and generates
  Package.swift with local paths for development
- **kmmBridgePublishAll**: Publishes all modules and generates
  Package.swift with URLs for distribution
- **generatePackageSwift**: Generates Package.swift from published metadata

## Changes

- Add `KmmBridgeSpmPlugin` for root-level SPM management
- Add `KmmBridgeSpmExtension` for configuration options
- Add `SpmModuleMetadata` for JSON metadata exchange between modules
- Add `writeSpmMetadata` task to each module for metadata generation
- Disable module-level `spmDevBuild` when root SPM plugin is applied
- Add comprehensive documentation in docs/SPM_MULTI_MODULE.md

## Benefits

- No manual Package.swift editing required
- No need for `useCustomPackageFile` or `perModuleVariablesBlock` flags
- Unified workflow for both local development and CI publishing
- Automatic platform version resolution (takes maximum)
- Automatic Swift tools version resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant