Buck: Strip SNAPSHOT suffix in artifact names only for GERRIT repositories

Maven artifact names on Google bucket replacing SNAPSHOT suffix with
timestamp. 731967591ef98ab3c94691ba9dc0f217630dda76 changed this by
preserving the SNAPSHOT suffix. This broke fetching of gwtorm and
gwtjsonrpc and was reverted by 731967591ef98ab3c94691ba9dc0f217630dda76.

This change fixes this for both worlds: stripping it for GERRIT and
GERRIT_API Maven repositories but preserving it for the rest.

Test plan:

maven_jar() is working as expected for the both worlds:

* gwtorm:gwtorm:1.10-SNAPSHOT-20140310.015132-1 (repo = GERRIT)
* org.eclipse.jgit:org.eclipse.jgit:3.4.0-SNAPSHOT (repo = MAVEN_LOCAL)

Change-Id: I5357abe9ad6a40538c444ad70016c8c6d75d8ff3
This commit is contained in:
David Ostrovsky 2014-04-30 00:48:28 +02:00 committed by David Ostrovsky
parent 12b80e2825
commit 4a3f51a8e0

View File

@ -48,7 +48,7 @@ def maven_jar(
raise NameError('expected id="groupId:artifactId:version"')
group, artifact, version = parts
if 'SNAPSHOT' in version:
if 'SNAPSHOT' in version and repository.startswith(GERRIT):
file_version = version.replace('-SNAPSHOT', '')
version = version.split('-SNAPSHOT')[0] + '-SNAPSHOT'
else: