tidy up build scripts

- separate out common logic for distribution and non-distribution builds
- move library versions to top-level ext block
- enable sources & javadoc for all jar archives
- move sourceCompatibility & targetCompatibility to gradle.properties
Merge pull request #238 from mojavelinux/build-updates

tidy up build scripts