Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (2)
Showing with 125 additions and 2 deletions
......@@ -170,6 +170,31 @@ original_main = click.BaseCommand.main
click.BaseCommand.main = override_main
def get_elements(app):
directory = app._main_options.get("directory")
project_conf = app.project._project_conf
output = []
# The project is not required to have an element-path
element_directory = project_conf.get('element-path')
# The project may have a default element defined
default_element = project_conf.get("defaults", {}).get("target-element", None)
if default_element:
return (default_element,)
directory = os.path.abspath(directory)
for root, _, files in os.walk(directory):
for file in files:
if file.endswith(".bst"):
rel_dir = os.path.relpath(root, directory)
rel_file = os.path.join(rel_dir, file).lstrip("./")
rel_file = rel_file.lstrip(element_directory).lstrip('/')
output.append(rel_file)
return tuple(output)
##################################################################
# Main Options #
##################################################################
......@@ -509,6 +534,11 @@ def push(app, elements, deps, remote):
def show(app, elements, deps, except_, order, format_):
"""Show elements in the pipeline
Declaring no elements with result in showing a default element if one is declared in the project configuration.
If no default is declared, all elements in the project will be shown
By default this will show all of the dependencies of the
specified target element.
......@@ -553,7 +583,11 @@ def show(app, elements, deps, except_, order, format_):
bst show target.bst --format \\
$'---------- %{name} ----------\\n%{vars}'
"""
with app.initialized():
if not elements:
elements = get_elements(app)
dependencies = app.stream.load_selection(elements,
selection=deps,
except_targets=except_)
......
......@@ -226,7 +226,7 @@ class Project():
'element-path', 'variables',
'environment', 'environment-nocache',
'split-rules', 'elements', 'plugins',
'aliases', 'name',
'aliases', 'name', 'defaults',
'artifacts', 'options',
'fail-on-overlap', 'shell', 'fatal-warnings',
'ref-storage', 'sandbox', 'mirrors', 'remote-execution',
......
......@@ -196,4 +196,11 @@ shell:
# Command to run when `bst shell` does not provide a command
#
command: [ 'sh', '-i' ]
\ No newline at end of file
command: [ 'sh', '-i' ]
# Default Targets
#
defaults:
# Set a Default element to build when none are defined
target-element: None
kind: stack
description: |
Main stack target for the bst build test
kind: stack
description: |
Main stack target for the bst build test
# Project config for frontend build test
name: test
element-path: elements
fatal-warnings:
- bad-element-suffix
defaults:
target-element: target2.bst
kind: compose
depends:
- fileNAME: import-dev.bst
type: build
config:
# Dont try running the sandbox, we dont have a
# runtime to run anything in this context.
integrate: False
kind: import
sources:
- kind: local
path: files/dev-files
kind: stack
description: |
Main stack target for the bst build test
depends:
- compose-all.bst
#ifndef __PONY_H__
#define __PONY_H__
#define PONY_BEGIN "Once upon a time, there was a pony."
#define PONY_END "And they lived happily ever after, the end."
#define MAKE_PONY(story) \
PONY_BEGIN \
story \
PONY_END
#endif /* __PONY_H__ */
# Project config for frontend build test
name: test
element-path: elements
......@@ -46,6 +46,33 @@ def test_show_invalid_element_path(cli, datafiles):
'show',
"foo.bst"])
@pytest.mark.datafiles(DATA_DIR + "_default")
def test_show_default(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
prev_dir = os.getcwd()
os.chdir(project)
result = cli.run(project=project, silent=True, args=[
'show'])
os.chdir(prev_dir)
result.assert_success()
results = result.output.strip().splitlines()
expected = 'buildable ca4321107f0f529170d345af19372c57a6672f62afdcbdd36ca067b67124ef60 target2.bst'
if result.output.strip() != expected:
raise AssertionError("Expected output:\n{}\nInstead received output:\n{}"
.format(expected, result.output))
@pytest.mark.datafiles(DATA_DIR + "_fail")
def test_show_fail(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
prev_dir = os.getcwd()
os.chdir(project)
result = cli.run(project=project, silent=True, args=[
'show'])
os.chdir(prev_dir)
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
......