diff options
author | David Ostrovsky <david@ostrovsky.org> | 2014-04-30 00:48:28 +0200 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2014-06-30 22:38:10 +0900 |
commit | a3bed28ef7c31647900cd716f5fcde184d55d1d5 (patch) | |
tree | b3255cebcf40bfcc28e64d29deed0920074756cb | |
parent | 9324e9af125d4fb7df402e22945ae4e917dac0d4 (diff) |
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
-rw-r--r-- | lib/maven.defs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/maven.defs b/lib/maven.defs index a696580e72..9578c2b210 100644 --- a/lib/maven.defs +++ b/lib/maven.defs @@ -47,11 +47,17 @@ def maven_jar( raise NameError('expected id="groupId:artifactId:version"') group, artifact, version = parts - jar = path.join(name, artifact.lower() + '-' + version) + if 'SNAPSHOT' in version and repository.startswith(GERRIT): + file_version = version.replace('-SNAPSHOT', '') + version = version.split('-SNAPSHOT')[0] + '-SNAPSHOT' + else: + file_version = version + + jar = path.join(name, artifact.lower() + '-' + file_version) url = '/'.join([ repository, group.replace('.', '/'), artifact, version, - artifact + '-' + version]) + artifact + '-' + file_version]) binjar = jar + '.jar' binurl = url + '.jar' |