Clarify and fix sharedDirectory configuration

It wasn't specified how main.sharedDirectory is resolved when it was
given as a relative path. In particular it wasn't clear if the relative
path was resolved against the current working directory of the Java
process or against the $SITE_PATH.

Resolve relative sharedDirectory against $SITE_PATH and document that
and add a test case for the same.

This change required changing the return type of the
Main.sharedDirectory method to Path to make it cleaner. This introduced
some ugliness in the test cases with the asserts as assertThat couldn't
be used on Path instances due to a bug in the Google Truth [1]. When
this gets merged into stable-2.14, we could switch to using the
PathSubject [2] introduced by DavidO as a workaround for this issue.

[1] https://github.com/google/truth/issues/285
[2] https://gerrit.googlesource.com/gerrit/+/master/gerrit-test-util/src/main/java/com/google/gerrit/extensions/common/PathSubject.java

Change-Id: I7787bad4669514e2d27b1db975e62c9e43caea36
5 files changed
tree: 3c31f3adbec193cdba285a8178c9cca4fd67fa0a
  1. lib/
  2. src/
  3. .buckconfig
  4. .gitignore
  5. .mailmap
  6. BUCK