Procedure to customize Docker swarm

Hi, I plan to make some custom changes to Docker swarm. I came to know that I have to rebuild docker-ce using moby for this purpose. I couldn’t find any documentation or reference of any sorts regarding the usage of moby in this context. A documentation on the steps to be followed in order to, for instance, make a minor modification in Docker, build and test it would be very helpful. The changes I plan to make are only limited to the logical functioning of the swarm and intend to test it the usual way on Linux. As I’m not targeting to build a customized container system for any specific OS or platform, I guess, the process shouldn’t be too complex. At this point, I’m clueless where to begin making my changes and what all components will I need in order to build and test it properly. Any help is appreciated.
Thanks.