Move gerrit.war from api_{install,deploy} to war_{install,deploy}

I22c8d3339 added unconditionally installation of gerrit.war to API install
process.  Because it depends on '//:release' target all core plugins,
documentation and optimized permutations of all supported GWT client
agents must be built to update a new version of plugin API.

In some cases it cannot be built at all, i.e. if Gerrit tree was cloned
non-recursively, and core plugins are not available.

Very repetitive tasks in development process like building new version of
plugin API that other plugins depend on should be very easy and fast doable.

Decouple installation and deployment of gerrit.war in its own targets:

  $ buck build war_{install,deploy}

Change-Id: I7fce3b126621580dde43104aa811d704cf6e8997
This commit is contained in:
David Ostrovsky 2014-05-13 23:55:04 +02:00 committed by David Ostrovsky
parent d15e0c7ad6
commit 358a4582fd
4 changed files with 62 additions and 17 deletions

View File

@ -1,7 +1,10 @@
[alias]
api = //:api
api_deploy = //tools/maven:deploy
api_install = //tools/maven:install
api_deploy = //tools/maven:api_deploy
api_install = //tools/maven:api_install
war_deploy = //tools/maven:war_deploy
war_install = //tools/maven:war_install
chrome = //:chrome
docs = //Documentation:html
gerrit = //:gerrit
release = //:release

View File

@ -136,18 +136,30 @@ project directories in `buck-out/gen`, here as example for plugin API:
buck-out/gen/gerrit-plugin-api/plugin-api-javadoc.jar
----
Install {extension,plugin,gwt}-api and gerrit.war to the local maven repository:
Install {extension,plugin,gwt}-api to the local maven repository:
----
buck build api_install
----
Deploy {extension,plugin,gwt}-api and gerrit.war to the remote maven repository:
Deploy {extension,plugin,gwt}-api to the remote maven repository:
----
buck build api_deploy
----
Install gerrit.war to the local maven repository:
----
buck build war_install
----
Deploy gerrit.war to the remote maven repository:
----
buck build war_deploy
----
The type of the repo is induced from the Gerrit version name, i.e.
* `2.9-SNAPSHOT`: snapshot repo

View File

@ -156,6 +156,12 @@ configuration needed for deployment]
* The WAR file to upload is `buck-out/gen/release.war`
* Upload WAR to the storage bucket via `https://cloud.google.com/console` (manual via web browser)
* Push the WAR file to the Maven storage bucket:
+
----
buck build war_deploy
----
[[push-stable]]

View File

@ -21,27 +21,51 @@ def maven_package(
doc = {},
war = {}):
cmd = ['$(exe //tools/maven:mvn)', '-v', version, '-o', '$OUT']
dep = []
for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc), ('war', war)]:
api_cmd = []
api_deps = []
for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc)]:
for a,t in d.iteritems():
cmd.append('-s %s:%s:$(location %s)' % (a,type,t))
dep.append(t)
api_cmd.append('-s %s:%s:$(location %s)' % (a,type,t))
api_deps.append(t)
genrule(
name = 'install',
cmd = ' '.join(cmd + ['-a', 'install']),
deps = dep + ['//tools/maven:mvn'],
out = 'install.info',
name = 'api_install',
cmd = ' '.join(cmd + api_cmd + ['-a', 'install']),
deps = api_deps + ['//tools/maven:mvn'],
out = 'api_install.info',
)
if repository and url:
genrule(
name = 'deploy',
cmd = ' '.join(cmd + [
name = 'api_deploy',
cmd = ' '.join(cmd + api_cmd + [
'-a', 'deploy',
'--repository', repository,
'--url', url]),
deps = dep + ['//tools/maven:mvn'],
out = 'deploy.info',
deps = api_deps + ['//tools/maven:mvn'],
out = 'api_deploy.info',
)
war_cmd = []
war_deps = []
for a,t in war.iteritems():
war_cmd.append('-s %s:war:$(location %s)' % (a,t))
war_deps.append(t)
genrule(
name = 'war_install',
cmd = ' '.join(cmd + war_cmd + ['-a', 'install']),
deps = war_deps + ['//tools/maven:mvn'],
out = 'war_install.info',
)
if repository and url:
genrule(
name = 'war_deploy',
cmd = ' '.join(cmd + war_cmd + [
'-a', 'deploy',
'--repository', repository,
'--url', url]),
deps = war_deps + ['//tools/maven:mvn'],
out = 'war_deploy.info',
)