diff mxtool/mx.py @ 3732:3e2e8b8abdaf

Updated mxtool to allow projects in subdirectories.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 19:58:27 +0100
parents 6c5f528c7aac
children 34527a24bcf8
line wrap: on
line diff
--- a/mxtool/mx.py	Sat Dec 17 18:19:04 2011 +0100
+++ b/mxtool/mx.py	Sat Dec 17 19:58:27 2011 +0100
@@ -259,7 +259,8 @@
                 env.abort('cannot override project  ' + name + ' in ' + self.project(name).baseDir + " with project of the same name in  " + mxDir)
             srcDirs = pop_list(attrs, 'sourceDirs')
             deps = pop_list(attrs, 'dependencies')
-            p = Project(baseDir, name, srcDirs, deps)
+            subDir = attrs.pop('subDir', '');
+            p = Project(join(baseDir, subDir), name, srcDirs, deps)
             p.checkstyleProj = attrs.pop('checkstyle', name)
             p.native = attrs.pop('native', '') == 'true'
             p.__dict__.update(attrs)
@@ -704,13 +705,13 @@
         try:
             old = None
             if existed:
-                with open(path) as f:
+                with open(path, 'rb') as f:
                     old = f.read()
             
             if old == content:
                 return False
                 
-            with open(path, 'w') as f:
+            with open(path, 'wb') as f:
                 f.write(content)
                 
             self.log(('modified ' if existed else 'created ') + path)