-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathbuild.py
53 lines (41 loc) · 1.03 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
import sys
from jsmbuild import jsmbuild
def PrintTitle (title):
print '-- ' + title + ' --'
def PrintMessage (message):
print message
def PrintErrors (builder):
for error in builder.GetErrors ():
print error
def Main ():
currentPath = os.path.dirname (os.path.abspath (__file__))
PrintTitle ('Init build system')
builder = jsmbuild.JSMBuilder ()
if not builder.Init (currentPath):
PrintErrors (builder)
return 1
PrintTitle ('Check dependencies')
if not builder.CheckDependencies ():
PrintErrors (builder)
return 1
PrintTitle ('Run unit tests')
if not builder.RunUnitTests ():
PrintErrors (builder)
return 1
PrintTitle ('JSHint check')
if not builder.JSHintCheck ():
PrintErrors (builder)
return 1
PrintTitle ('Build')
if not builder.Build ():
PrintErrors (builder)
return 1
PrintTitle ('Document')
if not builder.Document ():
PrintErrors (builder)
return 1
PrintMessage ('---------------------------')
PrintMessage ('Build finished successfully')
return 0
sys.exit (Main ())