Bug 1379961 - Add platform and architecture name to MozbuildObject. r=gps

MozReview-Commit-ID: 7F0oFEkTAsk

--HG--
extra : rebase_source : f315397b6038bb6638fe999cea3cc514ba396011
This commit is contained in:
Andi-Bogdan Postelnicu 2017-09-05 16:10:09 +03:00
parent 63719ddbc7
commit 472220c52c

View File

@ -269,6 +269,21 @@ class MozbuildObject(ProcessExecutionMixin):
def statedir(self):
return os.path.join(self.topobjdir, '.mozbuild')
@property
def platform(self):
"""Returns current platform and architecture name"""
import mozinfo
platform_name = None
bits = str(mozinfo.info['bits'])
if mozinfo.isLinux:
platform_name = "linux" + bits
elif mozinfo.isWin:
platform_name = "win" + bits
elif mozinfo.isMac:
platform_name = "macosx" + bits
return platform_name, bits + 'bit'
@memoized_property
def extra_environment_variables(self):
'''Some extra environment variables are stored in .mozconfig.mk.