author | Antonio Lima <anto87@gmail.com> | 2011-10-05 08:24:32 (UTC) |
---|---|---|
committer | Antonio Lima <anto87@gmail.com> | 2011-10-05 08:24:32 (UTC) |
commit | 2a98e81b954ab84efc8d3f4e1d837bf190f77d7d (patch) (unidiff) | |
tree | 8aa49a97a01d40737fbd8fa5c1f519f7a26d607b | |
parent | 3065be1b71e4c40428cfa192de560c970ba7f8b3 (diff) | |
download | clipperz-2a98e81b954ab84efc8d3f4e1d837bf190f77d7d.zip clipperz-2a98e81b954ab84efc8d3f4e1d837bf190f77d7d.tar.gz clipperz-2a98e81b954ab84efc8d3f4e1d837bf190f77d7d.tar.bz2 |
Fixing python path of builder scripts for environment support
-rw-r--r-- | scripts/builder/backendBuilder.py | 2 | ||||
-rw-r--r-- | scripts/builder/frontendBuilder.py | 2 | ||||
-rwxr-xr-x | scripts/builder/main.py | 4 | ||||
-rw-r--r-- | scripts/builder/phpBuilder.py | 2 | ||||
-rw-r--r-- | scripts/builder/pythonBuilder.py | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index f5dc7b2..16dbe2f 100644 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py | |||
@@ -1,33 +1,33 @@ | |||
1 | #!/usr/bin/python | 1 | #!/usr/bin/env python |
2 | # -*- coding: UTF-8 -*- | 2 | # -*- coding: UTF-8 -*- |
3 | 3 | ||
4 | import sys, os, json | 4 | import sys, os, json |
5 | import shutil | 5 | import shutil |
6 | import main | 6 | import main |
7 | import hashlib | 7 | import hashlib |
8 | 8 | ||
9 | class BackendBuilder: | 9 | class BackendBuilder: |
10 | 10 | ||
11 | def __init__ (self, projectTargetDir, frontends, versions, settings): | 11 | def __init__ (self, projectTargetDir, frontends, versions, settings): |
12 | self.projectTargetDir = projectTargetDir | 12 | self.projectTargetDir = projectTargetDir |
13 | self.frontends = frontends | 13 | self.frontends = frontends |
14 | self.versions = versions | 14 | self.versions = versions |
15 | self.settings = settings | 15 | self.settings = settings |
16 | 16 | ||
17 | def name (self): | 17 | def name (self): |
18 | raise NotImplementedError() | 18 | raise NotImplementedError() |
19 | 19 | ||
20 | def relativePath (self): | 20 | def relativePath (self): |
21 | raise NotImplementedError() | 21 | raise NotImplementedError() |
22 | 22 | ||
23 | def compileCode (self): | 23 | def compileCode (self): |
24 | pass | 24 | pass |
25 | 25 | ||
26 | def copyCompiledCodeToTargetDir (self): | 26 | def copyCompiledCodeToTargetDir (self): |
27 | src = self.sourceFolder() | 27 | src = self.sourceFolder() |
28 | dst = self.targetFolder() | 28 | dst = self.targetFolder() |
29 | main.createFolder(os.path.dirname(dst)) | 29 | main.createFolder(os.path.dirname(dst)) |
30 | shutil.copytree(src, dst) | 30 | shutil.copytree(src, dst) |
31 | 31 | ||
32 | def sourceFolder (self): | 32 | def sourceFolder (self): |
33 | return main.projectBaseDir() + '/backend/' + self.relativePath() + '/src' | 33 | return main.projectBaseDir() + '/backend/' + self.relativePath() + '/src' |
diff --git a/scripts/builder/frontendBuilder.py b/scripts/builder/frontendBuilder.py index b796438..55054ee 100644 --- a/scripts/builder/frontendBuilder.py +++ b/scripts/builder/frontendBuilder.py | |||
@@ -1,33 +1,33 @@ | |||
1 | #!/usr/bin/python | 1 | #!/usr/bin/env python |
2 | # -*- coding: UTF-8 -*- | 2 | # -*- coding: UTF-8 -*- |
3 | 3 | ||
4 | import sys, os, re | 4 | import sys, os, re |
5 | import cssmin | 5 | import cssmin |
6 | import jsmin | 6 | import jsmin |
7 | import codecs | 7 | import codecs |
8 | import shutil | 8 | import shutil |
9 | import StringIO | 9 | import StringIO |
10 | import urllib | 10 | import urllib |
11 | 11 | ||
12 | #from mercurial import ui, hg | 12 | #from mercurial import ui, hg |
13 | #from mercurial.node import hex | 13 | #from mercurial.node import hex |
14 | from dulwich.repo import Repo | 14 | from dulwich.repo import Repo |
15 | 15 | ||
16 | import main | 16 | import main |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | class FrontendBuilder: | 20 | class FrontendBuilder: |
21 | 21 | ||
22 | def __init__ (self, frontend, settings): | 22 | def __init__ (self, frontend, settings): |
23 | if '.' in frontend: | 23 | if '.' in frontend: |
24 | moduleComponents = frontend.split('.') | 24 | moduleComponents = frontend.split('.') |
25 | self.module = moduleComponents[0] | 25 | self.module = moduleComponents[0] |
26 | self.submodule = moduleComponents[1] | 26 | self.submodule = moduleComponents[1] |
27 | else: | 27 | else: |
28 | self.module = frontend | 28 | self.module = frontend |
29 | self.submodule = frontend | 29 | self.submodule = frontend |
30 | 30 | ||
31 | self.settings = settings | 31 | self.settings = settings |
32 | self.projectDir = main.projectBaseDir() | 32 | self.projectDir = main.projectBaseDir() |
33 | self.processedFiles = {} | 33 | self.processedFiles = {} |
diff --git a/scripts/builder/main.py b/scripts/builder/main.py index ba0c72a..94f738f 100755 --- a/scripts/builder/main.py +++ b/scripts/builder/main.py | |||
@@ -1,33 +1,33 @@ | |||
1 | #!/usr/bin/python | 1 | #!/usr/bin/env python |
2 | # -*- coding: UTF-8 -*- | 2 | # -*- coding: UTF-8 -*- |
3 | 3 | ||
4 | import sys, os, json | 4 | import sys, os, json |
5 | import shutil | 5 | import shutil |
6 | import pprint | 6 | import pprint |
7 | import frontendBuilder | 7 | import frontendBuilder |
8 | import codecs | 8 | import codecs |
9 | import itertools | 9 | import itertools |
10 | 10 | ||
11 | from collections import deque | 11 | from collections import deque |
12 | from phpBuilder import PhpBuilder | 12 | from phpBuilder import PhpBuilder |
13 | from pythonBuilder import PythonBuilder | 13 | from pythonBuilder import PythonBuilder |
14 | 14 | ||
15 | pp = pprint.PrettyPrinter(indent=4, depth=4) | 15 | pp = pprint.PrettyPrinter(indent=4, depth=4) |
16 | 16 | ||
17 | #-------------------------------------------------------------------- | 17 | #-------------------------------------------------------------------- |
18 | 18 | ||
19 | def scriptDir (): | 19 | def scriptDir (): |
20 | return os.path.dirname(sys.argv[0]) | 20 | return os.path.dirname(sys.argv[0]) |
21 | 21 | ||
22 | def projectBaseDir (): | 22 | def projectBaseDir (): |
23 | return os.path.abspath(scriptDir() + '/../..') | 23 | return os.path.abspath(scriptDir() + '/../..') |
24 | 24 | ||
25 | def projectTargetDir(): | 25 | def projectTargetDir(): |
26 | return projectBaseDir() + '/target/' | 26 | return projectBaseDir() + '/target/' |
27 | 27 | ||
28 | #-------------------------------------------------------------------- | 28 | #-------------------------------------------------------------------- |
29 | 29 | ||
30 | def createFolder (path): | 30 | def createFolder (path): |
31 | if not os.path.exists(path): | 31 | if not os.path.exists(path): |
32 | os.makedirs(path) | 32 | os.makedirs(path) |
33 | 33 | ||
@@ -134,33 +134,33 @@ def main (): | |||
134 | if len(parameters) > 0: | 134 | if len(parameters) > 0: |
135 | parameter = parameters.popleft() | 135 | parameter = parameters.popleft() |
136 | if parameter == "--ALL": | 136 | if parameter == "--ALL": |
137 | settings['frontends'] = ['beta', 'gamma', 'mobile'] | 137 | settings['frontends'] = ['beta', 'gamma', 'mobile'] |
138 | settings['backends'] = ['php', 'python', 'java'] | 138 | settings['backends'] = ['php', 'python', 'java'] |
139 | else: | 139 | else: |
140 | while parameter != None: | 140 | while parameter != None: |
141 | values = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) | 141 | values = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) |
142 | 142 | ||
143 | if parameter == "--backends": | 143 | if parameter == "--backends": |
144 | settings['backends'] = values | 144 | settings['backends'] = values |
145 | elif parameter == "--frontends": | 145 | elif parameter == "--frontends": |
146 | settings['frontends'] = values | 146 | settings['frontends'] = values |
147 | 147 | ||
148 | parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters)) | 148 | parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters)) |
149 | if parameters: | 149 | if parameters: |
150 | parameter = parameters.popleft() | 150 | parameter = parameters.popleft() |
151 | else: | 151 | else: |
152 | parameter = None | 152 | parameter = None |
153 | 153 | ||
154 | if (not settings.has_key('versions')): | 154 | if (not settings.has_key('versions')): |
155 | usage("missing 'versions'") | 155 | usage("missing 'versions'") |
156 | if (not settings.has_key('frontends')): | 156 | if (not settings.has_key('frontends')): |
157 | usage("missing 'frontends'") | 157 | usage("missing 'frontends'") |
158 | if (not settings.has_key('backends')): | 158 | if (not settings.has_key('backends')): |
159 | usage("missing 'backends'") | 159 | usage("missing 'backends'") |
160 | 160 | ||
161 | build (settings) | 161 | build (settings) |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | if __name__ == "__main__": | 165 | if __name__ == "__main__": |
166 | main() \ No newline at end of file | 166 | main() |
diff --git a/scripts/builder/phpBuilder.py b/scripts/builder/phpBuilder.py index 9512192..cb4661d 100644 --- a/scripts/builder/phpBuilder.py +++ b/scripts/builder/phpBuilder.py | |||
@@ -1,14 +1,14 @@ | |||
1 | #!/usr/bin/python | 1 | #!/usr/bin/env python |
2 | # -*- coding: UTF-8 -*- | 2 | # -*- coding: UTF-8 -*- |
3 | 3 | ||
4 | from backendBuilder import BackendBuilder | 4 | from backendBuilder import BackendBuilder |
5 | 5 | ||
6 | class PhpBuilder(BackendBuilder): | 6 | class PhpBuilder(BackendBuilder): |
7 | 7 | ||
8 | def name(self): | 8 | def name(self): |
9 | return "PHP builder" | 9 | return "PHP builder" |
10 | 10 | ||
11 | def relativePath(self): | 11 | def relativePath(self): |
12 | return 'php' | 12 | return 'php' |
13 | 13 | ||
14 | 14 | ||
diff --git a/scripts/builder/pythonBuilder.py b/scripts/builder/pythonBuilder.py index 44c62a8..a84598d 100644 --- a/scripts/builder/pythonBuilder.py +++ b/scripts/builder/pythonBuilder.py | |||
@@ -1,14 +1,14 @@ | |||
1 | #!/usr/bin/python | 1 | #!/usr/bin/env python |
2 | # -*- coding: UTF-8 -*- | 2 | # -*- coding: UTF-8 -*- |
3 | 3 | ||
4 | from backendBuilder import BackendBuilder | 4 | from backendBuilder import BackendBuilder |
5 | 5 | ||
6 | class PythonBuilder(BackendBuilder): | 6 | class PythonBuilder(BackendBuilder): |
7 | 7 | ||
8 | def name(self): | 8 | def name(self): |
9 | return "Python builder" | 9 | return "Python builder" |
10 | 10 | ||
11 | def relativePath(self): | 11 | def relativePath(self): |
12 | return 'python' | 12 | return 'python' |
13 | 13 | ||
14 | 14 | ||