|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-10 03:16:17
On Thursday 09 December 2004 20:21, David Abrahams wrote:
> I didn't notice this before, but now I am seeing C++ toolsets showing up
> as relevant features in my documentation builds:
>
> MkDir1 libs\numeric\mtl\doc\bin
> MkDir1 libs\numeric\mtl\doc\bin\gcc-3.2
> MkDir1 libs\numeric\mtl\doc\bin\gcc-3.2\debug
> docutils.html libs\numeric\mtl\doc\bin\gcc-3.2\debug\plan.html
> docutils.html libs\numeric\mtl\doc\bin\gcc-3.2\debug\sow.html
>
> What have I done wrong?
Nothing, it's the only behaviour currently. Now, there are two approaches how
to deal with it.
1. The <in-path> feature we've discussed previously, that should control which
properties how up in path and which don't. Problem: it must be set on each
target.
2. Allow to specify, when declaring *generator*, the list of relevant
properties. When creating targets, only relevant properies will be left in
property-set.
The second approach is nice because everywhere you write:
html a : a.rst ;
you'll have 'a.html' just in "bin". You don't need any explicit <in-path>. I
attach a patch which implements this idea. With that patch, I get:
docutils.html bin/a.html
PYTHONPATH=foo:foo/extras;export PYTHONPATH
python foo/tools/rst2html.py a.rst bin/a.html
Comments are most welcome!
- Volodya
--Boundary-00=_RtVuB/WoEsgCNzH Content-Type: text/x-diff;
charset="iso-8859-1";
name="docutils_path.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="docutils_path.diff"
Index: build/generators.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/build/generators.jam,v
retrieving revision 1.75
diff -u -r1.75 generators.jam
--- build/generators.jam 12 Nov 2004 08:11:04 -0000 1.75
+++ build/generators.jam 10 Dec 2004 08:15:10 -0000
@@ -104,6 +104,7 @@
import virtual-target ;
import "class" : new ;
import property ;
+ import property-set ;
EXPORT class_at_generator : indent increase-indent decrease-indent generators.dout ;
@@ -126,6 +127,7 @@
# was not specified.
: requirements *
+ : relevant-properties *
)
{
self.id = $(id) ;
@@ -133,6 +135,7 @@
self.source-types = $(source-types) ;
self.target-types-and-names = $(target-types-and-names) ;
self.requirements = $(requirements) ;
+ self.relevant-properties = $(relevant-properties) ;
for local e in $(target-types-and-names)
{
@@ -385,6 +388,24 @@
# source.
rule generated-targets ( sources + : property-set : project name ? )
{
+ if $(self.relevant-properties)
+ {
+ if $(self.relevant-properties) = none
+ {
+ property-set = [ property-set.empty ] ;
+ }
+ else
+ {
+ local raw ;
+ for local p in $(self.relevant-properties)
+ {
+ v = [ $(property-set).get $(p) ] ;
+ raw += $(p:G=$(v)) ;
+ }
+ property-set = [ property-set.create $(raw) ] ;
+ }
+ }
+
if ! $(name)
{
name = [ $(sources[1]).name ] ;
@@ -621,21 +642,23 @@
# Rationale: the instance is returned so that it's possible to first register
# a generator and then call 'run' method on that generator, bypassing all
# generator selection.
-rule register-standard ( id : source-types + : target-types + : requirements * )
+rule register-standard ( id : source-types + : target-types + : requirements *
+ : relevant-properties * )
{
local g = [ new generator $(id) : $(source-types) : $(target-types)
- : $(requirements) ] ;
+ : $(requirements) : $(relevant-properties) ] ;
register $(g) ;
return $(g) ;
}
# Creates new instance of the 'composing-generator' class and
# registers it.
-rule register-composing ( id : source-types + : target-types + : requirements * )
+rule register-composing ( id : source-types + : target-types + : requirements *
+ : relevant-properties * )
{
local g = [ new generator $(id) true : $(source-types)
- : $(target-types) : $(requirements) ] ;
+ : $(target-types) : $(requirements) : $(relevant-properties) ] ;
register $(g) ;
return $(g) ;
}
Index: tools/docutils.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/docutils.jam,v
retrieving revision 1.1
diff -u -r1.1 docutils.jam
--- tools/docutils.jam 9 Dec 2004 21:58:42 -0000 1.1
+++ tools/docutils.jam 10 Dec 2004 08:15:10 -0000
@@ -30,7 +30,7 @@
scanner.register rst-scanner : include ;
type.set-scanner ReST : rst-scanner ;
-generators.register-standard docutils.html : ReST : HTML ;
+generators.register-standard docutils.html : ReST : HTML : : none ;
rule init ( docutils-dir )
{
--Boundary-00=_RtVuB/WoEsgCNzH--
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk