author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-17 15:45:39 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-17 15:45:39 (UTC) |
commit | 48c9280c9a255f2a85ad5729830df884e64a9c5d (patch) (side-by-side diff) | |
tree | 14787438153cdc0b4b445c66f046bccf3dd99ee2 /scripts | |
parent | 4ce8041b11afc7f02c678565e0e96e59a5a557b6 (diff) | |
download | clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.zip clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.tar.gz clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.tar.bz2 |
Updated build script to handle 'checksum' target
The build script can now be invoked, for example, with the following options:
> ./scripts/build checksum --frontend beta gamma
-rwxr-xr-x[-rw-r--r--] | scripts/builder/backendBuilder.py | 2 | ||||
-rwxr-xr-x | scripts/builder/backends/checksumBuilder.py | 50 | ||||
-rwxr-xr-x[-rw-r--r--] | scripts/builder/backends/devBuilder.py | 8 | ||||
-rwxr-xr-x | scripts/builder/main.py | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | scripts/builder/repository.py | 0 |
5 files changed, 58 insertions, 9 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index 20b4bd0..b4ee990 100644..100755 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py @@ -87,2 +87,3 @@ class BackendBuilder(object): sha256Digest = self.formatMAC(hashlib.sha256(content.encode('utf-8')).hexdigest()) + print "-----" print message + ": " + md5Digest + " (md5)" @@ -90,2 +91,3 @@ class BackendBuilder(object): print message + ": " + sha256Digest + " (sha256)" + print "=====" diff --git a/scripts/builder/backends/checksumBuilder.py b/scripts/builder/backends/checksumBuilder.py new file mode 100755 index 0000000..5f44c8a --- a/dev/null +++ b/scripts/builder/backends/checksumBuilder.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- + +import os +import shutil +import subprocess +import main + +from backendBuilder import BackendBuilder + +class ChecksumBuilder(BackendBuilder): + + def name(self): + return "Checksum builder" + + + def relativePath(self): + return 'checksum' + + + def compileCode (self): + pass + + + def createPackage (self): + src = self.tempFolder() + dst = self.targetFolder() + + shutil.copytree(src, dst) + + + def run (self): + print self.name() + " - RUN (checksum)" + + for frontend in self.frontends: + if (frontend.module == frontend.submodule): + submoduleExtension = '' + else: + submoduleExtension = '.' + frontend.submodule + + main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) + + index = self.configureIndexContent(frontend.assemble()) + self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) + self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") + print "" + + self.createPackage() + + diff --git a/scripts/builder/backends/devBuilder.py b/scripts/builder/backends/devBuilder.py index 671765e..354e014 100644..100755 --- a/scripts/builder/backends/devBuilder.py +++ b/scripts/builder/backends/devBuilder.py @@ -20,10 +20,2 @@ class DevBuilder(BackendBuilder): -# def frontEndTempFolder (self): -# return os.path.join(self.tempFolder(), 'src', 'main', 'webapp') - - -# def targetFolder (self): -# return self.projectTargetDir - - def compileCode (self): diff --git a/scripts/builder/main.py b/scripts/builder/main.py index b9fe04a..ecdbf6a 100755 --- a/scripts/builder/main.py +++ b/scripts/builder/main.py @@ -154,3 +154,3 @@ def main (): versions = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) - settings['versions'] = versions; #['debug', 'install', 'development'] + settings['versions'] = versions; #['debug', 'install', 'development', 'checksum'] parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters)) @@ -177,2 +177,7 @@ def main (): + if 'checksum' in settings['versions']: + if not 'backends' in settings: + settings['backends'] = [] + settings['backends'].append('checksum') + if (not settings.has_key('versions')): diff --git a/scripts/builder/repository.py b/scripts/builder/repository.py index 2d4a12b..2d4a12b 100644..100755 --- a/scripts/builder/repository.py +++ b/scripts/builder/repository.py |