Changeset 12119
- Timestamp:
- 01/21/08 20:42:32 (6 months ago)
- Location:
- util/trunk/buildscripts
- Files:
-
- 3 modified
-
build.js (modified) (1 diff)
-
jslib/buildUtil.js (modified) (3 diffs)
-
jslib/dojoGuardStart.jsfrag (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
util/trunk/buildscripts/build.js
r12009 r12119 130 130 } 131 131 nlsIgnoreString += (nlsIgnoreString ? "|" : "") + buildUtil.regExpEscape(nameSegment); 132 133 132 133 //Burn in djConfig for dojo.js/xd.js if requested. 134 if(kwArgs.scopeDjConfig && (layerName.match(/dojo\.xd\.js$/) || layerName.match(/dojo\.js$/))){ 135 fileContents = buildUtil.setScopeDjConfig(fileContents, kwArgs.scopeDjConfig); 136 } 137 134 138 //Burn in scope names for dojo.js/xd.js if requested. 135 139 if(kwArgs.scopeMap && (layerName.match(/dojo\.xd\.js$/) || layerName.match(/dojo\.js$/))){ -
util/trunk/buildscripts/jslib/buildUtil.js
r12009 r12119 93 93 + "short symbol names to more descriptive names." 94 94 }, 95 "scopeDjConfig": { 96 defaultValue: "", 97 helpText: "Burn in a djConfig object into the built dojo.js file. Useful if you are making your own scoped dojo and you want a " 98 + "djConfig object local to your version that will not be affected by any globally declared djConfig object in the page. " 99 + "Value must be a string that will look like a javascript object literal once it is placed in the built source. " 100 + "use Dojo as part of a JS library, but want to make a self-contained library with no external dojo/dijit/dojox. Example " 101 + "(note that the backslashes below are required to avoid shell escaping if you type this on the command line):\n" 102 + "scopeDjConfig={isDebug:true,scopeMap:[[\\\"dojo\\\",\\\"mydojo\\\"],[\\\"dijit\\\",\\\"mydijit\\\"][\\\"dojox\\\",\\\"mydojox\\\"]]}" 103 }, 95 104 "scopeMap": { 96 105 defaultValue: "", … … 99 108 + "references. Format is a string that contains no spaces, and is similar to the djConfig.scopeMap value (note that the " 100 109 + "backslashes below are required to avoid shell escaping):\n" 101 + "scopeMap :[[\\\"dojo\\\",\\\"mydojo\\\"],[\\\"dijit\\\",\\\"mydijit\\\"][\\\"dojox\\\",\\\"mydojox\\\"]]"110 + "scopeMap=[[\\\"dojo\\\",\\\"mydojo\\\"],[\\\"dijit\\\",\\\"mydijit\\\"][\\\"dojox\\\",\\\"mydojox\\\"]]" 102 111 }, 103 112 "xdScopeArgs": { … … 1238 1247 } 1239 1248 1249 buildUtil.setScopeDjConfig = function(/*String*/fileContents, /*String*/djConfigString){ 1250 //summary: burns in a local djConfig for the file contents. 1251 //djConfigString should be a string. 1252 //Have to use eval to avoid name condensing by shrinksafe. 1253 return fileContents.replace(/\/\*\*Build will replace this comment with a scoped djConfig \*\*\//, 'eval("var djConfig = ' + djConfigString.replace(/(['"])/g, '\\$1') + ';");'); 1254 } 1255 1240 1256 buildUtil.setScopeNames = function(/*String*/fileContents, /*String*/scopeMap){ 1241 1257 //summary: burns in the scope names into the file contents. -
util/trunk/buildscripts/jslib/dojoGuardStart.jsfrag
r12009 r12119 11 11 */ 12 12 13 //The null below can be relaced by a build-time value. 13 /**Build will replace this comment with a scoped djConfig **/ 14 15 //The null below can be relaced by a build-time value used instead of djConfig.scopeMap. 14 16 var sMap = null; 15 17 16 18 //See if new scopes need to be defined. 17 19 if((sMap || (typeof djConfig != "undefined" && djConfig.scopeMap)) && (typeof window != "undefined")){