You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by Stefan Bodewig <bo...@apache.org> on 2004/12/14 11:10:25 UTC

Re: svn commit: r111800 - /gump/trunk/python/gump/core/model/project.py

This change looks far bigger than it actually was because of line-end
tranformations.  I vaguely recall there is a property we should add to
the auto-props so that all *.py files are assumed to have platform
specific line-feeds by SVN, but I've lost the details right now.

Stefan

The real change was:

Index: python/gump/core/model/project.py
===================================================================
--- python/gump/core/model/project.py   (revision 111532)
+++ python/gump/core/model/project.py   (working copy)
@@ -82,6 +82,7 @@
        self.script=None
         self.configure = None
         self.make = None
+        self.builder = []
 
        self.works=[]
        self.mkdirs=[]
@@ -364,6 +365,7 @@
         # Import any <ant part [if not packaged]
         if self.hasDomChild('ant') and not packaged:
             self.ant = Ant(self.getDomChild('ant'),self)
+            self.builder.append(self.ant)
             
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.ant, self)
@@ -371,6 +373,7 @@
         # Import any <nant part [if not packaged]
         if self.hasDomChild('nant') and not packaged:
             self.nant = NAnt(self.getDomChild('nant'),self)
+            self.builder.append(self.nant)
             
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.nant, self)
@@ -378,6 +381,7 @@
         # Import any <maven part [if not packaged]
         if self.hasDomChild('maven') and not packaged:
             self.maven = Maven(self.getDomChild('maven'),self)
+            self.builder.append(self.maven)
             
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.maven, self)
@@ -385,6 +389,7 @@
         # Import any <script part [if not packaged]
         if self.hasDomChild('script') and not packaged:
             self.script = Script(self.getDomChild('script'),self)
+            self.builder.append(self.script)
             
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.script, self)
@@ -392,13 +397,15 @@
         # Import any <nant part [if not packaged]
         if self.hasDomChild('make') and not packaged:
             self.make = Make(self.getDomChild('make'),self)
-            
+            self.builder.append(self.make)
+
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.make, self)
         
         # Import any <nant part [if not packaged]
         if self.hasDomChild('configure') and not packaged:
             self.configure = Configure(self.getDomChild('configure'),self)
+            self.builder.append(self.configure)
             
             # Copy over any XML errors/warnings
             # :TODO:#1: transferAnnotations(self.xml.configure, self)
@@ -552,12 +559,7 @@
             (badDepends, badOptions) = self.importDependencies(workspace)                        
 
         # Expand <ant <depends/<properties...
-        if self.ant: self.ant.expand(self,workspace)
-        if self.maven: self.maven.expand(self,workspace)
-        if self.script: self.script.expand(self,workspace)
-        if self.nant: self.nant.expand(self,workspace)
-        if self.make: self.make.expand(self,workspace)
-        if self.configure: self.configure.expand(self,workspace)
+        [b.expand(self, workspace) for b in self.builder]
 
         if not packaged:
             # Complete dependencies so properties can reference the,
@@ -585,30 +587,8 @@
         #
         # complete properties
         #
-        if self.ant: 
-            self.ant.complete(self,workspace)
-            transferAnnotations(self.ant, self)  
+        [self.completeAndTransferAnnotations(b, workspace) for b in self.builder]
             
-        if self.maven: 
-            self.maven.complete(self,workspace)
-            transferAnnotations(self.maven, self)    
-            
-        if self.script: 
-            self.script.complete(self,workspace)
-            transferAnnotations(self.script, self)              
-            
-        if self.nant: 
-            self.nant.complete(self,workspace)
-            transferAnnotations(self.nant, self)  
-            
-        if self.make: 
-            self.make.complete(self,workspace)
-            transferAnnotations(self.make, self)  
-            
-        if self.configure: 
-            self.configure.complete(self,workspace)
-            transferAnnotations(self.configure, self)  
-            
         if not packaged:    
             #
             # TODO -- move these back?
@@ -723,10 +703,10 @@
         """
         Does this project have a builder?
         """
-        hasBuild=0
-        # I.e has an <ant or <script element
-        if self.ant or self.script or self.maven: hasBuild=1    
-        return hasBuild      
+        if len(self.builder) > 0:
+            return 1
+        else:
+            return 0
         
     def dump(self, indent=0, output=sys.stdout):
         """ 
@@ -742,19 +722,8 @@
         
         Dependable.dump(self,indent,output)
                         
-        if self.ant:
-            self.ant.dump(indent+1,output)
-        if self.maven:
-            self.maven.dump(indent+1,output)
-        if self.script:
-            self.script.dump(indent+1,output)
+        [b.dump(indent + 1, output) for b in self.builder + self.works + self.getOutputs()]
             
-        for work in self.works:
-            work.dump(indent+1,output)
-            
-        for out in self.getOutputs():
-            out.dump(indent+1,output)
-            
     def getAnnotatedOutputsList(self): 
         """
         Return a list of the outputs this project generates
@@ -779,6 +748,10 @@
     def setLanguageType(self,langType):
         self.languageType=langType
 
+    def completeAndTransferAnnotations(self, b, workspace):
+        b.complete(self,workspace)
+        transferAnnotations(b, self)  
+
 class ProjectStatistics(Statistics):
     """Statistics Holder"""
     def __init__(self,projectName):


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: native line-endings

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 14 December 2004 19:47, Stefan Bodewig wrote:
> This has to be done by each developer individually, correct?

