Statistics
| Revision:

svn-gvsig-desktop / tags / gvSIG_3D_Animation_1_9_SNAPSHOT_build_14 / extensions / ext3Dgui / buildman / bin / bmn.py @ 43233

History | View | Annotate | Download (1.42 KB)

1 26254 rgaitan
#!/usr/bin/env python
2
3
4
__authors__=["Rafael Gaitan <rgaitan@ai2.upv.es>","Pedro Jorquera <pjorquera@okode.com>","Enrique Medina <quiqueiii@gmail.com>"]
5
__date__="30 Nov 2007"
6
__copyright__="Copyright 2007 AI2/OKODE"
7
__license__="GPL"
8
__version__="1.0.0"
9
__URL__="https://murray.ai2.upv.es/svn/buildman"
10
11
import sys
12
from bmcore import *
13
14
#main
15
def main():
16
17
        arguments = ArgumentParser(sys.argv)
18
        arguments.getApplicationUsage().setDescription(arguments.getApplicationName() + "is a set of scripts to create automatic and continuous build systems")
19
        arguments.getApplicationUsage().addCommandLineOption("--help", "Gets this help")
20
        arguments.getApplicationUsage().addCommandLineOption("--help-all", "Gets the help for all existing tasks")
21
        arguments.getApplicationUsage().addCommandLineOption("--help-goal [goal]", "Gets the help for the given task")
22
23
        if len(sys.argv)<2:
24
                arguments.writeHelpMessages()
25
                return
26
27
        if arguments.read("--help"):
28
                arguments.writeHelpMessages()
29
                return
30
31
        help_goal = False
32
        help_all = False
33
        goal = [""]
34
        if arguments.read("--help-goal",goal):
35
                help_goal = True
36
        if arguments.read("--help-all"):
37
                help_all = True
38
39
        bmn = BuildMan(arguments)
40
41
        if help_goal:
42
                arguments.writeGoalHelpMessages(goal[0])
43
                return
44
45
        if help_all:
46
                arguments.writeHelpMessages()
47
                return
48
        if arguments.errors():
49
                arguments.writeErrorMessages()
50
                return
51
52
        if not bmn.run():
53
                bmn.writeErrorMessages()
54
55
56
if __name__ == '__main__': main()