author | Clipperz <info@clipperz.com> | 2013-01-08 15:12:19 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-08 15:12:19 (UTC) |
commit | 25bd3085c5464862172c5bd921deca550185fe83 (patch) (unidiff) | |
tree | 2ea95bdd3606e9721fac81ab072d093fd46005fe /scripts/builder/backendBuilder.py | |
parent | 596e94dca490619acced2e38fb3221cc7237b1ce (diff) | |
download | clipperz-25bd3085c5464862172c5bd921deca550185fe83.zip clipperz-25bd3085c5464862172c5bd921deca550185fe83.tar.gz clipperz-25bd3085c5464862172c5bd921deca550185fe83.tar.bz2 |
Updated builder script
Diffstat (limited to 'scripts/builder/backendBuilder.py') (more/less context) (ignore whitespace changes)
-rw-r--r-- | scripts/builder/backendBuilder.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index 5b91678..36b28ca 100644 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py | |||
@@ -4,17 +4,16 @@ | |||
4 | import sys, os, json | 4 | import sys, os, json |
5 | import shutil | 5 | import shutil |
6 | import hashlib | 6 | import hashlib |
7 | 7 | ||
8 | import main | 8 | import main |
9 | 9 | ||
10 | #=================================================================== | 10 | #=================================================================== |
11 | 11 | ||
12 | |||
13 | class BackendBuilder(object): | 12 | class BackendBuilder(object): |
14 | 13 | ||
15 | def __init__ (self, projectTargetDir, frontends, versions, settings): | 14 | def __init__ (self, projectTargetDir, frontends, versions, settings): |
16 | self.projectTargetDir = projectTargetDir | 15 | self.projectTargetDir = projectTargetDir |
17 | self.frontends = frontends | 16 | self.frontends = frontends |
18 | self.versions = versions | 17 | self.versions = versions |
19 | self.settings = settings | 18 | self.settings = settings |
20 | 19 | ||
@@ -45,20 +44,22 @@ class BackendBuilder(object): | |||
45 | return os.path.join(self.projectTargetDir, '.tmp', self.relativePath()) | 44 | return os.path.join(self.projectTargetDir, '.tmp', self.relativePath()) |
46 | 45 | ||
47 | 46 | ||
48 | def frontEndTempFolder (self): | 47 | def frontEndTempFolder (self): |
49 | return self.tempFolder() | 48 | return self.tempFolder() |
50 | 49 | ||
51 | 50 | ||
52 | def developmentTargetFolder (self): | 51 | def developmentTargetFolder (self): |
53 | return os.path.join(self.projectTargetDir, 'development', self.relativePath()) | 52 | return os.path.join(self.projectTargetDir, 'development') |
53 | |||
54 | 54 | ||
55 | def targetFolder (self): | 55 | def targetFolder (self): |
56 | return os.path.join(self.projectTargetDir, self.relativePath()) | 56 | return os.path.join(self.projectTargetDir, self.relativePath()) |
57 | |||
57 | 58 | ||
58 | # -------------------------------------------------------------------------- | 59 | # -------------------------------------------------------------------------- |
59 | 60 | ||
60 | def writeToFolder (self, folder, filename, content): | 61 | def writeToFolder (self, folder, filename, content): |
61 | file = open(os.path.join(folder, filename), 'w') | 62 | file = open(os.path.join(folder, filename), 'w') |
62 | file.write(content.encode('utf-8')) | 63 | file.write(content.encode('utf-8')) |
63 | file.close() | 64 | file.close() |
64 | 65 | ||
@@ -98,34 +99,36 @@ class BackendBuilder(object): | |||
98 | 99 | ||
99 | main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) | 100 | main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) |
100 | 101 | ||
101 | if 'debug' in self.versions: | 102 | if 'debug' in self.versions: |
102 | frontend.copyResourcesToFolder(self.frontEndTempFolder()) | 103 | frontend.copyResourcesToFolder(self.frontEndTempFolder()) |
103 | 104 | ||
104 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG')) | 105 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG')) |
105 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index) | 106 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index) |
106 | 107 | ||
107 | if 'install' in self.versions: | 108 | if 'install' in self.versions: |
108 | index = self.configureIndexContent(frontend.assemble()) | 109 | index = self.configureIndexContent(frontend.assemble()) |
109 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) | 110 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) |
110 | 111 | ||
111 | self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") | 112 | self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") |
112 | 113 | ||
113 | self.createPackage() | 114 | self.createPackage() |
114 | 115 | ||
115 | if 'development' in self.versions: | 116 | # if 'development' in self.versions: |
116 | for frontend in self.frontends: | 117 | # for frontend in self.frontends: |
117 | if (frontend.module == frontend.submodule): | 118 | # if (frontend.module == frontend.submodule): |
118 | submoduleExtension = '' | 119 | # submoduleExtension = '' |
119 | else: | 120 | # else: |
120 | submoduleExtension = '.' + frontend.submodule | 121 | # submoduleExtension = '.' + frontend.submodule |
121 | 122 | # | |
122 | print "FRONTEND module: " + frontend.module | 123 | # print "FRONTEND module: " + frontend.module |
123 | print "FRONTEND submodule: " + frontend.submodule | 124 | # print "FRONTEND submodule: " + frontend.submodule |
124 | 125 | # | |
125 | main.createFolder(os.path.join(self.developmentTargetFolder(), frontend.module)) | 126 | ## main.createFolder(os.path.join(self.developmentTargetFolder(), frontend.module)) |
126 | 127 | # main.createFolder(self.developmentTargetFolder()) | |
127 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEVELOPMENT', versionType='DEBUG'), self.settings['development.settings']['url']) | 128 | # |
128 | self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) | 129 | # index = self.configureIndexContent(frontend.assemble(assemblyMode='DEVELOPMENT', versionType='DEBUG'), self.settings['development.settings']['url']) |
130 | ## self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index_development' + submoduleExtension + '.html'), index) | ||
131 | # self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module + submoduleExtension + '.html'), index) | ||
129 | 132 | ||
130 | 133 | ||
131 | #=================================================================== | 134 | #=================================================================== |