views:

23

answers:

1

Hi, I am trying to use dojo build system for minification and compressing of all dojo and custom modules into a single javascript file using the untjs.profile.js profile file. The sample code for this profile file is as follows:

dependencies = { layers: [{ name: "dojo.js", customBase: true, discard: true, dependencies: ["dojo.dojo","dojo._base","dojo.parser", "dojo.string", "dojo.cache", "dojo.hash", "dojo.fx", "dojo.widget.*", "dojo.widget.ContentPane", "dojo.date", "dojo.date.stamp", "dojo.cookie", "dojo._base.event", "dojo.date", "dojo.date.stamp", "dojo.fx", "dojo.i18n"]

},     
{
    name: "../dijit/dijit.js",
    resourceName: "dijit",
    dependencies: ["dijit.dijit", "dijit.layout.LayoutContainer", "dijit.Menu", "dijit._KeyNavContainer", "dijit.MenuItem", "dijit.Dialog", "dijit.form.Button", "dijit.layout", "dijit.layout.ContentPane", "dijit.layout.TabContainer", "dijit.form.Textarea", "dijit.form.SimpleTextarea", "dijit.Dialog", "dijit.dijit-all", "dijit.form.SimpleTextarea", "dijit.form._FormWidget", "dijit._Widget", "dijit._Templated", "dijit._base", "dijit._Container", "dijit._HasDropDown", "dijit.layout._TabContainerBase", "dijit.layout.TabController", "dijit.layout.ScrollingTabController", "dijit.layout.StackContainer", "dijit._Templated", "dijit.layout._LayoutWidget", "dijit._Container", "dijit._Contained", "dijit.layout.StackController", "dijit.layout.SplitContainer", "dijit.form.ToggleButton", "dijit.TitlePane"],
    discard: true
}, {
    name: "../dojox/layout/ScrollPane.js",
    resourceName: "dojox.layout.ScrollPane",

layerDependencies: ["dojo.js", "../dijit/dijit.js"], dependencies: ["dojox.layout.ScrollPane"], discard: true }, { name: "../untjs.js", resourceName: "untjs", layerDependencies: ["dojo.js", "../dijit/dijit.js", "../dojox/layout/ScrollPane.js"], dependencies: ["global.init", "global.untconfig", "global.historymanager", "user.cookiedata", "user.registration", "user.auth", "common.animation", "common.category", "common.fields", "common.header", "common.nodes", "common.popup", "common.posttype", "common.timestamp", "common.validation", "common.watermark", "common.category", "page.home", "page.profile", "page.people", "page.terms", "page.about", "page.landing", "page.privacy", "page.template", "xhr.friends", "xhr.suggestions", "xhr.requests", "xhr.categories", "xhr.posts", "xhr.comments", "xhr.terms", "xhr.about", "xhr.userinfo", "xhr.privacy", "xhr.cookieUnT", "xhr.registerUnT", "controls.fbinvite", "controls.friends", "controls.mylikes", "controls.activitystream", "controls.people", "controls.requests", "controls.suggestions", "controls.userinfo", "controls.tellsomethingbox"] }],

prefixes: [["dijit", "../dijit"],["dojox", "../dojox"], ["global", "../../global"], ["page", "../../page"], ["user", "../../user"], ["xhr", "../../xhr"], ["common", "../../common"], ["controls", "../../controls"], ["catalog", "../../catalog"]]

};

But when I am executing the build.bat command in the following way :

build.bat release Name=untjs releaseDir=......\untjs profileFile=......\untjs.profile.js actio n=clean,release optimize=shrinksafe mini=true internStrings=true

I am getting the following error.

rhino load('./../../../untjs/untjs/dojox/grid/nls/DataGrid_ar.js') failed. Excep tion: SyntaxError: syntax error js: "./jslib/i18nUtil.js", line 244: exception from uncaught JavaScript throw: C annot create flattened bundle for src file: ../../../untjs/untjs/dojox/grid/nls/ DataGrid_ar.js

Also I am not understanding why dojo build system is building files(like dojox.grid.datagrid), which I am not at all including in the profile file.

I hope somebody has got an answer to this frustating problem.

Thanks in advance, Ashutosh

A: 

it could be an encoding problem. any chance your jvm is running with some default other than UTF-8? I think the tool should be specifying UTF-8, but if something else were used, this would explain the error.

The optimize setting compresses all files in the tree, not just the layer you're building, so modules like dojox.grid and its nls dependences get processed. Try using layerOptimize instead if you wish to process only your layer file.

peller