Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
3731:71f1f6fd32f7 | 3732:3e2e8b8abdaf |
---|---|
257 for name, attrs in projsMap.iteritems(): | 257 for name, attrs in projsMap.iteritems(): |
258 if self.projects.has_key(name): | 258 if self.projects.has_key(name): |
259 env.abort('cannot override project ' + name + ' in ' + self.project(name).baseDir + " with project of the same name in " + mxDir) | 259 env.abort('cannot override project ' + name + ' in ' + self.project(name).baseDir + " with project of the same name in " + mxDir) |
260 srcDirs = pop_list(attrs, 'sourceDirs') | 260 srcDirs = pop_list(attrs, 'sourceDirs') |
261 deps = pop_list(attrs, 'dependencies') | 261 deps = pop_list(attrs, 'dependencies') |
262 p = Project(baseDir, name, srcDirs, deps) | 262 subDir = attrs.pop('subDir', ''); |
263 p = Project(join(baseDir, subDir), name, srcDirs, deps) | |
263 p.checkstyleProj = attrs.pop('checkstyle', name) | 264 p.checkstyleProj = attrs.pop('checkstyle', name) |
264 p.native = attrs.pop('native', '') == 'true' | 265 p.native = attrs.pop('native', '') == 'true' |
265 p.__dict__.update(attrs) | 266 p.__dict__.update(attrs) |
266 self.projects[name] = p | 267 self.projects[name] = p |
267 | 268 |
702 """ | 703 """ |
703 existed = exists(path) | 704 existed = exists(path) |
704 try: | 705 try: |
705 old = None | 706 old = None |
706 if existed: | 707 if existed: |
707 with open(path) as f: | 708 with open(path, 'rb') as f: |
708 old = f.read() | 709 old = f.read() |
709 | 710 |
710 if old == content: | 711 if old == content: |
711 return False | 712 return False |
712 | 713 |
713 with open(path, 'w') as f: | 714 with open(path, 'wb') as f: |
714 f.write(content) | 715 f.write(content) |
715 | 716 |
716 self.log(('modified ' if existed else 'created ') + path) | 717 self.log(('modified ' if existed else 'created ') + path) |
717 return True; | 718 return True; |
718 except IOError as e: | 719 except IOError as e: |