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 (4)
......@@ -12,6 +12,10 @@ buildstream 1.3.1
specific. Recommendation if you are building in Linux is to use the
ones being used in freedesktop-sdk project, for example
o Running `bst show` without elements specified will now attempt to show
the default element defined in the projcet configuration.
If no default element is defined, all elements in the project will be shown
o All elements must now be suffixed with `.bst`
Attempting to use an element that does not have the `.bst` extension,
will result in a warning.
......
......@@ -526,6 +526,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.
......@@ -570,11 +575,14 @@ def show(app, elements, deps, except_, order, format_):
bst show target.bst --format \\
$'---------- %{name} ----------\\n%{vars}'
"""
with app.initialized():
if not elements:
guessed_target = app.context.guess_element()
if guessed_target:
elements = (guessed_target,)
else:
elements = app.project.get_default_elements()
dependencies = app.stream.load_selection(elements,
selection=deps,
......
......@@ -228,7 +228,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',
......@@ -391,6 +391,34 @@ class Project():
# Reset the element loader state
Element._reset_load_state()
# get_default_elements()
#
# This function is used to gather either:
# The project default element (if defined in project.conf)
# or
# All elements in the project
#
def get_default_elements(self):
output = []
# The project is not required to have an element-path
element_directory = self._project_conf.get('element-path')
# The project may have a default element defined
default_element = self._project_conf.get("defaults", {}).get("target-element", None)
if default_element:
return (default_element,)
directory = os.path.join(self.directory, element_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("./")
output.append(rel_file)
return tuple(output)
# _load():
#
# Loads the project configuration file in the project
......
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,27 @@ 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)
result = cli.run(project=project, silent=True, args=[
'show'])
result.assert_success()
# Get the result output of "[state sha element]" and turn into a list
results = result.output.strip().split(" ")
expected = 'target2.bst'
assert results[2] == expected
@pytest.mark.datafiles(DATA_DIR + "_fail")
def test_show_fail(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
result = cli.run(project=project, silent=True, args=[
'show'])
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
......