Login Register

Custom build artifact location

I am looking into doing a custom build of dojo. We have several
projects that include dojo and I would like to have separate builds for
each project.

We use subversion as our source control system and currently have a
single "framework" repository that stores the current version of dojo
(plus our patches till they are accepted) and our own custom widgets
and classes. The other projects use svn:externals to pull in dojo,
dijit, dojox, and judo.

scripts\dojo
scripts\dijit
scripts\dojox
scripts\judo

The problem that I'm running into is that the builds replace the
dojo.js and the layer files reside in the dojo/dijit/dojox
(svn:external) folders. This doesn't allow for me to have separate
builds for each project. What I would like is to be able to have my
built files outside the "dojo" folders. In my example maybe have the
built files directly in the scripts folder, but keeping the files that
are not part of the build that are "dojo.require()" still be pulled
from the correct "dojo" folder.

Is this or something like it currently possible?

Thanks
Mike

More information

Here is my current process:

Before the first build takes place, create a copy of the original dojo/dojo.js file and call it dojo/dojo.js.base.js as the build process replaces the original.

Below are my build.cmd and profile scripts. The layers folder and files are is created fine, however the _preloadLocalizations line at the bottom of the foo.js layer file is invalid:

dojo.i18n._preloadLocalizations("dojo.nls.", ["xx", "ROOT", "en", "en-us"]);

If I change that line to the following, everything works great...

dojo.i18n._preloadLocalizations("layers.nls.foo", ["xx", "ROOT", "en", "en-us"]);

This allows me to have a single pristine copy (except for base built into dojo.js) of dojo/dijit/dojox that can be included as svn:externals into each of our projects, and have each of the projects define how they want their layers defined.

Thanks again...
schallm

build.cmd

copy dojo\dojo.js.base.js dojo\dojo.js
cd util\buildscripts
call build.bat action=release copyTests=false profileFile=..\..\foo.profile.js localeList=en-us
cd ..\..
copy release\dojo\dojo\dojo.* dojo\dojo.*
rd /S /Q release

foo.profile.js

dependencies = {
    layers: [
        {
            name: "dojo.js",
            dependencies: [
            ]
        },
        {
            name: "../../../layers/foo.js",
            layerDependencies: [
                "dojo.js"
            ],
            dependencies: [
                "dojo.number",
                "dojo.date",
                "dojo.date.locale"
            ]
        }
    ],

    prefixes: [
        [ "dijit", "../dijit" ],
        [ "dojox", "../dojox" ]
    ]
}

If the layers use dojo.i18n

If the layers use dojo.i18n resources, then the layer files need to be in a prefix directory, in order for the "nls.name" logical names to be correctly converted to nls/name paths. Looks like your build profile specifies a prefix directory for dijit and dojox, so for that build profile, the layers will need to be in either dojo, dijit or dojox.

Maybe register [ "foo", "../foo"] with dependencies.prefixes in the build profile and change the layer name to "../foo/foo.js". Does that help? That way, any layers for the foo project would go in the releases/dojo/foo folder. You could create a different directory/prefix for each project, even if ../foo does not exist. Does that work?

Also, you do not need to put in the dojo.js layer in your build profile -- it is assumed. Only do that if you want to include other things in dojo.js when building.

I still do not quite follow your build process, but another option is to do a custom build for each project? You can specify a releaseName=bar to the build command, and that will create a releases/bar dir with a dojo, dijit and dojox directory under there.

Need help

Hi jburke,
I hope you are doing well.I need your help regarding Dojo Custom build.I am playing with Dojo Grid,so need a reference of quiet number of js files.

build.cmd

cd util/buildscripts

build.bat profile=foo action=release

foo.profile.js

