gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r760786 - /gump/trunk/python/gump/core/build/mvn.py
Date Wed, 01 Apr 2009 05:32:20 GMT
Author: bodewig
Date: Wed Apr  1 05:32:19 2009
New Revision: 760786

URL: http://svn.apache.org/viewvc?rev=760786&view=rev
Log:
factor mirror section into a function

Modified:
    gump/trunk/python/gump/core/build/mvn.py

Modified: gump/trunk/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/build/mvn.py?rev=760786&r1=760785&r2=760786&view=diff
==============================================================================
--- gump/trunk/python/gump/core/build/mvn.py (original)
+++ gump/trunk/python/gump/core/build/mvn.py Wed Apr  1 05:32:19 2009
@@ -35,6 +35,15 @@
 # Classes
 ###############################################################################
 
+def write_mirror_entry(props, prefix, mirror_for, port):
+    props.write("""
+    <mirror>
+      <id>gump-%s</id>
+      <name>Gump %s</name>
+      <url>http://localhost:%s/%s</url>
+      <mirrorOf>%s</mirrorOf>
+    </mirror>""" % (mirror_for, mirror_for, port, prefix, mirror_for) )
+
 class Maven2Builder(RunSpecific):
 
     def __init__(self, run):
@@ -233,15 +242,10 @@
                     % (project.getName(), strftime('%Y-%m-%d %H:%M:%S'),
                        localRepositoryDir))
         if not self.run.getEnvironment().noMvnRepoProxy:
-            props.write("""
-  <mirrors>
-    <mirror>
-      <id>Gump</id>
-      <name>Gump</name>
-      <url>http://localhost:%s/maven2</url>
-      <mirrorOf>central</mirrorOf>
-    </mirror>
-  </mirrors>""" % (self.run.getWorkspace().mvnRepoProxyPort) )
+            props.write("<mirrors>")
+            write_mirror_entry(props, 'maven2', 'central', \
+                               self.run.getWorkspace().mvnRepoProxyPort)
+            props.write("</mirrors>")
 
         props.write("</settings>")
 



Mime
View raw message