一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

使用YUI+Ant 實現JS CSS壓縮

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

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

copyright:Mr.chen

好了具體操作如下:

官網:

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 實現JS CSS壓縮,轉載需保留來源!

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

主站蜘蛛池模板: 亚洲一区二区三区免费在线观看 | 国产第一区二区三区在线观看 | 久久综合五月开心婷婷深深爱 | 一区二区手机视频 | 一起射福利 | 色视频观看 | 国产手机在线国内精品 | 久久国产香蕉一区精品 | 国产亚洲精品俞拍视频 | 国产igao激情在线观看 | 福利视频欧美 | 91麻豆精品国产剧情 | 91福利免费体验区观看区 | 色网址在线观看 | 99国产国人青青视频在线观看 | 国产成人精品亚洲午夜麻豆 | 日韩久久精品 | 亚洲国产成人资源在线软件 | 1区2区3区4区产品乱码入口 | 91刘亦菲精品福利在线 | gogo全球高清人体成人 | 色综合久久六月婷婷中文字幕 | 在线成人爽a毛片免费软件 在线成人小视频 | 国产高清视频免费 | 99成人国产精品视频 | 9re视频这里只有精品 | 久久中精品中文 | 看全色黄大色黄大片大学生 | 国内精品久久久久久久久野战 | 精品天海翼一区二区 | 最近中文字幕无吗免费高清 | 色综合久久九月婷婷色综合 | 美女扒开腿让男人捅爽 | 久久99国产乱子伦精品免费 | 国产综合自拍 | 国产综合91天堂亚洲国产 | 免费观看四虎精品国产永久 | 国产一级毛片午夜福 | 亚洲激情视频 | 国产精品久久久久免费视频 | 国产成人综合久久精品亚洲 |