This page teaches you how to compile your own javascript
source.
Before you begin
You need to get dojo source code, btt source code and btt.profile.js
from BTTInstallpackaging/lib/JSsource.
And make sure
two things:
- Configure JAVA_HOME in the jre environment variable.
- Two important subfolders are included in dojo source code folder,
/util/buildscripts and /util/shrinksafe.
Procedure
- Copy btt.profile.js and btt source code to the same directory
of dojo source code folder.
The table below
lists several variables in btt.profile.js file with relative descriptions
.
Option |
Description |
name |
the name of the generated file |
dependencies |
the dependent dojo package |
layerDependencies |
the dependent js file, used to delete repeated code |
prefixed |
set the directory of prefixes |
- Then open util\buildscripts\jslib\i18nUtil.js file and
edit the 66th line to fix custom code i18n exception.
original:var requireStatements = fileContents.match(/dojo\.requireLocalization\(.*\)\;/g);
if(requireStatements){
eval(requireStatements.join(";"));
edited:var requireStatements = fileContents.match(/dojo\.requireLocalization\(.*\)\;/g);
if(/com\.ibm\.btt/.test(fileContents)) {
requireStatements = null;
}
if(requireStatements){
eval(requireStatements.join(";"));
- Start dos and input the following command.
- cd C:\jsBuild\util\buildscripts
- build.bat profile=../../../btt action=release releaseName=btt
optimize=shrinksafe removeDefaultNameSpaces=true
Option |
Description |
profile=../../../btt |
to configure the location of files. The root directory is
\util\buildscripts\. |
action=release |
the compression directory |
releaseName=btt |
the package name after compression |
optimize=shrinksafe |
the way to compress |
removeDefaultNameSpaces=true |
set the value to true to fix the exception of Can't serialize
DOM nodes |
- And finally, compare with previous dojo package and remove
useless files.
- Remain: com package which contains the compressed dojo file,
nls js file, resource package/css, picture