gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r937756 - in /gump/trunk/python/gump/core: build/mvn.py model/builder.py
Date Sun, 25 Apr 2010 06:27:15 GMT
Author: bodewig
Date: Sun Apr 25 06:27:15 2010
New Revision: 937756

URL: http://svn.apache.org/viewvc?rev=937756&view=rev
Log:
allow separateLocalRepo attribute to provide a directory name so that different projects can
share the same one

Modified:
    gump/trunk/python/gump/core/build/mvn.py
    gump/trunk/python/gump/core/model/builder.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=937756&r1=937755&r2=937756&view=diff
==============================================================================
--- gump/trunk/python/gump/core/build/mvn.py (original)
+++ gump/trunk/python/gump/core/build/mvn.py Sun Apr 25 06:27:15 2010
@@ -127,6 +127,9 @@ def getMavenCommand(project, languageHel
 
     return cmd
 
+def needsSeparateLocalRepository(project):
+    return project.mvn.needsSeparateLocalRepository()
+
 class Maven2Builder(RunSpecific):
 
     def __init__(self, run):
@@ -220,7 +223,7 @@ class Maven2Builder(RunSpecific):
             project.addWarning('Overriding Maven2 settings: [' + settingsFile \
                                    + ']')
 
-        if self.needsSeparateLocalRepository(project):
+        if needsSeparateLocalRepository(project):
             localRepositoryDir = self.locateLocalRepo(project)
         else:
             localRepositoryDir = os.path.abspath(\
@@ -266,10 +269,10 @@ class Maven2Builder(RunSpecific):
         #
         # Where to put the local repository
         #
+        name = project.mvn.getLocalRepositoryName()
+        if not name:
+            name = project.getName() + ".mvnlocalrepo"
         return os.path.abspath(os.path.join(self.run.getWorkspace()\
                                                 .getLocalRepositoryDirectory(),
-                                            project.getName() \
-                                                + ".mvnlocalrepo"))
-
-    def needsSeparateLocalRepository(self, project):
-        return project.mvn.needsSeparateLocalRepository()
+                                            name
+                                            ))

Modified: gump/trunk/python/gump/core/model/builder.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/model/builder.py?rev=937756&r1=937755&r2=937756&view=diff
==============================================================================
--- gump/trunk/python/gump/core/model/builder.py (original)
+++ gump/trunk/python/gump/core/model/builder.py Sun Apr 25 06:27:15 2010
@@ -296,8 +296,8 @@ class Maven2(Builder):
         # Import the goal
         self.goal = self.getDomAttributeValue('goal', 'package')
 
-        self.separateLocalRepo = \
-            self.domAttributeIsTrue('separateLocalRepository')
+        self.local_repo = self.getDomAttributeValue('separateLocalRepository',
+                                                    'False')
 
     def getGoal(self):
         return self.goal
@@ -310,7 +310,14 @@ class Maven2(Builder):
 
     def needsSeparateLocalRepository(self):
         """ Whether a separate local repository will be used for this build """
-        return self.separateLocalRepo
+        return self.local_repo and self.local_repo not in ['False', 'false']
+
+    def getLocalRepositoryName(self):
+        """ Name of the local repository if one has been given """
+        if not self.needsSeparateLocalRepository() \
+                or self.local_repo in ['True', 'true']:
+            return None
+        return self.local_repo
 
 
 # represents an <configure/> element



Mime
View raw message