[qooxdoo-commit] SF.net SVN: qooxdoo: [10710] branches/legacy_0_7_x/qooxdoo/frontend/ framework/too
Brought to you by:
ecker,
martinwittemann
From: <th...@us...> - 2007-10-30 10:11:44
|
Revision: 10710 http://qooxdoo.svn.sourceforge.net/qooxdoo/?rev=10710&view=rev Author: thron7 Date: 2007-10-30 03:11:42 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Add settings and variant support for build versions (non-parts only). Modified Paths: -------------- branches/legacy_0_7_x/qooxdoo/frontend/framework/tool/generator2.py Modified: branches/legacy_0_7_x/qooxdoo/frontend/framework/tool/generator2.py =================================================================== --- branches/legacy_0_7_x/qooxdoo/frontend/framework/tool/generator2.py 2007-10-30 10:09:26 UTC (rev 10709) +++ branches/legacy_0_7_x/qooxdoo/frontend/framework/tool/generator2.py 2007-10-30 10:11:42 UTC (rev 10710) @@ -88,7 +88,10 @@ from modules import textutil from modules import simplejson from modules import settings -from modules import variants as mvariants +from modules import variants as m_variants +from modules import tokenizer +#from modules import compiler as m_compiler +from modules import treegenerator from generator2 import apidata from generator2 import cachesupport @@ -423,8 +426,11 @@ if buildScript != None or sourceScript != None: + _settings = [] + _variants = [] if execMode == "parts": (pkgIds, pkg2classes, part2pkgs) = partutil.getPackages(partClasses, partBits, includeDict, variants, collapseParts, optimizeLatency) + pParts = True else: # simulate package @@ -432,22 +438,31 @@ pkg2classes = { "1" : includeDict.keys() } + pParts = False if buildScript != None: + _settings.append("qx.isSource:false") + _settings = settings.generate(_settings, True) + _variants = m_variants.generate(_variants, True) + prelude = "".join([_settings, _variants]) + compiledPrelude = compiler._compileClassHelper(treegenerator.createSyntaxTree(tokenizer.parseStream(prelude))) for packageId in pkgIds: console.info("Compiling classes for package %s:" % packageId, False) - packageSize = storeCompiledPackage(pkg2classes[packageId], buildScript, variants, buildProcess, variantSetPos+1) + packageSize, compiledContent = getCompiledPackage(pkg2classes[packageId], variants, buildProcess) + # Saving compiled content + fileId = "%s-%s" % (buildScript, variantSetPos+1) + if not pParts: # it's a simulated package + compiledContent = compiledPrelude + compiledContent + filetool.save(fileId + ".js", compiledContent) console.indent() console.debug("Done: %s" % packageSize) console.outdent() if sourceScript != None: - _settings = [] _settings.append("qx.isSource:true") _settings = settings.generate(_settings, True) - _variants = [] - _variants = mvariants.generate(_variants, True) + _variants = m_variants.generate(_variants, True) for packageId in pkgIds: fileId = "%s-%s-%s.js" % (sourceScript, str(packageId), str(variantSetPos+1)) console.info("Generating source includer for package %s: %s" % (packageId, fileId)) @@ -509,16 +524,13 @@ # COMMON COMPILED PKG SUPPORT ###################################################################### -def storeCompiledPackage(includeDict, packageFileName, variants, buildProcess, variantPos): - fileId = "%s-%s" % (packageFileName, variantPos) +def getCompiledPackage(includeDict, variants, buildProcess): # Compiling classes sortedClasses = deputil.sortClasses(includeDict, variants) compiledContent = compiler.compileClasses(sortedClasses, variants, buildProcess) - # Saving compiled content - filetool.save(fileId + ".js", compiledContent) - return getContentSize(compiledContent) + return getContentSize(compiledContent), compiledContent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |