Gradle conversion
Conversion to Gradle build tool, replacing Moxie.
As this is a big pull request, it is recommended that this should be accepted into a branch so that it doesn't disrupt work on the master branch. And a branch allows other people to safely experiment with.
In this Gradle conversion, the current structure of src/main/java of the Gitblit source code remains intact, and the whole Gitblit folder is just one (big) Gradle project. Future work may re-organize it into Gradle sub-projects (similar to the Maven modules).
This commit uses Gradle to replicate most (not all) of the build targets of the old build.xml Ant script which made use a lot of functionalities of the Moxie toolkit. The targets being left out are the ones to do with Maven and Bintray uploads, which can be done at a later time.
Even when Moxie is removed to be the build tool for the Gitblit project, some of its functionalities are still used where required, e.g. where the 'releases.moxie' file need be parsed to produce the 'releasenotes.html' and 'releases.html' files for the site documentation. Moxie is needed here because the 'releases.moxie' file format is specific to Moxie and requires Moxie code to parse it. In these scenarios, Moxie is used as a dependency library to some of the custom Gradle task classes residing in the buildSrc folder.
To build all of Gitblit software artefacts, here's the Gradle command:
gradlew buildAll
And the build artefacts would be produced in build/distributions folder, which would contain the Gitblit GO files, the Giblit WAR, Gitblit Manager, Federation Client, Gitblit API Library, and the site documentation.
Further Gradle info are in the commit's message.
An added bonus is that the Gitblit software now can be run by Java 7 and up, to Java 12 version, due to modifications made to various 'Launcher' classes in the dynamic loading of library jars at runtime, which used to fail to work when running Gitblit 1.8.0 with Java 9+.
The test classes in src/test/java have been split into many separate folders for ease of test execution and failure investigation:
src/test: the original test folder, for pure unit tests.
src/repoTest: for tests requiring some existing repos but no need for a gitblit server.
src/serverTest: for tests requiring the gitbit server to be running. The current GitBlitSuite class goes here, plus other test classes requiring a gitblit server instance.
src/uiTest: for tests of the gitblit web UI.
src/extServiceTest: for tests requiring some external service to be available e.g. Redis.
As a result of the above re-org, tests in the original src/test folder can take part in an automated build process by a CI server, while other test folders are considered 'integration tests' and can be executed in a manual way, like in Gradle command:
gradlew serverTest
would run the tests in src/serverTest/java folder via the GitBlitSuite test suite class, while the command:
gradlew test
would just run the 'pure' unit tests in src/test/java folder. Similarly for other test folders.
Gradle can start a Gitblit server instance with the runGO task:
gradlew runGO