Diffstat (limited to 'scripts/builder/frontendBuilder.py') (more/less context) (ignore whitespace changes)
-rw-r--r-- | scripts/builder/frontendBuilder.py | 2 |
1 files changed, 1 insertions, 1 deletions
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,97 +1,97 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import sys, os, re import cssmin import jsmin import codecs import shutil import StringIO import urllib #from mercurial import ui, hg #from mercurial.node import hex from dulwich.repo import Repo import main class FrontendBuilder: def __init__ (self, frontend, settings): if '.' in frontend: moduleComponents = frontend.split('.') self.module = moduleComponents[0] self.submodule = moduleComponents[1] else: self.module = frontend self.submodule = frontend self.settings = settings self.projectDir = main.projectBaseDir() self.processedFiles = {} def mercurialRepositoryVersion (self): repo = hg.repository(ui.ui(), self.projectDir) context = repo['tip'] result = str(context) return result def gitRepositoryVersion (self): repo = Repo(self.projectDir) #if repo.is_dirty(): # print "WARNING: build run with dirty repository" result = repo.refs['HEAD'] return result def repositoryVersion (self): cacheKey = 'repositoryVersion' if not self.processedFiles.has_key(cacheKey): #result = self.mercurialRepositoryVersion() result = self.gitRepositoryVersion() self.processedFiles[cacheKey] = result else: result = self.processedFiles[cacheKey] return result #def relativePath (self): # return self.module # def log (self, message): print "frontend [" + self.module + "]: " + message def absolutePathForSourceFile (self, folder, basePath, file): return folder + '/frontend/' + self.module + '/' + basePath + '/' + file def absolutePathForTargetFile (self, folder, basePath, file): return folder + '/' + self.module + '/' + basePath + '/' + file def filterFiles (self, files): result = [] for file in files: if file.startswith('--'): pass else: result.append(file) return result def copyResources (self, sourceFolder, destinationFolder, fileType): for file in self.filterFiles(self.settings[fileType]): src = self.absolutePathForSourceFile(sourceFolder, fileType, file) dst = self.absolutePathForTargetFile(destinationFolder, fileType, file) main.createFolder(os.path.dirname(dst)) |