mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
Add "--out-xml=xyz.xml" option that dumps the output of all actions, and the test.jam information, to the given file. Changes are mostly from Dave.
[SVN r41167]
This commit is contained in:
@@ -487,8 +487,61 @@ for t in $(virtual-targets)
|
||||
{
|
||||
actual-targets += [ $(t).actualize ] ;
|
||||
}
|
||||
|
||||
# Was an XML dump requested?
|
||||
.out-xml = [ MATCH --out-xml=(.*) : [ modules.peek : ARGV ] ] ;
|
||||
if $(.out-xml)
|
||||
{
|
||||
modules.poke : .out-xml : $(.out-xml) ;
|
||||
module
|
||||
{
|
||||
rule out-xml ( target : sources * )
|
||||
{
|
||||
INCLUDES $(target) : $(sources) ;
|
||||
local nl = "
|
||||
" ;
|
||||
on $(target) .header =
|
||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
|
||||
"$(nl)<build version=\"1.0\">" ;
|
||||
on $(target) .footer =
|
||||
$(nl)</build>$(nl) ;
|
||||
}
|
||||
|
||||
actions out-xml
|
||||
{
|
||||
}
|
||||
|
||||
rule out-xml-action-rule ( target sources * : status : user : system : command : output ? )
|
||||
{
|
||||
local contents = [ on $(target) return $(.header) $(.contents) $(.footer) ] ;
|
||||
local f = @($(target):E=$(contents)) ;
|
||||
}
|
||||
|
||||
__ACTION_RULE__ on $(.out-xml) = out-xml-action-rule ;
|
||||
|
||||
rule __ACTION_RULE__ ( target sources * : status : user : system : command : output ? )
|
||||
{
|
||||
local nl = "
|
||||
" ;
|
||||
local locate = [ on $(target) return $(LOCATE) ] ;
|
||||
.contents on $(.out-xml) +=
|
||||
$(nl)" <action status=\""$(status)"\" user=\""$(user)"\" system=\""$(system)"\">"
|
||||
$(nl)" "<target>$(target:G=:R=$(locate))</target>
|
||||
$(nl)" "<source>$(sources)</source>
|
||||
$(nl)" "<command>$(nl)<![CDATA[$(command)]]></command>
|
||||
$(nl)" "<output><![CDATA[$(output)]]></output>
|
||||
$(nl)" "</action>$(nl) ;
|
||||
}
|
||||
|
||||
__ACTION_RULE__ = __ACTION_RULE__ ;
|
||||
}
|
||||
|
||||
ALWAYS $(.out-xml) ;
|
||||
out-xml $(.out-xml) : $(actual-targets) ;
|
||||
}
|
||||
|
||||
NOTFILE all ;
|
||||
DEPENDS all : $(actual-targets) ;
|
||||
DEPENDS all : $(actual-targets) $(.out-xml) ;
|
||||
|
||||
if $(bjam-targets)
|
||||
{
|
||||
|
||||
@@ -193,6 +193,8 @@ local rule get-library-name ( path )
|
||||
}
|
||||
}
|
||||
|
||||
# Was an XML dump requested?
|
||||
.out-xml = [ MATCH --out-xml=(.*) : [ modules.peek : ARGV ] ] ;
|
||||
|
||||
# Take a target (instance of 'basic-target') and prints
|
||||
# - its type
|
||||
@@ -235,13 +237,27 @@ rule dump-test ( target )
|
||||
# Extract values of the <test-info> feature
|
||||
local test-info = [ $(r).get <test-info> ] ;
|
||||
|
||||
# Format them into a single string of quoted strings
|
||||
test-info = \"$(test-info:J=\"\ \")\" ;
|
||||
|
||||
ECHO boost-test($(type)) \"$(name)\"
|
||||
[$(test-info)]
|
||||
":" \"$(source-files)\"
|
||||
;
|
||||
if $(.out-xml)
|
||||
{
|
||||
local nl = "
|
||||
" ;
|
||||
.contents on $(.out-xml) +=
|
||||
$(nl)" <test type=\""$(type)"\" name=\""$(name)"\">"
|
||||
$(nl)" "<info><![CDATA[$(test-info)]]></info>
|
||||
$(nl)" "<source><![CDATA[$(source-files)]]></source>
|
||||
$(nl)" </test>"
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
# Format them into a single string of quoted strings
|
||||
test-info = \"$(test-info:J=\"\ \")\" ;
|
||||
|
||||
ECHO boost-test($(type)) \"$(name)\"
|
||||
[$(test-info)]
|
||||
":" \"$(source-files)\"
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
# Register generators. Depending on target type, either
|
||||
|
||||
Reference in New Issue
Block a user