gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1658879 - /gump/live/python/gump/core/build/gradle.py
Date Wed, 11 Feb 2015 05:38:15 GMT
Author: bodewig
Date: Wed Feb 11 05:38:14 2015
New Revision: 1658879

URL: http://svn.apache.org/r1658879
Log:
the original repository URI contains the prefix (plus trailing slash)

Modified:
    gump/live/python/gump/core/build/gradle.py

Modified: gump/live/python/gump/core/build/gradle.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/gradle.py?rev=1658879&r1=1658878&r2=1658879&view=diff
==============================================================================
--- gump/live/python/gump/core/build/gradle.py (original)
+++ gump/live/python/gump/core/build/gradle.py Wed Feb 11 05:38:14 2015
@@ -38,8 +38,8 @@ from time import strftime
 ###############################################################################
 
 def record_proxy(init_file, port, prefix, uri):
-    init_file.write("'%s': 'http://localhost:%s:%s',\n" % (uri.replace('\\', ''),
-                                                             port, prefix))
+    init_file.write("'%s%s': 'http://localhost:%s:%s',\n"\
+                    % (uri.replace('\\', ''), prefix, port, prefix))
 
 def locateGradleProjectFile(project):
     """Return Gradle project file location"""
@@ -272,7 +272,7 @@ class MavenRepoProxyPlugin implements Pl
             project.repositories {
                 all { ArtifactRepository repo ->
                     if (repo instanceof MavenArtifactRepository) {
-                        def newUrl = REPOS_MAP.get(repo.url.toString()) ?: REPOS_MAP.get(swapTLS(repo.url))
+                        def newUrl = REPOS_MAP.get(stripTrailingSlash(repo.url)) ?: REPOS_MAP.get(swapTLS(repo.url))
                         if (newUrl) {
                             repo.url = newUrl
                         }
@@ -288,9 +288,14 @@ class MavenRepoProxyPlugin implements Pl
 
     def swapScheme(uri, fromScheme, toScheme) {
         uri.scheme == fromScheme
-            ? new URI(toScheme, uri.schemeSpecificPart, uri.fragment).toString()
+            ? stripTrailingSlash(new URI(toScheme, uri.schemeSpecificPart, uri.fragment))
             : null;
     }
+
+    def stripTrailingSlash(uri) {
+        def s = uri.toString()
+        s.endsWith('/') ? s.substring(0, s.length() - 1) : s
+    }
 }
 """)
 



Mime
View raw message