Buck: Allow to co-exist in tree and standalone plugins

To allow standalone plugins to be built with Bucklets project we need
to be able to include the //bucklets/gerrit_plugin.bucklet from both
in tree and standalone build.  To achieve this create a dummy
bucklets/gerrit_plugin.bucklet file in Gerrit tree, as it doesn't suppose
to have any effects in tree build.

Change-Id: I885199a66cc71a756176f7edaca5f2cf0509e827
Clarify code organization of static methods and visibility

Change-Id: Ia4eb8f949857a8d21965025aa1f5bab26eaf9920
Add ChangeMessagesUtil to assist with notedb migration

Like ApprovalsUtil, we added an abstraction layer to assist in the
migration to notedb. This utility class helps to write to either the
notedb or the reviewdb depending on the state of the NotesMigration
instance. Additionally, in this change, I modified all callers of
ChangeMessageAccess (which uses the ReviewDb) to instead use
ChangeMessagesUtil.

Change-Id: Id007ed8e01bd1318f70d804124e1f482a77234fd
Remove unused imports of JarFile

Change-Id: I7085fba92ca1a24d101484d2f0eee6b229f682e0
Fix root path resolution for updated Buck

Since the last Buck upgraded this morning with [1]
the root path resolution is broken.

This is due to the different expansion of the __file__
macro into a deeper structure, including the python
relative path name inside a PEX directory structure.

Example:
gerrit/buck-out/bin/tools/maven/mvn.pex/gerrit-extension-api/pom.xml

In order to go back to the root package structure
and locate the pom.xml file correctly, we need now
to go back until the .buckconfig file is found
(instead of going back exactly 3 times as it was before).

P.S. Without this change the targets api_install
     and war_install are broken on master.

Change-Id: I1a99606ad304c245b21ba501f15c473142a89fc2
Merge "Buck: Allow to co-exist in tree and standalone plugins"
Return false from MergeUtil.canMerge on LargeObjectException

JGit's merge code depends on ObjectLoader.getCachedBytes(), which may
throw LargeObjectException, in which case it can't attempt a content
merge. For non-content merges (no difference from one parent), we
should not hit this case.

Change-Id: I8c4c42d8cd2234e6d3b8e38d9c08b8b89e82e37b
Update test to fix test of ChangeMessage migration to notedb

Added two helper methods to ChangeMessagesIT to change the
granularity of time to fix a problem with the ties in
timestamps for change messages. Additionally added necessary
dependency in BUCK file.

Change-Id: I5a22529bbb62450c98b2c7172a59abbe3ab7e32c