Conversation
…plates Problem: - The CouchbaseLiteSwift_Private module maps are hand-maintained per edition in two repos, so the editions can drift apart if we forget to update both, and the CE repo's CI cannot verify the EE copy. Solution: - Generate both editions' module maps in the CE repo from header list templates, following the Objective-C/Exports pattern. Changes: - Add Swift/ModuleMap/ header list templates and generate_private_modulemap.sh; the EE module map is the CE header list plus the EE additions. - Point CBL_Swift / CBL_EE_Swift xcconfigs at the generated module maps; the EE repo no longer hosts a module map. - Verify the generated files are up to date in pull_request_build_test.sh. - Enable MemberImportVisibility so a Swift file using a type it does not import itself fails to build (catches missing private module imports). - Strip the private module map from the framework in Release builds only.
There was a problem hiding this comment.
Pull request overview
This PR reduces drift between Community Edition (CE) and Enterprise Edition (EE) Swift private module maps by generating both from header-list templates in the CE repo, and wiring builds/CI to use and validate the generated outputs.
Changes:
- Add Swift/ModuleMap header-list templates plus a generator script, and commit generated CE/EE private module maps.
- Update Swift (CE/EE) build settings to reference the generated module maps and enable MemberImportVisibility diagnostics.
- Update CI and packaging scripts and refresh repo guidance/docs for the new workflow.
Reviewed changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| xcconfigs/Project.xcconfig | Enables SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY to catch missing imports. |
| xcconfigs/CBL_Swift.xcconfig | Points CE Swift target at generated private module map. |
| xcconfigs/CBL_EE_Swift.xcconfig | Points EE Swift target at generated EE private module map (no longer in EE repo). |
| Swift/ModuleMap/generate_private_modulemap.sh | Adds generator/check script to produce CE+EE module maps from templates. |
| Swift/ModuleMap/CouchbaseLiteSwift.private.txt | Adds CE header list template consumed by the generator. |
| Swift/ModuleMap/CouchbaseLiteSwift-EE.private.txt | Adds EE-only header list template consumed by the generator. |
| Swift/ModuleMap/Generated/CouchbaseLiteSwift.private.modulemap | Marks CE module map as generated and updates header. |
| Swift/ModuleMap/Generated/CouchbaseLiteSwift-EE.private.modulemap | Adds generated EE private module map output. |
| Swift/ModuleMap/Generated/CouchbaseLiteSwift-EE.private.txt | Adds an extra EE header list under Generated/ (currently duplicates the template). |
| Scripts/pull_request_build_test.sh | Adds a CI check to ensure generated module maps are up to date. |
| Scripts/remove_private_module.sh | Strips private module only for Release* builds to preserve Xcode indexing for dev builds. |
| CouchbaseLite.xcodeproj/project.pbxproj | Adds ModuleMap groups/files to the Xcode project. |
| AGENTS.md | Updates contributor guidance for the new module map generation workflow. |
Suppressed comments (1)
CouchbaseLite.xcodeproj/project.pbxproj:3458
- The new
ModuleMap/Generatedgroup contains the CE generated module map but also includesCouchbaseLiteSwift-EE.private.txt(a header-list template), while the generated EE module map file isn’t listed. This layout makes it easy to edit the wrong file and defeats the “generated output vs template” separation.
isa = PBXGroup;
children = (
40F52B1D3026ED0F009C5F9E /* CouchbaseLiteSwift.private.modulemap */,
40CC4B78302BE6EF0002386D /* CouchbaseLiteSwift-EE.private.txt */,
);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Add check_modulemaps.yml workflow running generate_private_modulemap.sh --check on PRs - Remove the check from pull_request_build_test.sh
jianminzhao
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Solution
Changes
Companion PR : https://github.com/couchbaselabs/couchbase-lite-ios-ee/pull/349