Correct.

Find my config file below.

Cheers
Niclas


### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.

### Section for authentication and authorization customizations.
### Set store-password to 'no' to avoid storing your subversion
### passwords in the auth/ area of your config directory.
### It defaults to 'yes'.  Note that this option only prevents
### saving of *new* credentials;  it doesn't invalidate existing
### caches.  (To do that, remove the cache files by hand.)
# [auth]
# store-password = no

### Section for configuring external helper applications.
### Set editor to the command used to invoke your text editor.
###   This will override the environment variables that Subversion
###   examines by default to find this information ($EDITOR, 
###   et al).
### Set diff-cmd to the absolute path of your 'diff' program.
###   This will override the compile-time default, which is to use
###   Subversion's internal diff implementation.
### Set diff3-cmd to the absolute path of your 'diff3' program.
###   This will override the compile-time default, which is to use
###   Subversion's internal diff3 implementation.
### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3'
###   program accepts the '--diff-program' option.
# [helpers]
# editor-cmd = editor (vi, emacs, notepad, etc.)
# diff-cmd = diff_program (diff, gdiff, etc.)
# diff3-cmd = diff3_program (diff3, gdiff3, etc.)
# diff3-has-program-arg = [true | false]

### Section for configuring tunnel agents.
# [tunnels]
### Configure svn protocol tunnel schemes here.  By default, only
### the 'ssh' scheme is defined.  You can define other schemes to
### be used with 'svn+scheme://hostname/path' URLs.  A scheme
### definition is simply a command, optionally prefixed by an
### environment variable name which can override the command if it
### is defined.  The command (or environment variable) may contain
### arguments, using standard shell quoting for arguments with
### spaces.  The command will be invoked as:
###   <command> <hostname> svnserve -t
### (If the URL includes a username, then the hostname will be
### passed to the tunnel agent as <user>@<hostname>.)  If the
### built-in ssh scheme were not predefined, it could be defined
### as:
# ssh = $SVN_SSH ssh
### If you wanted to define a new 'rsh' scheme, to be used with
### 'svn+rsh:' URLs, you could do so as follows:
# rsh = rsh
### Or, if you wanted to specify a full path and arguments:
# rsh = /path/to/rsh -l myusername
### On Windows, if you are specifying a full path to a command,
### use a forward slash (/) or a paired backslash (\\) as the
### path separator.  A single backslash will be treated as an
### escape for the following character.

### Section for configuring miscelleneous Subversion options.
[miscellany]

### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output.
global-ignores = *.iml *.ipr *.iws *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* 
.DS_Store target

### Set log-encoding to the default encoding for log messages
# log-encoding = latin1

### Set use-commit-times to make checkout/update/switch/revert
### put last-committed timestamps on every file touched.
use-commit-times = yes

### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

### Section for configuring automatic properties.
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.
[auto-props]
*.bat = svn:eol-style=CRLF;svn:executable
*.block = svn:eol-style=native
*.c = svn:eol-style=native
*.cgi = svn:eol-style=native
*.cpp = svn:eol-style=native
*.css = svn:eol-style=native
*.dll = svn:mime-type=application/octet-stream
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.ent = svn:eol-style=native
*.gif = svn:mime-type=image/gif
*.h = svn:eol-style=native
.htaccess = svn:eol-style=native
*.html = svn:eol-style=native
*.jar = svn:mime-type=application/octet-stream
*.jpg = svn:mime-type=image/jpeg
*.java = svn:eol-style=native
*.meta = svn:eol-style=native
*.png = svn:mime-type=image/png
*.properties = svn:eol-style=native
*.sequence = svn:eol-style=native
*.sh = svn:eol-style=LF;svn:executable
*.svg = svn:eol-style=native
*.txt = svn:eol-style=native
*.x* = svn:eol-style=native
Makefile = svn:eol-style=native
KEYS = svn:eol-style=native

-- 
   +------//-------------------+
  / http://www.dpml.net       /
 / http://niclas.hedhman.org / 
+------//-------------------+


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: native line-endings

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 14 Dec 2004, David Crossley <cr...@apache.org> wrote:

> * Make sure that the file has the proper line endings
>   for whatever operating system you are on.
> * svn propset svn:eol-style native myfile.txt

I think I've done so for trunk now.

> You can configure your svn client to do it automatically.
> We created a config file at Forrest:
> http://issues.cocoondev.org/browse/FOR-124

This has to be done by each developer individually, correct?

Thanks

        Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


native line-endings (Was: svn commit: r111800 - /gump/trunk/python/gump/core/model/project.py)

Posted by David Crossley <cr...@apache.org>.
Stefan Bodewig wrote:
> This change looks far bigger than it actually was because of line-end
> tranformations.  I vaguely recall there is a property we should add to
> the auto-props so that all *.py files are assumed to have platform
> specific line-feeds by SVN, but I've lost the details right now.

* Make sure that the file has the proper line endings
  for whatever operating system you are on.
* svn add myfile.txt
* svn propset svn:eol-style native myfile.txt

You can configure your svn client to do it automatically.
We created a config file at Forrest:
http://issues.cocoondev.org/browse/FOR-124

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org