编辑:我想构建一个ANT脚本并使用YUI我想压缩(缩小)项目中的所有css文件和JavaScript文件并将其整合到一个文件中。
像这样的人做http://heliologue.com/2008/09/22/using-yui-compressor-in-a-web-project/但我不知道如何编写ANT脚本甚至修改build.xml和其他文件。
JSF是使用的服务器技术,它包含1个css文件和1个javascript文件到基于浏览器的呈现的html页面。 (例如:即将获得master_ie.css,master_ie.js; firefox将获得master_ff.css,master_ff.js)
但是css和js文件是用idk编写的,如何解释它查看主文件的示例CSS和JS片段
CSS:
@import './../core/v2.3-global.css';
@import './../core/v2.3-elements-default.css';
@import './../layout/v2.3-layout.css';
@import './../app/v2.3-template-default.css';
@import './../app/v2.3-header.css';
@import './../app/v2.3-leftnav.css';
@import './../app/v2.3-popup.css';
@import './../app/v2.3-footer.css';
@import './../app/v2.3-something-provision-default.css';
@import './../app/v2.3-old-data-grid.css';
@import './../app/v2.3-header-info-container.css';
@import './../app/v2.3-data-summary-default.css';
@import './../app/v2.3-button.css';
@import './../app/v2.3-template-firefox.css';
@import './../core/v2.3-elements-firefox.css';
@import './../app/v2.3-oneclick-provision-firefox.css';
@import './../app/v2.3-data-summary-firefox.css';
@import './../app/v2.3-layout-firefox.css';
@import './../app/v2.3-tree.css' ;
@import './../app/v2.3-extended-datatable-firefox.css';
@import './../app/v2.3-change-cloud-default.css';
@import './../app/v2.3-menu-default.css';
@import './../app/v2.3-user-summary-default.css';
@import './../app/v2.3-user-summary-firefox.css';
@import './../app/v2.3-recent-task-firefox.css';
JS:
document.write("<script type='text/javascript' src='../script/jhashtable.js'></script>");
document.write("<script type='text/javascript' src='../script/action-menu/jquery-top-menu.js'></script>");
document.write("<script type='text/javascript' src='../script/jquery.treeview.js'></script>");
document.write("<script type='text/javascript' src='../script/action-menu/top-menu-impl.js'></script>");
document.write("<script type='text/javascript' src='../script/popup-modal-dialog.js'></script>");
document.write("<script type='text/javascript' src='../script/navigationSideBar.js'></script>");
document.write("<script type='text/javascript' src='../script/action-menu/action-menu-script.js'></script>");
document.write("<script type='text/javascript' src='../script/appUiComponents.js'></script>");
document.write("<script type='text/javascript' src='../script/app-ui-validator.js'></script>");
如果你可以向我解释一下,那将会非常有帮助,就像我10岁那样。
EDIT2 :(找到解决方案) 使用JSF - &gt; http://code.google.com/p/granule/ 使用ANT - &gt;见下文
答案 0 :(得分:2)
答案 1 :(得分:1)
"I don't know how to use / write ANT scripts"
我认为你应该依靠它。或者至少是基础知识。这并不困难。我按照你的链接看了蚂蚁脚本。只需为您的文件修改它。 替换
<concat destfile="${build.dir}/web/common/js/global.js" force="no">
<!-- explicitly order js concat because ordering matters here -->
<fileset dir="${build.dir}" includes="web/common/js/jquery.js" />
<fileset dir="${build.dir}" includes="web/common/js/jquery.bgiframe.js" />
...
包含您的文件
<concat destfile="${build.dir}/web/common/js/global.js" force="no">
<!-- explicitly order js concat because ordering matters here -->
<fileset dir="${build.dir}" includes="script/jhashtable.js" />
<fileset dir="${build.dir}" includes="script/action-menu/jquery-top-menu.js" />
...
与css文件类似