Buck: Decouple plugin-api installation from deployment

Currently the same pom_fake.xml controls both installing the plugin-api
in local Maven repository (typical use case for a contributor) and
deploying it on Google bucket (typical use case for a maintainer). To fit
the both use cases that file contains stuff needed for uploading to Google
bucket only: 'gs-maven-wagon' artifact and the repository to fetch it from.

Because the "best" build tool in the world randomly and unreproducible
fails to fetch that artifact [1], frustrating the potential contributors,
for reasons that nobody knows and understands, separate these use cases
from each other, and strip the stuff from pom_fake.xml needed for deployment
of plugin-api. The cost is code duplication. The advantage of doing it:

  buck build api_install

just works. Always.

[1] https://gist.github.com/mulby/092fee5f5962aafbbb25#file-gerrit-build-error-txt

Change-Id: I842335907ef8721f4126bcd90e395f7748aefc74
This commit is contained in:
David Ostrovsky 2014-01-18 09:58:41 +01:00 committed by David Pursehouse
parent f9fc92b9d4
commit dcc48b078f
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>Gerrit-Code-Review-Maven</artifactId>
<version>1</version>
</project>

View File

@ -20,6 +20,9 @@ from os import path
from sys import stderr
from tools.util import check_output
def mvn(action):
return ['mvn', '--file', path.join(self, 'fake_pom_%s.xml' % action)]
opts = OptionParser()
opts.add_option('--repository', help='maven repository id')
opts.add_option('--url', help='maven repository url')
@ -39,12 +42,11 @@ common = [
]
self = path.dirname(path.abspath(__file__))
mvn = ['mvn', '--file', path.join(self, 'fake_pom.xml')]
if 'install' == args.a:
cmd = mvn + ['install:install-file'] + common
cmd = mvn(args.a) + ['install:install-file'] + common
elif 'deploy' == args.a:
cmd = mvn + [
cmd = mvn(args.a) + [
'deploy:deploy-file',
'-DrepositoryId=%s' % args.repository,
'-Durl=%s' % args.url,