Skip to content

MOEN-41800: Added no-code SDK file based initialization#93

Merged
msoumya-engg-sdk merged 1 commit intodevelopmentfrom
MOEN-41800_pre-main
Jan 6, 2026
Merged

MOEN-41800: Added no-code SDK file based initialization#93
msoumya-engg-sdk merged 1 commit intodevelopmentfrom
MOEN-41800_pre-main

Conversation

@msoumya-engg-sdk
Copy link
Copy Markdown
Contributor

Jira Ticket

Description

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Item protocol 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.

Comment on lines +46 to +48
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}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@msoumya-engg-sdk msoumya-engg-sdk merged commit 2b03210 into development Jan 6, 2026
11 of 13 checks passed
@msoumya-engg-sdk msoumya-engg-sdk deleted the MOEN-41800_pre-main branch January 6, 2026 08:31
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.

3 participants