summaryrefslogtreecommitdiff
path: root/scripts/builder/main.py
authorClipperz <info@clipperz.com>2013-01-08 15:12:19 (UTC)
committer Clipperz <info@clipperz.com>2013-01-08 15:12:19 (UTC)
commit25bd3085c5464862172c5bd921deca550185fe83 (patch) (side-by-side diff)
tree2ea95bdd3606e9721fac81ab072d093fd46005fe /scripts/builder/main.py
parent596e94dca490619acced2e38fb3221cc7237b1ce (diff)
downloadclipperz-25bd3085c5464862172c5bd921deca550185fe83.zip
clipperz-25bd3085c5464862172c5bd921deca550185fe83.tar.gz
clipperz-25bd3085c5464862172c5bd921deca550185fe83.tar.bz2
Updated builder script
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
@@ -9,9 +9,9 @@ import pprint
import codecs
import itertools
from collections import deque
-import frontendBuilder
+#import frontendBuilder
import repository
pp = pprint.PrettyPrinter(indent=4, depth=4)
@@ -74,9 +74,9 @@ def assembleBackend (backend, frontends, versions):
settings = loadSettings('backend', backend)
builderModuleName = backend + 'Builder'
builderClassName = backend.capitalize() + 'Builder'
-
+ #print ("BUILD BACKENDS - module: " + builderModuleName + " , class: " + builderClassName)
builderModule = __import__(builderModuleName)
builderClass = getattr(builderModule, builderClassName)
backendBuilder = builderClass(projectTargetDir(), frontends, versions, settings)
@@ -87,12 +87,24 @@ def assembleBackend (backend, frontends, versions):
def build (settings, repository):
frontends = []
if repository.areTherePendingChanges():
- print "\nWARNING: repository has pending changes\n"
+ if 'install' in settings['versions']:
+ raise Exception("repository has pending changes, can't 'install'")
+ else:
+ print "\nWARNING: repository has pending changes\n"
for frontend in settings['frontends']:
- frontends.append(frontendBuilder.FrontendBuilder(frontend, loadSettings('frontend', frontend), repository.version()))
+ normalizedFrontendName = frontend.replace(".", "_")
+ builderModuleName = normalizedFrontendName + 'Builder'
+ builderClassName = normalizedFrontendName.title() + 'Builder'
+
+ #print ("BUILD FRONTEND - module: " + builderModuleName + " , class: " + builderClassName)
+ builderModule = __import__(builderModuleName)
+ builderClass = getattr(builderModule, builderClassName)
+ builder = builderClass(frontend, loadSettings('frontend', frontend), repository.version())
+ #builder = frontendBuilder.FrontendBuilder(frontend, loadSettings('frontend', frontend), repository.version())
+ frontends.append(builder)
for backend in settings['backends']:
assembleBackend(backend, frontends, settings['versions'])
@@ -113,17 +125,18 @@ def usage (message):
# print "build clean"
# print "build clean install"
print "build install --ALL"
print "build install debug --ALL"
+ print "build install debug development --ALL"
# print "build clean install debug --ALL"
print "build install debug --backends php python --frontends beta gamma"
print "build install debug development --backends php python --frontends beta gamma gamma.mobile"
exit(1)
#--------------------------------------------------------------------
def allFrontends ():
- return ['beta', 'gamma', 'mobile']
+ return ['beta', 'gamma', 'gamma.mobile']
def allBackends ():
return ['php', 'python']
@@ -133,8 +146,9 @@ def main ():
settings = {}
parameters = list(itertools.islice(sys.argv, 1, None))
sys.path.append(os.path.join(scriptDir(), 'backends'))
+ sys.path.append(os.path.join(scriptDir(), 'frontends'))
currentRepository = repository.repositoryWithPath(projectBaseDir())
clean()
versions = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters))
@@ -173,5 +187,5 @@ def main ():
usage("Suggestions on how to call the 'build' script:")
if __name__ == "__main__":
- main()
+ main()