mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
tool/run: way to obtain list of build artifacts
The new function 'build_artifacts' returns a list of artifacts created by the Genode build system. The list can be supplied as argument to the 'build_boot_image' function. Note that the list covers only program targets and shared libraries. Other artifacts created as side effects of custom rules are not covered. Fixes #4368
This commit is contained in:
parent
0eee5d5fc1
commit
fcc96a2c46
25
tool/run/run
25
tool/run/run
@ -44,6 +44,8 @@ proc assert_spec {spec} {
|
||||
#
|
||||
proc build {targets} {
|
||||
|
||||
global _collected_build_artifacts
|
||||
|
||||
if {[llength $targets] == 0} return
|
||||
|
||||
if {[get_cmd_switch --skip-build]} return
|
||||
@ -57,10 +59,33 @@ proc build {targets} {
|
||||
puts "Error: Genode build failed"
|
||||
exit -4
|
||||
}
|
||||
|
||||
# record the build artifacts created during the build process
|
||||
set artifacts_log [exec sed -n "/^#/s/^# Build artifact //p" progress.log]
|
||||
lappend _collected_build_artifacts {*}[split $artifacts_log "\n"]
|
||||
|
||||
puts "genode build completed"
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Return list of build artifacts created during 'build'
|
||||
#
|
||||
# The returned artifacts can be used as boot-modules arguments for
|
||||
# the 'build_boot_image' step.
|
||||
#
|
||||
proc build_artifacts { } {
|
||||
|
||||
global _collected_build_artifacts
|
||||
|
||||
if {![info exists _collected_build_artifacts]} {
|
||||
return { } }
|
||||
|
||||
# use lsort to remove duplicates
|
||||
return [lsort -unique $_collected_build_artifacts]
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Create a fresh boot directory
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user