/[escript]/trunk/scons/scons_extensions.py
ViewVC logotype

Contents of /trunk/scons/scons_extensions.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 645 - (show annotations)
Fri Mar 24 01:10:42 2006 UTC (13 years ago) by elspeth
File MIME type: text/x-python
File size: 2320 byte(s)
More copyright.

1
2 # Copyright 2006 by ACcESS MNRF
3 #
4 # http://www.access.edu.au
5 # Primary Business: Queensland, Australia
6 # Licensed under the Open Software License version 3.0
7 # http://www.opensource.org/licenses/osl-3.0.php
8 #
9
10
11 # Extensions to Scons
12
13 import py_compile
14 import sys
15 import os
16
17 # Code to build .pyc from .py
18 def build_py(target, source, env):
19 py_compile.compile(str(source[0]), str(target[0]))
20 return None
21
22 # Code to run unit_test executables
23 def runUnitTest(target, source, env):
24 app = str(source[0].abspath)
25 if not os.system(app):
26 open(str(target[0]),'w').write("PASSED\n")
27 else:
28 return 1
29 return None
30
31 # code to build epydoc docs
32 def build_epydoc(target, source, env):
33 # get where I am currently, just as a reference
34 pwd = os.getcwd()
35
36 # get the full path of the runepydoc script
37 runepydoc = str(source[0].abspath)
38
39 # use this path to work out where the doc directory is
40 dirs = runepydoc.split('/')
41 dirs = dirs[:-3] # trim the last two entries: this is now the doc dir path
42 docdir = '/'.join(dirs) # this is the backwards python way to do it
43 # (I'm feeling in a perl mood today...)
44
45 # change into the relevant dir
46 os.chdir(docdir)
47
48 # run the epydoc script
49 if not os.system(runepydoc):
50 os.chdir(pwd)
51 open(str(target[0]), 'w').write("Documentation built\n")
52 else:
53 return 1
54 return None
55
56 # build doxygen docs
57 def build_doxygen(target, source, env):
58 # get where I am currently, just as a reference
59 pwd = os.getcwd()
60
61 # get the full path of the rundoxygen script
62 rundoxygen = str(source[0].abspath)
63
64 # use this path to work out where the doc directory is
65 dirs = rundoxygen.split('/')
66 dirs = dirs[:-2] # trim the last two entries: this is now the doc dir path
67 docdir = '/'.join(dirs) # this is the backwards python way to do it
68 # (I'm feeling in a perl mood today...)
69
70 # change into the relevant dir
71 os.chdir(docdir)
72
73 # run the doxygen script
74 if not os.system(rundoxygen):
75 os.chdir(pwd)
76 open(str(target[0]), 'w').write("Documentation built\n")
77 else:
78 return 1
79 return None

  ViewVC Help
Powered by ViewVC 1.1.26