gerrit/tools/maven/package.defs
David Ostrovsky 358a4582fd 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
2014-05-20 06:41:08 +00:00

72 lines
2.0 KiB
Plaintext

# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def maven_package(
version,
repository = None,
url = None,
jar = {},
src = {},
doc = {},
war = {}):
cmd = ['$(exe //tools/maven:mvn)', '-v', version, '-o', '$OUT']
api_cmd = []
api_deps = []
for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc)]:
for a,t in d.iteritems():
api_cmd.append('-s %s:%s:$(location %s)' % (a,type,t))
api_deps.append(t)
genrule(
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 = 'api_deploy',
cmd = ' '.join(cmd + api_cmd + [
'-a', 'deploy',
'--repository', repository,
'--url', url]),
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',
)