Cleanup maven_deploy, maven_install build rules

Use GERRIT_VERSION rather than GERRIT_VER.  VER is not a commonly used
term to name the version string of a software product; VERSION is.

Make the maven_deploy and maven_install rules a little more typical
by passing in the target name separate from the action.

Change-Id: I13a5d94cf5b078cfcb91c69177cadfc2953db33e
diff --git a/BUCK b/BUCK
index 9a2a12e..c878aba 100644
--- a/BUCK
+++ b/BUCK
@@ -20,8 +20,8 @@
   out = '__fake.api__',
 )
 
-maven_install(deps = API_DEPS)
-maven_deploy(deps = API_DEPS)
+maven_install(name = 'api_install', deps = API_DEPS)
+maven_deploy(name = 'api_deploy', deps = API_DEPS)
 
 java_binary(name = 'extension-api', deps = [':extension-lib'])
 java_library(
diff --git a/VERSION b/VERSION
index 359b6d9..23c7033 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1,5 @@
-GERRIT_VER = '2.8-SNAPSHOT'
+# Maven style API version (e.g. '2.x-SNAPSHOT').
+# Used by :api_install and :api_deploy targets
+# when talking to the destination repository.
+#
+GERRIT_VERSION = '2.8-SNAPSHOT'
diff --git a/tools/build.defs b/tools/build.defs
index f25eb91..58bc862 100644
--- a/tools/build.defs
+++ b/tools/build.defs
@@ -78,31 +78,22 @@
     ] + context,
   )
 
-def maven_deploy(
-    deps
-    ):
-  _maven_util('deploy', deps)
+def maven_deploy(name, deps):
+  _maven_util(name, 'deploy', deps)
 
-def maven_install(
-    deps
-    ):
-  _maven_util(
-    name = 'install',
-    deps = deps)
+def maven_install(name, deps):
+  _maven_util(name, 'install', deps)
 
-def _maven_util(
-    name,
-    deps
-    ):
+def _maven_util(name, action, deps):
   cmd = [
     '$(exe //tools:maven_deploy)',
-    '-a', name,
-    '-v', GERRIT_VER,
+    '-a', action,
+    '-v', GERRIT_VERSION,
     '-d', '"$DEPS"'
   ]
   genrule(
-    name = 'api_%s' % name,
+    name = name,
     cmd = ' '.join(cmd),
     deps = deps + ['//tools:maven_deploy'],
-    out = '__fake.api_%s__' % name
+    out = '__fake.%s__' % name
   )