Code:
gradlew distApp distModules distAppZip
That'll create a runnable application directory, add any local modules you've got set up to it, then zip the whole thing. The resulting zip will be at Terasology\facades\PC\build\distributions\Terasology.zip
That won't let your friends get into the code to change things (compiling makes a binary, not source) but they can play with your custom version. To share the code ideally push to your fork on GitHub and tell your friends to download from there. Or just zip your entire Terasology directory and give them that. But GitHub is vastly better.