Build your customization dojo
来源:互联网 发布:淘宝解锁id的原理 编辑:程序博客网 时间:2024/05/12 07:57
1. Download the src version dojo from dojo's offical site.
http://download.dojotoolkit.org/release-1.5.0/dojo-release-1.5.0-src.zip
2. Make sure you have already install the Ant successfully. The version should bigger than 1.7.
3. Update the build.xml according the definition xml.
The core definition is already be marked as red.
<project name="DojoWAR" default="production" basedir=".">
<!-- The directory where build artifacts are created -->
<property name="dir.build" location="build"/>
<!-- The directory where the war file will be placed -->
<property name="dir.dist" location="${dir.build}/dist"/>
<target name="production" depends="buildDojoProfile, generateDistributable"/>
<target name="generateDistributable"
description="Builds the distributable Dojo War file">
<!-- Build up the WAR -->
<mkdir dir="${basedir}/temp"/>
<mkdir dir="${basedir}/build/dist"/>
<war destfile="${dir.dist}/DojoWEB.war" >
<zipfileset dir="${basedir}/WebContent/" includes="**/**" />
</war>
</target>
<target name="buildDojoProfile">
<property name="dir.profile"
location="${basedir}/dojo-release-1.5.0-src"/>
<echo message="Building Dojo profile..."/>
<!-- Start the profile build by forking a java process to run ShrinkSafe -->
<java fork="true"
dir="${dir.profile}/util/buildscripts"
classname="org.mozilla.javascript.tools.shell.Main">
<classpath>
<pathelement location="${dir.profile}/util/shrinksafe/js.jar"/>
<pathelement location="${dir.profile}/util/shrinksafe/shrinksafe.jar"/>
</classpath>
<arg value="${dir.profile}/util/buildscripts/build.js"/>
<arg value="version=1.5.0"/>
<arg value="profileFile=${dir.profile}/util/buildscripts/profiles/baseplus.profile.js"/>
<arg value="action=release"/>
<arg value="optimize=shrinksafe"/>
<arg value="cssOptimize=comments.keepLines"/>
</java>
<!-- remove unused Dojo files and directories -->
<!-- that we don't want to include -->
<delete includeemptydirs="true">
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/tests/**/"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/demos/**/"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="util/**"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/*.psd"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/*.fla"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/*.svg"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/*.as"/>
<fileset dir="${dir.profile}/release/dojo/dojo" includes="**/*.swf"/>
<fileset dir="${dir.profile}/release/dojo/dijit/themes/"
includes="**/themeTester*"/>
<fileset dir="${dir.profile}/release/dojo/" includes="**/*.uncompressed.js"/>
</delete>
<copy toDir="${basedir}/WebContent/">
<fileset dir="${dir.profile}/release/dojo" excludes="**/util/**" />
</copy>
</target>
<!-- Simple cleanup -->
<target name="clean" description="Cleans out build files">
<delete dir="${dir.build}"/>
<delete dir="${basedir}/WebContent/dijit"/>
<delete dir="${basedir}/WebContent/dojo"/>
<delete dir="${basedir}/WebContent/dojox"/>
<delete file="${basedir}/WebContent/dojo_extraction_revision.txt"/>
<delete file="${basedir}/WebContent/dojo_extraction.log"/>
<delete file="${basedir}/WebContent/version.txt"/>
</target>
</project>
4. You can write your own definition like below. Put your required components to the definition file.
It already be marked as red.
dependencies = {
layers: [
{
// This is a specially named layer, literally 'dojo.js'
// adding dependencies to this layer will include the modules
// in addition to the standard dojo.js base APIs.
name: "dojo.js",
dependencies: [
"dijit.form.ValidationTextBox",
"dijit.form.FilteringSelect",
"dijit.form.DateTextBox",
"dijit.Tooltip",
"dijit.form.Button"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
}
5. Run Ant in the folder.
- Build your customization dojo
- Build your Dojo-based Javascript Application and deployed via CDN
- Customization
- Customization
- Customization
- Dojo Build系统介绍
- install dojo build system
- (十) Advanced Build Customization(高级构建定制)(完)
- Dojo 的 build 工具简介
- Dojo 的 build 工具简介
- Dojo 的 build 工具简介
- Dojo 1.9 Build 的误区
- 关于dojo的build系统
- Dojo 的 build 工具简介
- Build Your Own Website
- Build Your Own Images
- Configure Your Build
- WOJ1402-Build Your Home
- 两种实现Toast 的例子(图片&文字)
- 生产环境系统负载测试
- IT从业人员注意
- netlink2
- java 二叉树
- Build your customization dojo
- vc ini 读写
- OnDraw和OnPaint
- F#入门-第五章 F#开发实例-第三节 最好知道的注意事项
- 今天的生活是你昨天努力的结果
- #和##在宏替换中的作用
- 云计算与网格计算的区别
- 项目管理实例
- vsftpd :could not bind listening IPv4 socket