MOEN-41800: Added no-code SDK file based initialization#93
MOEN-41800: Added no-code SDK file based initialization#93msoumya-engg-sdk merged 1 commit intodevelopmentfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements no-code SDK file-based initialization by introducing the MoEngageModule.Item protocol conformance, enabling automatic plugin discovery and initialization without explicit code. The implementation refactors the initialization architecture from imperative to event-driven, adds automated version constant generation, and improves build script organization.
- Implements
MoEngageModule.Itemprotocol for event-driven initialization - Adds automated version constant generation for both SPM and CocoaPods builds
- Refactors delegate setup from imperative calls to event-driven callbacks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
Utilities/post_build.rb |
Adds version constant generation to the SPM post-build script |
Sources/MoEngagePluginBase/MoEngagePluginConstants+Version.swift |
Generated file containing version constant from package.json |
Sources/MoEngagePluginBase/MoEngagePlugin.swift |
Refactors initialization by removing commonSetUp calls and implementing MoEngageModule.Item protocol for event-driven delegate setup |
MoEngagePluginBase.podspec |
Adds prepare_command to generate version constant during CocoaPods installation |
Examples/Podfile |
Refactors dev pod declarations into reusable moengage_dev_pods method |
CHANGELOG.md |
Adds release entry for the no-code initialization feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "// Generated file, do not edit\n" > #{version_file} | ||
| echo "import Foundation\n" >> #{version_file} | ||
| echo "extension MoEngagePluginConstants {\n static let version = \\"#{s.version}\\"\n}" >> #{version_file} |
There was a problem hiding this comment.
[nitpick] The version file generation in post_build.rb (lines 59-66) uses a different format than the podspec's prepare_command (lines 46-48). The podspec uses echo with explicit \n newlines, while post_build.rb uses a heredoc. Consider using the same approach in both places for consistency. The heredoc approach in post_build.rb is cleaner and more readable, so consider updating the podspec to match this style.
| echo "// Generated file, do not edit\n" > #{version_file} | |
| echo "import Foundation\n" >> #{version_file} | |
| echo "extension MoEngagePluginConstants {\n static let version = \\"#{s.version}\\"\n}" >> #{version_file} | |
| cat <<EOF > #{version_file} | |
| // Generated file, do not edit | |
| import Foundation | |
| extension MoEngagePluginConstants { | |
| static let version = "#{s.version}" | |
| } | |
| EOF |
Jira Ticket
Description