gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r534831 - /gump/trunk/python/gump/core/build/mvn.py
Date Thu, 03 May 2007 12:51:59 GMT
Author: bodewig
Date: Thu May  3 05:51:58 2007
New Revision: 534831

URL: http://svn.apache.org/viewvc?view=rev&rev=534831
Log:
Don't create properties file

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?view=diff&rev=534831&r1=534830&r2=534831
==============================================================================
--- gump/trunk/python/gump/core/build/mvn.py (original)
+++ gump/trunk/python/gump/core/build/mvn.py Thu May  3 05:51:58 2007
@@ -99,11 +99,6 @@
             if os.path.exists(pomFile):                               
                 project.addDebug('Maven POM in: ' + pomFile) 
                 catFileToFileHolder(project, pomFile, FILE_TYPE_CONFIG) 
-                    
-            projpFile=self.locateMavenProjectPropertiesFile(project) 
-            if os.path.exists(projpFile):                                               

-                project.addDebug('Maven project properties in: ' + projpFile)           
    
-                catFileToFileHolder(project, projpFile, FILE_TYPE_CONFIG)               
           
   
     #
     # Build an Maven command for this project
@@ -156,7 +151,8 @@
         if project.getWorkspace().isVerbose()  or project.isVerbose() or verbose: 
             cmd.addParameter('--exception') 
         
-        cmd.addNamedParameters(getProperties(project))
+        props = getProperties(project)
+        cmd.addNamedParameters(props)
 
         #
         # Suppress downloads
@@ -186,112 +182,6 @@
             properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
         return properties
 
-        # Do this even if not ok
-    def performPreBuild(self, project, languageHelper, stats):
-                   
-        # Maven requires a build.properties to be generated...
-        if project.okToPerformWork():
-            try:
-                propertiesFile=self.generateMavenProperties(project,languageHelper)     
                          
-                project.addDebug('(Gump generated) Maven Properties in: ' + propertiesFile)
-                
-                try:
-                    catFileToFileHolder(project,propertiesFile,
-                        FILE_TYPE_CONFIG,
-                        os.path.basename(propertiesFile))
-                except:
-                    log.error('Display Properties [ ' + propertiesFile + '] Failed', exc_info=1)
  
-               
-            except Exception, details:
-                message='Generate Maven Properties Failed:' + str(details)
-                log.error(message, exc_info=1)
-                project.addError(message)    
-                project.changeState(STATE_FAILED,REASON_PREBUILD_FAILED)
- 
-    # The propertiesFile parameter is primarily for testing.
-    def generateMavenProperties(self,project,languageHelper,propertiesFile=None):
-        """Set properties/overrides for a Maven project"""
-        
-        #:TODO: Does Maven have the idea of system properties?
-        
-        #
-        # Where to put this:
-        #
-        basedir = project.mvn.getBaseDirectory() or project.getBaseDirectory()
-        if not propertiesFile: 
-            propertiesFile=os.path.abspath(os.path.join(basedir,'profiles.xml'))
-            
-        # Ensure containing directory exists, or make it.
-        propsdir=os.path.dirname(propertiesFile)
-        if not os.path.exists(propsdir):
-            project.addInfo('Making directory for Maven properties: ['+propsdir+']')
-            os.makedirs(propsdir)
-        
-        if os.path.exists(propertiesFile):
-            project.addWarning('Overriding Maven properties: ['+propertiesFile+']')
-    
-        
-        props=open(propertiesFile,'w')
-        
-        props.write('<?xml version="1.0"?>\n')
-        props.write(("""<!-- 
-# DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT

-#
-# File Automatically Generated by Gump, see http://gump.apache.org/
-#
-# Generated For : %s
-# Generated At  : %s
-#
-#
-# DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT  DO NOT EDIT
-# 
--->\n""")	%	(project.getName(), time.strftime('%Y-%m-%d %H:%M:%S')) )
-        props.write("<profiles>\n")
-        props.write("  <profile>\n")
-        props.write("   <id>Gump</id>\n")
-        props.write("   <activation><activeByDefault/></activation>\n")
-        (classpath,bootclasspath)=languageHelper.getClasspathObjects(project)
-        
-        # :TODO: write...
-        props.write("   <properties>\n")
-        for annotatedPath in classpath.getPathParts()+bootclasspath.getPathParts():
-            if isinstance(annotatedPath,gump.core.language.path.AnnotatedPath):
-                # Sort of punting here
-                props.write("<!-- Contributor: %s -->\n" % \
-                    ( annotatedPath.getContributor() ))
-                props.write("     <maven.jar.%s>%s</maven.jar.%s>\n" % \
-                             (annotatedPath.getId(), \
-                              annotatedPath.getPath(), \
-                              annotatedPath.getId()))
-        #
-        # Output basic properties
-        #
-        for property in project.getWorkspace().getProperties()+project.getMvn().getProperties():
-            # build.sysclasspath makes Maven sick.
-            if not 'build.sysclasspath' == property.name:
-                props.write(('<%s>%s</%s>\n') % \
-                   (property.name,property.value,property.name))            
-        
-        #
-        # Output classpath properties
-        #
-        props.write("""<!--
-# 
-# M A V E N  J A R  O V E R R I D E
-# 
--->
-<maven.jar.override>on</maven.jar.override>
-""")
-        
-        props.write("   </properties>\n")
-        props.write("</profile></profiles>\n")
-        return propertiesFile
-      
-    def locateMavenProjectPropertiesFile(self,project):
-        """Return Maven project properties file location""" 
-        basedir = project.mvn.getBaseDirectory() or project.getBaseDirectory()
-        return os.path.abspath(os.path.join(basedir,'project.properties'))
-        
     def locateMavenProjectFile(self,project):
         """Return Maven project file location"""      
         basedir = project.mvn.getBaseDirectory() or project.getBaseDirectory()



Mime
View raw message