Conversation
navedjuwale-creator
left a comment
There was a problem hiding this comment.
Review for Pull Request #17: Add build scripts for Sui Unity SDK supporting multiple platforms
Hi @navedjuwale-creator! Thank you for contributing build automation scripts for the Sui Unity SDK. Supporting multiple platforms is a great step toward making the SDK more developer-friendly. Below are my observations and suggestions based on the files you've added.
Overall Impressions
The PR adds:
· Assets/Editor/BuildScript.cs – likely a Unity Editor script for building.
· build.bat and build.sh – platform-specific batch/shell scripts.
· BUILD_SYSTEM.md – documentation for the build system.
This structure is clean and separates the Unity Editor logic from command-line entry points. Documentation is always appreciated. However, I have a few questions and recommendations to ensure the scripts are robust and maintainable.
Specific File Reviews
- Assets/Editor/BuildScript.cs
(Note: I only have a partial view of this file from the commit history; a full review would require seeing the entire code.)
· Purpose: It likely contains methods for building the SDK for different platforms (e.g., standalone, mobile, WebGL).
· Suggestions:
· Use BuildPipeline.BuildPlayer with appropriate BuildTarget and BuildOptions.
· Consider making platform-specific build settings configurable via ScriptableObjects or command-line arguments.
· Add error handling and logging (e.g., Debug.LogError, EditorUtility.DisplayDialog).
· If the script is intended for CI/CD, ensure it can be called from the command line with -executeMethod.
· Check for platform-specific preprocessor directives (e.g., #if UNITY_IOS) if any code differs per platform.
· Verify that all required scenes are included in the build.
- build.bat and build.sh
· These are likely wrappers to invoke Unity in batch mode with the appropriate method.
· Checklist:
· Do they set the correct Unity path? Hardcoding may break on different machines; consider using environment variables or relative paths.
· Are they passing necessary arguments (e.g., -projectPath, -buildTarget, -logFile)?
· Do they handle exit codes to indicate success/failure in CI?
· Are both scripts tested on Windows and Unix-like environments?
· It might be helpful to add a build.ps1 for PowerShell users.
- BUILD_SYSTEM.md
· This is a great addition! Please ensure it covers:
· Prerequisites (Unity version, SDK setup).
· How to run the build scripts (command-line examples).
· How to customize builds (e.g., changing target platform, output path).
· Troubleshooting common issues.
· If the build script supports CI/CD integration, mention that.
General Suggestions
· Modularity: Consider splitting BuildScript.cs into smaller files (e.g., AndroidBuild.cs, iOSBuild.cs) if the logic becomes complex.
· Configuration: Allow users to specify build settings (e.g., development build, scripting backend) via command-line arguments or a config file.
· Testing: Mention in the documentation how to test the built SDK (e.g., importing into a sample Unity project).
· Cross-platform consistency: Ensure that the same build steps produce consistent results across Windows, macOS, and Linux (if supported).
Questions for the Author
- Which platforms are supported by these scripts? (e.g., Android, iOS, WebGL, Windows, macOS)
- Have you tested the builds on all intended platforms? If so, what were the results?
- Does the build script automatically handle platform-specific dependencies (like the Sui Rust SDK for mobile)?
- Is there any way to override default build parameters without modifying the script?
- Could you add a simple example of calling the build method from the command line in the BUILD_SYSTEM.md?
Next Steps
I recommend addressing the points above, especially ensuring the scripts are well-documented and flexible. Once these are clarified/updated, I’d be happy to take another look. This is a solid foundation for automating Sui Unity SDK builds! 🚀
Note: Since I don’t have the full content of BuildScript.cs, my feedback is somewhat general. If you can share the complete code, I can provide more specific comments.
|
Thank you for submitting this PR to add build scripts for the Sui Unity SDK with multi-platform support. This is a valuable addition that will help developers automate their builds and streamline integration. I’ve taken a look at the changes and have some feedback and questions to help refine the implementation. Overall Impressions The PR includes: · Assets/Editor/BuildScript.cs – likely the Unity Editor build logic. The structure is clean, and separating the Editor script from platform-specific wrappers is a good approach. Below are some suggestions to enhance robustness and usability. Specific Feedback
· Functionality: It’s great that you’ve placed this in an Editor folder to avoid runtime inclusion.
· Purpose: These wrappers are helpful for developers who want to trigger builds from the command line.
· Documentation: Thank you for including this! To make it even more helpful, please consider adding: Questions for You
Next Steps Please address the points above and update the PR accordingly. Once you’ve made the changes, I’d be happy to review again. This is a solid foundation, and with a few tweaks, it will greatly improve the developer experience for Sui Unity SDK users. Thanks again for your contribution! 🚀 Note: If you can share the full content of BuildScript.cs, I can provide more targeted feedback on the implementation details. |
No description provided.