gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1658413 - in /gump/live/python/gump/core/build: gradle.py mvn.py
Date Mon, 09 Feb 2015 14:43:35 GMT
Author: bodewig
Date: Mon Feb  9 14:43:35 2015
New Revision: 1658413

URL: http://svn.apache.org/r1658413
Log:
make gradle use Gump's local repository

Modified:
    gump/live/python/gump/core/build/gradle.py
    gump/live/python/gump/core/build/mvn.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=1658413&r1=1658412&r2=1658413&view=diff
==============================================================================
--- gump/live/python/gump/core/build/gradle.py (original)
+++ gump/live/python/gump/core/build/gradle.py Mon Feb  9 14:43:35 2015
@@ -20,6 +20,7 @@ import os.path
 
 from gump import log
 #from gump.actor.mvnrepoproxy.proxycontrol import PROXY_CONFIG
+from gump.core.build.mvn import local_mvn_repo
 from gump.core.model.workspace import CommandWorkItem, \
     REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, REASON_PREBUILD_FAILED, \
     STATE_FAILED, STATE_SUCCESS, WORK_TYPE_BUILD
@@ -73,6 +74,9 @@ def getSysProperties(project):
                                                  property.value, '=')
     return properties
 
+def needsSeparateLocalRepository(project):
+    return project.gradle.needsSeparateLocalRepository()
+
 def getGradleCommand(project, executable='gradle'):
     """ Build a Gradle command for this project """
     gradle = project.gradle
@@ -107,6 +111,15 @@ def getGradleCommand(project, executable
     sysprops = getSysProperties(project)
     cmd.addNamedParameters(sysprops)
 
+    if needsSeparateLocalRepository(project):
+        localRepositoryDir = local_mvn_repo(project, gradle)
+    else:
+        localRepositoryDir = os.path.abspath(\
+                os.path.join(project.getWorkspace()
+                             .getLocalRepositoryDirectory(),
+                             "shared"))
+    cmd.addParameter("-Dmaven.repo.path=" + localRepositoryDir)
+
     #cmd.addParameter('--settings')
     #cmd.addParameter(locateGradleSettings(project))
 
@@ -117,9 +130,6 @@ def getGradleCommand(project, executable
 
     return cmd
 
-def needsSeparateLocalRepository(project):
-    return project.gradle.needsSeparateLocalRepository()
-
 class GradleBuilder(RunSpecific):
 
     def __init__(self, run):

Modified: gump/live/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/mvn.py?rev=1658413&r1=1658412&r2=1658413&view=diff
==============================================================================
--- gump/live/python/gump/core/build/mvn.py (original)
+++ gump/live/python/gump/core/build/mvn.py Mon Feb  9 14:43:35 2015
@@ -117,6 +117,17 @@ def getMavenCommand(project, executable
 def needsSeparateLocalRepository(project):
     return project.mvn.needsSeparateLocalRepository()
 
+def local_mvn_repo(project, build_element):
+    #
+    # Where to put the local repository
+    #
+    name = build_element.getLocalRepositoryName()
+    if not name:
+        name = project.getName() + ".mvnlocalrepo"
+    return os.path.abspath(os.path.join(project.getWorkspace()\
+                                        .getLocalRepositoryDirectory(),
+                                        name))
+
 class MavenBuilder(RunSpecific):
 
     def __init__(self, run):



Mime
View raw message