using scons as a library

T

Tim Arnold

Hi, I've been reading up on the SCons build tool. It's intended to
work by the end-user calling 'scons' on a buildscript. However, I'd
like to use it from my own python project as an imported module, and
have my already-written classes use the Scons objects to take actions
without an external script.

The reason for this somewhat odd question is that I don't want SCons
to build the project--the project itself builds documentation (pdf/
html/xml) from LaTeX sources--my classes handle some complex
configuration issues, source parsing, actual rendering, etc. What I
would gain by using SCons is to let my code hand-off tasks to SCons
like making and cleaning directories, creating zip files, interacting
with CVS, etc.

Has anyone tried this before? It seems doable, but if someone has an
example that would help to shorten my learning curve.

thanks,
--Tim Arnold
 
M

Miki

Hello Tim,
Hi, I've been reading up on the SCons build tool. It's intended to
work by the end-user calling 'scons' on a buildscript. However, I'd
like to use it from my own python project as an imported module, and
have my already-written classes use the Scons objects to take actions
without an external script.

The reason for this somewhat odd question is that I don't want SCons
to build the project--the project itself builds documentation (pdf/
html/xml) from LaTeX sources--my classes handle some complex
configuration issues, source parsing, actual rendering, etc. What I
would gain by using SCons is to let my code hand-off tasks to SCons
like making and cleaning directories, creating zip files, interacting
with CVS, etc.

Has anyone tried this before? It seems doable, but if someone has an
example that would help to shorten my learning curve.
Just have a look at the "scons" script:
import SCons.Script
SCons.Script.main()

Looks simple enough.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,732
Latest member
ArronPalin

Latest Threads

Top