Fixed build scripts to correctly handle manifest.appcache

This commit is contained in:
Giulio Cesare Solaroli 2015-09-10 15:13:26 +02:00
parent a19c9c6ee4
commit e161d4d46b
8 changed files with 11 additions and 10 deletions

View File

@ -113,7 +113,7 @@ class BackendBuilder(object):
submoduleExtension = '.' + frontend.submodule submoduleExtension = '.' + frontend.submodule
main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module))
frontend.copyResourcesToFolder(self.frontEndTempFolder()) frontend.copyResourcesToFolder(self.frontEndTempFolder(), self.settings)
if 'debug' in self.versions: if 'debug' in self.versions:
frontend.copyDebugResourcesToFolder(self.frontEndTempFolder()) frontend.copyDebugResourcesToFolder(self.frontEndTempFolder())
@ -121,7 +121,7 @@ class BackendBuilder(object):
self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index) self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index)
if 'install' in self.versions: if 'install' in self.versions:
# frontend.copyResourcesToFolder(self.frontEndTempFolder()) # frontend.copyResourcesToFolder(self.frontEndTempFolder(), self.settings)
index = self.configureIndexContent(frontend.assemble()) index = self.configureIndexContent(frontend.assemble())
self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)

View File

@ -42,7 +42,7 @@ class ChecksumBuilder(BackendBuilder):
index = self.configureIndexContent(frontend.assemble()) index = self.configureIndexContent(frontend.assemble())
self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)
frontend.copyResourcesToFolder(self.frontEndTempFolder()) frontend.copyResourcesToFolder(self.frontEndTempFolder(), self.settings)
self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum")
print "" print ""

View File

@ -39,7 +39,7 @@ class DevBuilder(BackendBuilder):
submoduleExtension = '.' + frontend.submodule submoduleExtension = '.' + frontend.submodule
main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module))
frontend.copyResourcesToFolder(self.frontEndTempFolder()) frontend.copyResourcesToFolder(self.frontEndTempFolder(), self.settings)
index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG')) index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG'))
self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)

View File

@ -41,7 +41,7 @@ class FrontendBuilder(object):
# def copyStaticResources (self, targetFolder): # def copyStaticResources (self, targetFolder):
# raise NotImplementedError() # raise NotImplementedError()
def copyResourcesToFolder (self, targetFolder): def copyResourcesToFolder (self, targetFolder, backendSettings):
raise NotImplementedError() raise NotImplementedError()
def preprocessCSS (self, targetFile): def preprocessCSS (self, targetFile):
@ -100,7 +100,7 @@ class FrontendBuilder(object):
# def copyResourcesToFolder (self, targetFolder): # def copyResourcesToFolder (self, targetFolder, backendSettings):
# for resoureceType in self.projectResourceTypes(): # for resoureceType in self.projectResourceTypes():
# self.copyResources(self.projectDir, targetFolder, resoureceType) # self.copyResources(self.projectDir, targetFolder, resoureceType)
# self.copyStaticResources(targetFolder) # self.copyStaticResources(targetFolder)

View File

@ -10,7 +10,7 @@ class BetaBuilder(FrontendBuilder):
return ['js', 'css', 'images'] return ['js', 'css', 'images']
# def copyStaticResources (self, targetFolder): # def copyStaticResources (self, targetFolder):
def copyResourcesToFolder (self, targetFolder): def copyResourcesToFolder (self, targetFolder, backendSettings):
self.copyResources(self.projectDir, targetFolder, 'images') self.copyResources(self.projectDir, targetFolder, 'images')
for file in self.filterFiles(self.settings['staticResources']): for file in self.filterFiles(self.settings['staticResources']):

View File

@ -17,7 +17,7 @@ class DeltaBuilder(FrontendBuilder):
# def copyStaticResources (self, targetFolder): # def copyStaticResources (self, targetFolder):
def copyResourcesToFolder (self, targetFolder): def copyResourcesToFolder (self, targetFolder, backendSettings):
#print "DELTA - copyResourcesToFolder" #print "DELTA - copyResourcesToFolder"
resourcesToCopy = [ resourcesToCopy = [
{'folder': 'properties', 'source': 'manifest.appcache', 'target': 'manifest.appcache'} {'folder': 'properties', 'source': 'manifest.appcache', 'target': 'manifest.appcache'}
@ -27,6 +27,7 @@ class DeltaBuilder(FrontendBuilder):
#print "copying resource: " + str(resource['source']) #print "copying resource: " + str(resource['source'])
content = self.loadFilesContent(resource['folder'], [resource['source']]) content = self.loadFilesContent(resource['folder'], [resource['source']])
content = content.replace('@application.version@', self.repositoryVersion) content = content.replace('@application.version@', self.repositoryVersion)
content = content.replace('@request.path@', backendSettings['request.path'])
dst = self.absolutePathForTargetFile(targetFolder, '', resource['target']) dst = self.absolutePathForTargetFile(targetFolder, '', resource['target'])
file = open(dst, 'w') file = open(dst, 'w')

View File

@ -10,7 +10,7 @@ class GammaBuilder(FrontendBuilder):
return ['js', 'css', 'images'] return ['js', 'css', 'images']
# def copyStaticResources (self, targetFolder): # def copyStaticResources (self, targetFolder):
def copyResourcesToFolder (self, targetFolder): def copyResourcesToFolder (self, targetFolder, backendSettings):
self.copyResources(self.projectDir, targetFolder, 'images') self.copyResources(self.projectDir, targetFolder, 'images')
resourcesToCopy = [ resourcesToCopy = [

View File

@ -9,5 +9,5 @@ class Gamma_MobileBuilder(FrontendBuilder):
return ['js', 'css', 'images'] return ['js', 'css', 'images']
# def copyStaticResources (self, targetFolder): # def copyStaticResources (self, targetFolder):
def copyResourcesToFolder (self, targetFolder): def copyResourcesToFolder (self, targetFolder, backendSettings):
pass pass