Opened 20 years ago

Last modified 20 years ago

#12 new enhancement

How to create subdirs at cmt create step?

Reported by: arnault Owned by: Arnault
Priority: normal Milestone: v1r20
Component: a. Usage Version: devel
Severity: normal Keywords:
Cc: OS: All
If Other, could you precise: Experiment: Other
If Other, could you precise:
Stack trace:
Steps to reproduce:

Description (last modified by arnault)

Hi

(I am new to CMT)

I try to customize the default directory (branches) that CMT creates when creating a new package by running "cmt create Foo v1".

By default it creates a src and cmt directory.

1) How could I configure CMT to create others directories, for example, test and doc, each time the cmt create <pack> <version> is use ?

I have tried to add in the requirement file of a package the line:

branches test doc

When I run "cmt config", cmt creates the test and doc directories but what I want him to do is to automatically add these directories AT the package creation.

There is perhaps something to add in the project.cmt file of the enclosing project but I didn't find it in the documentation.

2) I also don't really understand if the branches instruction is required in the requirements file of a package. In other words, Is it correct to create some directories in a package (manually with mkdir) without adding the corresponding branches command in the requirement file ?

Thank you

--

Olivier Roques or.roques@…

Answer:

In fact, there is no way to force the creation of subdirectories at "cmt create ..." time.

The "branches" statement - as it is today - is useful in the following use case:

o A subdirectory is only needed either at run time or at build time (for instance it will receive temporary files) o This subdirectory is not part of the sources themselves (and it's NOT in CVS) o Thus it must be "recreated" when the sources are eg checked out from CVS

This indeed does not cover your use case which is to systematically create new packages with a given predefined structure.

Probably one good example is when a convention exists to provide include files in the subdirectory

../<package>

This would be useful to enforce this convention at "cmt create ..." time.

I think your suggestion to describe this convention in the project file is a good idea. One implementation could be to accept the "branches" statement at the project file level, and give it the semantics you suggest.

Let me add this to some next release of CMT.

Thanks anyway for this point and the suggestion.

Regards, Christian

Change History (1)

comment:1 by arnault, 20 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.