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
This commit is contained in:
Shawn Pearce 2013-07-29 14:05:26 -07:00
parent 1e6c3639f7
commit 3765bb8add
3 changed files with 16 additions and 21 deletions

4
BUCK
View File

@ -20,8 +20,8 @@ genrule(
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(

View File

@ -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'

View File

@ -78,31 +78,22 @@ def gerrit_war(name, ui = 'ui_optdbg', context = []):
] + 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
)