Mercurial > hg > truffle
diff mxtool/mx.py @ 17178:bef7eac46e1e
Merge
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Mon, 22 Sep 2014 09:29:37 -0700 |
parents | a8c0553cb2e4 |
children | d6c7c530ca84 |
line wrap: on
line diff
--- a/mxtool/mx.py Mon Sep 22 09:21:29 2014 -0700 +++ b/mxtool/mx.py Mon Sep 22 09:29:37 2014 -0700 @@ -847,7 +847,6 @@ if attrs is None: attrs = OrderedDict() m[name] = attrs - value = expandvars_in_property(value) attrs[attr] = value return suite @@ -965,6 +964,22 @@ suite = None dictName = 'suite' + def expand(value, context): + if isinstance(value, types.DictionaryType): + for n, v in value.iteritems(): + value[n] = expand(v, context + [n]) + elif isinstance(value, types.ListType): + for i in range(len(value)): + value[i] = expand(value[i], context + [str(i)]) + else: + if not isinstance(value, types.StringTypes): + abort('value of ' + '.'.join(context) + ' is of unexpected type ' + str(type(value))) + value = expandvars(value) + if '$' in value or '%' in value: + abort('value of ' + '.'.join(context) + ' contains an undefined environment variable: ' + value) + + return value + moduleName = 'projects' modulePath = join(mxDir, moduleName + '.py') while exists(modulePath): @@ -996,7 +1011,7 @@ if not hasattr(module, dictName): abort(modulePath + ' must define a variable named "' + dictName + '"') - d = getattr(module, dictName) + d = expand(getattr(module, dictName), [dictName]) sections = ['projects', 'libraries', 'jrelibraries', 'distributions'] + (['distribution_extensions'] if suite else ['name', 'mxversion']) unknown = d.viewkeys() - sections if unknown: