Merge pull request #358 from hackalog/add_info

Add build_info subcommand
This commit is contained in:
Mathieu Virbel 2019-02-07 15:48:06 +01:00 committed by GitHub
commit e3fa7a300f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,8 @@ import fnmatch
import tempfile
import time
from datetime import datetime
from pprint import pformat
try:
from urllib.request import FancyURLopener, urlcleanup
except ImportError:
@ -1264,6 +1266,7 @@ Available commands:
distclean Clean the build and the result
recipes List all the available recipes
status List all the recipes and their build status
build_info Display the current build context and Architecture info
Xcode:
create Create a new xcode project
@ -1456,6 +1459,25 @@ Xcode:
print("--")
print("Project {} updated".format(filename))
def build_info(self):
ctx = Context()
print("Build Context")
print("-------------")
for attr in dir(ctx):
if not attr.startswith("_"):
if not callable(attr) and attr != 'archs':
print("{}: {}".format(attr, pformat(getattr(ctx, attr))))
for arch in ctx.archs:
ul = '-' * (len(str(arch))+6)
print("\narch: {}\n{}".format(str(arch), ul))
for attr in dir(arch):
if not attr.startswith("_"):
if not callable(attr) and attr not in ['arch', 'ctx', 'get_env']:
print("{}: {}".format(attr, pformat(getattr(arch, attr))))
env = arch.get_env()
print("env ({}): {}".format(arch, pformat(env)))
def pip(self):
ctx = Context()
for recipe in Recipe.list_recipes():