subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1291740 - /subversion/trunk/build/generator/gen_win.py
Date Tue, 21 Feb 2012 12:33:04 GMT
Author: rhuijben
Date: Tue Feb 21 12:33:03 2012
New Revision: 1291740

URL: http://svn.apache.org/viewvc?rev=1291740&view=rev
Log:
Use relative paths in more cases in the Visual C++ project files. This looks
more like how Visual Studio would create these files and makes it easier to
access a development working copy on a network drive.

* build/generator/gen_win.py
  (find_rootpath): Use os.path.relpath instead of a simple reimplementation.
  (write_zlib_project_file,
   write_neon_project_file,
   write_serf_project_file): Calculate relative paths instead of abspaths.

Modified:
    subversion/trunk/build/generator/gen_win.py

Modified: subversion/trunk/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1291740&r1=1291739&r2=1291740&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Tue Feb 21 12:33:03 2012
@@ -341,7 +341,7 @@ class WinGeneratorBase(GeneratorBase):
 
   def find_rootpath(self):
     "Gets the root path as understand by the project system"
-    return ".." + "\\.." * self.projfilesdir.count(os.sep) + "\\"
+    return os.path.relpath('.', self.projfilesdir) + "\\"
 
   def makeguid(self, data):
     "Generate a windows style GUID"
@@ -1148,16 +1148,19 @@ class WinGeneratorBase(GeneratorBase):
     if not self.zlib_path:
       return
     zlib_path = os.path.abspath(self.zlib_path)
+    zlib_sources = map(lambda x : os.path.relpath(x, self.projfilesdir),
+                       glob.glob(os.path.join(zlib_path, '*.c')) +
+                       glob.glob(os.path.join(zlib_path,
+                                              'contrib/masmx86/*.c')) +
+                       glob.glob(os.path.join(zlib_path,
+                                              'contrib/masmx86/*.asm')))
+    zlib_headers = map(lambda x : os.path.relpath(x, self.projfilesdir),
+                       glob.glob(os.path.join(zlib_path, '*.h')))
+                       
     self.move_proj_file(self.projfilesdir, name,
                         (('zlib_path', zlib_path),
-                         ('zlib_sources',
-                          glob.glob(os.path.join(zlib_path, '*.c'))
-                          + glob.glob(os.path.join(zlib_path,
-                                                   'contrib/masmx86/*.c'))
-                          + glob.glob(os.path.join(zlib_path,
-                                                   'contrib/masmx86/*.asm'))),
-                         ('zlib_headers',
-                          glob.glob(os.path.join(zlib_path, '*.h'))),
+                         ('zlib_sources', zlib_sources),
+                         ('zlib_headers', zlib_headers),
                          ('zlib_version', self.zlib_version),
                          ('project_guid', self.makeguid('zlib')),
                          ('use_ml', self.have_ml and 1 or None),
@@ -1168,19 +1171,22 @@ class WinGeneratorBase(GeneratorBase):
       return
 
     neon_path = os.path.abspath(self.neon_path)
+    neon_sources = map(lambda x : os.path.relpath(x, self.neon_path),
+                       glob.glob(os.path.join(neon_path, 'src', '*.c')))
+    neon_headers = map(lambda x : os.path.relpath(x, self.neon_path),
+                       glob.glob(os.path.join(neon_path, 'src', '*.h')))
+
     self.move_proj_file(self.neon_path, name,
-                        (('neon_sources',
-                          glob.glob(os.path.join(neon_path, 'src', '*.c'))),
-                         ('neon_headers',
-                          glob.glob(os.path.join(neon_path, 'src', '*.h'))),
+                        (('neon_sources', neon_sources),
+                         ('neon_headers', neon_headers),
                          ('expat_path',
-                          os.path.join(os.path.abspath(self.apr_util_path),
-                                       'xml', 'expat', 'lib')),
-                         ('zlib_path', self.zlib_path
-                                       and os.path.abspath(self.zlib_path)),
-                         ('openssl_path',
-                          self.openssl_path
-                            and os.path.abspath(self.openssl_path)),
+                           os.path.relpath(os.path.join(self.apr_util_path,
+                                                        'xml', 'expat', 'lib'),
+                                           self.neon_path)),
+                         ('zlib_path', os.path.relpath(self.zlib_path,
+                                                       self.neon_path)),
+                         ('openssl_path', os.path.relpath(self.openssl_path,
+                                                          self.neon_path)),
                          ('project_guid', self.makeguid('neon')),
                         ))
 
@@ -1189,29 +1195,31 @@ class WinGeneratorBase(GeneratorBase):
       return
 
     serf_path = os.path.abspath(self.serf_path)
+    serf_sources = map(lambda x : os.path.relpath(x, self.serf_path),
+                       glob.glob(os.path.join(serf_path, '*.c'))
+                       + glob.glob(os.path.join(serf_path, 'auth', '*.c'))
+                       + glob.glob(os.path.join(serf_path, 'buckets',
+                                                   '*.c')))
+    serf_headers = map(lambda x : os.path.relpath(x, self.serf_path),
+                       glob.glob(os.path.join(serf_path, '*.h'))
+                       + glob.glob(os.path.join(serf_path, 'auth', '*.h'))
+                       + glob.glob(os.path.join(serf_path, 'buckets', '*.h')))
     if self.serf_ver_maj != 0:
       serflib = 'serf-%d.lib' % self.serf_ver_maj
     else:
       serflib = 'serf.lib'
 
     self.move_proj_file(self.serf_path, name,
-                        (('serf_sources',
-                          glob.glob(os.path.join(serf_path, '*.c'))
-                          + glob.glob(os.path.join(serf_path, 'auth', '*.c'))
-                          + glob.glob(os.path.join(serf_path, 'buckets',
-                                                   '*.c'))),
-                         ('serf_headers',
-                          glob.glob(os.path.join(serf_path, '*.h'))
-                          + glob.glob(os.path.join(serf_path, 'auth', '*.h'))
-                          + glob.glob(os.path.join(serf_path, 'buckets',
-                                                   '*.h'))),
-                         ('zlib_path', self.zlib_path
-                                       and os.path.abspath(self.zlib_path)),
-                         ('openssl_path',
-                          self.openssl_path
-                            and os.path.abspath(self.openssl_path)),
-                         ('apr_path', os.path.abspath(self.apr_path)),
-                         ('apr_util_path', os.path.abspath(self.apr_util_path)),
+                        (('serf_sources', serf_sources),
+                         ('serf_headers', serf_headers),
+                         ('zlib_path', os.path.relpath(self.zlib_path,
+                                                       self.serf_path)),
+                         ('openssl_path', os.path.relpath(self.openssl_path,
+                                                          self.serf_path)),
+                         ('apr_path', os.path.relpath(self.apr_path,
+                                                      self.serf_path)),
+                         ('apr_util_path', os.path.relpath(self.apr_util_path,
+                                                           self.serf_path)),
                          ('project_guid', self.makeguid('serf')),
                          ('apr_static', self.static_apr),
                          ('serf_lib', serflib),



Mime
View raw message