DescriptionConsider a project in contrib which wants this structure pulled from a single repo:
contrib/
wscript
project/
.repo // could be .git or .hg, for example
main/
wscript // builds executable 'project' from main.cc and other.cc
main.cc
other.cc
modules/
moduleA/ // Contains normal module structure
wscript
model/
...
moduleB/ // Contains normal module structure
data/ // No source code here, so no wscript
One can't do this at the moment for two reasons:
* contrib/wscript won't recognize the project directory because
the top level does not contain a wscript file
* Each "normal" module directory has to be created by hand,
or created in src, then moved to its final location.
This patch provides two enhancements to enable this kind of project:
1. Enable the create-module.py script to create modules
in the contrib directory, as well as the src directory.
2. Enable modules in the contrib directory to have arbitrary
structure.
To accomplish these goals the patch modifies a couple of heuristics:
* create-module.py accepts arbitrary paths, using the last path element
as the name of the module (but see the question below).
* contrib/wscript walks the directory tree, looking for directories
containing wscript files. When found, add that directory to the
list of contrib modules to process. It is not an error for a tree
under contrib not to contain any wscript files; this tree is simply
ignored. (The data directory above is an example.)
Since create-module.py is more general, this patch moves it to the utils
directory.
Question: Should we restrict to just module paths matching src/new-module and
contrib/new-module? The first restriction might be useful. The
second conflicts with allowing contrib modules to have arbitrary
structure.
Patch Set 1 #Patch Set 2 : Revised patch #Patch Set 3 : Revised to build projects as well #
MessagesTotal messages: 11
|