中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

使用YUI+Ant 實現(xiàn)JS CSS壓縮

今天研究了一下YUI yahoo開源框架,感覺很猛啊。

于是乎我做了一個YUI的ant實現(xiàn),網(wǎng)上好多關于bat的實現(xiàn),我就另辟蹊徑,出個關于這個的ant實現(xiàn),嘿嘿獨一無二的文章,如果轉載的話,其注明作者和網(wǎng)站

copyright:Mr.chen

好了具體操作如下:

官網(wǎng):

yuicompressor-2.4.6.jar 下載地址 http://yuilibrary.com/downloads/#yuicompressor

YUIAnt.jar 下載地址 http://www.ubik-ingenierie.com/miscellanous/YUIAnt/

具體的相關代碼如下:

#css work dir commonCss.dir = css  #js work dir commonJs.dir = js  #build temp dir  output.temp.dir = build  #output files in the directory output.dir = ${output.temp.dir}_output  #environment needs lib liblib = lib  <?xml version="1.0" encoding="UTF-8"?>  <project name="Compress CSS-JS" default="compress" basedir=".">    <property file="bulid.properties" />    <path id="yuiClasspath">     <fileset dir="${lib}">       <include name="*.*" />     </fileset>   </path>    <!-- #######################Init the environment of the tool ##########################-->   <target name="init">     <echo message="begin to init the init" />     <echo message="delete all reference files." />     <delete dir="${output.dir}" />     <echo message="delete end" />     <echo message="make the reference files." />     <mkdir dir="${output.dir}" />     <mkdir dir="${output.temp.dir}" />     <echo message="make end." />   </target>    <!-- #######################Combine the css files       ##########################-->   <target name="combinecss" depends="init" description="Combine common css files">     <echo message="begin to combine the css files to one file." />     <concat destfile="${output.temp.dir}/combined_css.css" encoding="UTF-8" append="false">       <fileset dir="${commonCss.dir}">         <include name="*.css" />       </fileset>     </concat>     <echo message="combine end." />   </target>    <!-- #######################Combine the js files       ##########################-->   <target name="combinejs">     <echo message="begin to combine the js files to one file." />     <concat destfile="${output.temp.dir}/all_source.js" encoding="utf-8" append="false">       <fileset dir="${commonJs.dir}">         <include name="*.js" />       </fileset>     </concat>     <echo message="combine end." />   </target>    <!-- #######################Compress the js and css files ##########################-->   <target name="compress" depends="combinecss,combinejs" description="Compress">     <echo message="begin to compress the css file." />     <taskdef name="yuicompress" classname="com.yahoo.platform.yui.compressor.YUICompressTask">       <classpath>         <path refid="yuiClasspath" />       </classpath>     </taskdef>     <!-- first method compress the css files -->     <yuicompress linebreak="10000000" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${output.dir}">       <fileset dir="${output.temp.dir}">         <include name="*.css" />       </fileset>     </yuicompress>     <echo message ="compress the css end." />     <!-- second method compress the js files-->     <echo message ="begin to compress the js file." />     <apply executable="Java" parallel="false" failonerror="true">       <fileset dir="${output.temp.dir}" includes="all_source.js" />       <arg line="-jar" />       <arg path="${lib}/yuicompressor-2.4.6.jar" />       <arg line="--charset utf-8" />       <arg line="-o ${output.dir}/combined_js.js" />       <srcfile />     </apply>     <echo message ="compress the js end." />     <delete dir="${output.temp.dir}" />   </target>  </project>  @echo off echo ################################################ echo ##########Tool Compress the js and css########## echo ################################################ echo Please make sure your css and js in the css'directory and js'directory. echo If sure,please enter any button to continue the tool. pause call ant -buildfile compress.xml compress>build.log echo compress end  pause 

 
 相關的文件我提供下載,感覺好的,就留言吧

php技術使用YUI+Ant 實現(xiàn)JS CSS壓縮,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 无码国模国产在线观看 | 天天操操操操操 | 特级黄一级播放 | 少妇午夜一级艳片欧美精品 | av黄色免费在线观看 | av网址在线 | 亚洲成人黄色 | 国产精品视频网站 | 91精品国产综合久久小仙女图片 | 亚洲免费精品 | 亚洲欧洲精品在线 | 一级黄色毛片免费 | 精品少妇一区二区三区在线播放 | 亚洲成人观看 | 精品在线一区 | 欧美一级大片 | 午夜影院官网 | 交专区videossex农村 | 国产精品日韩在线观看 | 免费不卡视频 | 天天拍天天操 | 操人网 | 日韩快播电影 | 欧美国产精品一区二区三区 | 在线免费观看黄色 | 久久精品欧美电影 | 国产一级淫片a直接免费看 免费a网站 | 免费v片| 亚洲精品在线观看网站 | 韩国av一区二区 | 韩国av一区二区 | 成人在线中文字幕 | 欧美日韩在线播放 | 日韩精品极品视频在线观看免费 | 日本小电影在线 | 一a一片一级一片啪啪 | 夜夜操操操 | 作爱视频免费看 | 欧美日一区二区 | av中文天堂| 日本久久久久久 |