summaryrefslogtreecommitdiff
path: root/scripts/builder/main.py
Unidiff
Diffstat (limited to 'scripts/builder/main.py') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/builder/main.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/builder/main.py b/scripts/builder/main.py
index 6fce65d..b9fe04a 100755
--- a/scripts/builder/main.py
+++ b/scripts/builder/main.py
@@ -10,7 +10,7 @@ import codecs
10import itertools 10import itertools
11from collections import deque 11from collections import deque
12 12
13import frontendBuilder 13#import frontendBuilder
14import repository 14import repository
15 15
16pp = pprint.PrettyPrinter(indent=4, depth=4) 16pp = pprint.PrettyPrinter(indent=4, depth=4)
@@ -75,7 +75,7 @@ def assembleBackend (backend, frontends, versions):
75 75
76 builderModuleName = backend + 'Builder' 76 builderModuleName = backend + 'Builder'
77 builderClassName = backend.capitalize() + 'Builder' 77 builderClassName = backend.capitalize() + 'Builder'
78 78 #print ("BUILD BACKENDS - module: " + builderModuleName + " , class: " + builderClassName)
79 builderModule = __import__(builderModuleName) 79 builderModule = __import__(builderModuleName)
80 builderClass = getattr(builderModule, builderClassName) 80 builderClass = getattr(builderModule, builderClassName)
81 81
@@ -88,10 +88,22 @@ def build (settings, repository):
88 frontends = [] 88 frontends = []
89 89
90 if repository.areTherePendingChanges(): 90 if repository.areTherePendingChanges():
91 print "\nWARNING: repository has pending changes\n" 91 if 'install' in settings['versions']:
92 raise Exception("repository has pending changes, can't 'install'")
93 else:
94 print "\nWARNING: repository has pending changes\n"
92 95
93 for frontend in settings['frontends']: 96 for frontend in settings['frontends']:
94 frontends.append(frontendBuilder.FrontendBuilder(frontend, loadSettings('frontend', frontend), repository.version())) 97 normalizedFrontendName = frontend.replace(".", "_")
98 builderModuleName = normalizedFrontendName + 'Builder'
99 builderClassName = normalizedFrontendName.title() + 'Builder'
100
101 #print ("BUILD FRONTEND - module: " + builderModuleName + " , class: " + builderClassName)
102 builderModule = __import__(builderModuleName)
103 builderClass = getattr(builderModule, builderClassName)
104 builder = builderClass(frontend, loadSettings('frontend', frontend), repository.version())
105 #builder = frontendBuilder.FrontendBuilder(frontend, loadSettings('frontend', frontend), repository.version())
106 frontends.append(builder)
95 107
96 for backend in settings['backends']: 108 for backend in settings['backends']:
97 assembleBackend(backend, frontends, settings['versions']) 109 assembleBackend(backend, frontends, settings['versions'])
@@ -114,6 +126,7 @@ def usage (message):
114 # print "build clean install" 126 # print "build clean install"
115 print "build install --ALL" 127 print "build install --ALL"
116 print "build install debug --ALL" 128 print "build install debug --ALL"
129 print "build install debug development --ALL"
117 # print "build clean install debug --ALL" 130 # print "build clean install debug --ALL"
118 print "build install debug --backends php python --frontends beta gamma" 131 print "build install debug --backends php python --frontends beta gamma"
119 print "build install debug development --backends php python --frontends beta gamma gamma.mobile" 132 print "build install debug development --backends php python --frontends beta gamma gamma.mobile"
@@ -122,7 +135,7 @@ def usage (message):
122#-------------------------------------------------------------------- 135#--------------------------------------------------------------------
123 136
124def allFrontends (): 137def allFrontends ():
125 return ['beta', 'gamma', 'mobile'] 138 return ['beta', 'gamma', 'gamma.mobile']
126 139
127def allBackends (): 140def allBackends ():
128 return ['php', 'python'] 141 return ['php', 'python']
@@ -134,6 +147,7 @@ def main ():
134 parameters = list(itertools.islice(sys.argv, 1, None)) 147 parameters = list(itertools.islice(sys.argv, 1, None))
135 148
136 sys.path.append(os.path.join(scriptDir(), 'backends')) 149 sys.path.append(os.path.join(scriptDir(), 'backends'))
150 sys.path.append(os.path.join(scriptDir(), 'frontends'))
137 currentRepository = repository.repositoryWithPath(projectBaseDir()) 151 currentRepository = repository.repositoryWithPath(projectBaseDir())
138 152
139 clean() 153 clean()
@@ -174,4 +188,4 @@ def main ():
174 188
175 189
176if __name__ == "__main__": 190if __name__ == "__main__":
177 main() 191 main()