dependencies ={

layers: [
{
name: "dojo.js",
dependencies: [
]
},
{
name: "../../../layers/foo.js",
layerDependencies: [
"dojo.js"
],
dependencies: [
"dojo.data.ItemFileReadStore",
"dojo.data.ItemFileWriteStore",
"dojox.grid.Grid",
"dojox.grid._data.model",
"dojo.parser",
"dijit.form.ComboBox",
"dojo.data.util.filter",
"dojo.data.util.simpleFetch",
"dojo.date.stamp",
"dojox.grid.VirtualGrid",
"dojox.grid._data.editors",
"dojox.grid._data.fields",
"dijit.form.ValidationTextBox",
"dijit.form.nls.ComboBox",
"dojo.data.util.sorter",
"dojox.grid._grid.lib",
"dojox.grid._grid.scroller",
"dojox.grid._grid.view",
"dojox.grid._grid.views",
"dojox.grid._grid.layout",
"dojox.grid._grid.rows",
"dojox.grid._grid.focus",
"dojox.grid._grid.selection",
"dojox.grid._grid.edit",
"dojox.grid._grid.rowbar",
"dojox.grid._grid.publicEvents",
"dijit.form.TextBox",
"dijit.Tooltip",
"dijit.form.nls.validate",
"dijit._Widget",
"dijit._Templated",
"dojox.grid._grid.builder",
"dojox.grid._grid.cell",
"dijit.form._FormWidget",
"dijit._base",
"dojo.string",
"dojox.grid._grid.drag",
"dijit._base.focus",
"dijit._base.manager",
"dijit._base.place",
"dijit._base.popup",
"dijit._base.scroll",
"dijit._base.sniff",
"dijit._base.bidi",
"dijit._base.typematic",
"dijit._base.wai",
"dijit._base.window"

]
}
],
prefixes: [
[ "dojo", "../dojo" ],
[ "dojox", "../dojox" ],
[ "dijit", "../dijit" ],
[ "layers", "../layers" ]

]
};

I got this error. Could not load 'dojo.i18n'; last tried

I am not able to solve this problem.Please suggest me.

Thanks in advance for your valuable time and effort.

Thanks & Regards,
Abhay

This error occurs because

This error occurs because the layer file is being outside a prefix directory. The build system needs a prefix directory to store the layer since it also stores some i18n bundles with it.

I think if you just modify the build layerName to be "../layers/foo.js" that might work.

Thanks a ton

Hi jburke,
Thanks for your quick reply.As I am completely new to Dojo Toolkit,so facing some difficulties regarding custom build.

Let me explain what exactly I did for Dojo Custom build.

I have downloaded dojo-release-1.1.0-src.zip from the site http://download.dojotoolkit.org/release-1.1.0/

After extracting there are 4 folders...

dijit
dojo
dojox
util

So then in \util\buildscripts\profiles directory I put my profile js i.e. foo.profile.js that I have mentioned above.

As I am using layers prefixes directory,so please correct me if I am wrong.In that case I created a folder i.e. layers in \util\layers directory.

then in profile js file I have changed the layer name as ../layers/foo.js and also copied i18n.js file in layers directory

and tried to execute it.

I got the following error

release: Building dojo.js and layer files
js: "../../dojo/_base/_loader/loader.js", line 327: exception from uncaught Java
Script throw: Error: Could not load 'dojo.i18n'; last tried '../../release/dojo/
dojo/i18n.js'

So kind of you,please go through it and let me know where exactly I am missing.

Thanks in advance.

Thanks & Regards,
Abhay

It works!

Adding a prefix for layers worked great. Many thanks!

foo.profile.js

dependencies = {
    layers: [
        {
            name: "dojo.js",
            dependencies: [
            ]
        },
        {
            name: "../../../layers/foo.js",
            layerDependencies: [
                "dojo.js"
            ],
            dependencies: [
                "dojo.number",
                "dojo.date",
                "dojo.date.locale"
            ]
        }
    ],

    prefixes: [
        [ "dijit", "../dijit" ],
        [ "dojox", "../dojox" ],
        [ "layers", "../layers" ]
    ]
}