无为清净楼资源网 Design By www.qnjia.com
今天研究了一下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 <"1.0" encoding="UTF-8""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
相关的文件我提供下载,感觉好的,就留言吧
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月23日
2024年09月23日
- 金池刘罡《昨日情歌HQ》头版限量编号[低速原抓WAV+CUE]
- 段奥娟.2024-23·岁碎念【白米范】【FLAC分轨】
- 顺子.2001-昨日·唯一·更多·顺子自选辑【魔岩】【WAV+CUE】
- 无印良品.1999-私藏三首·原创相对论(EP)【滚石】【WAV+CUE】
- Merryland《Merryland》[FLAC/分轨][170.22MB]
- 庄锭欣 ELKIE《没有你的未来》[320K/MP3][15.78MB]
- 庄锭欣 ELKIE《没有你的未来》[FLAC/分轨][36MB]
- TchaikovskySwanLake,Op.20柴可夫斯基天鹅湖(2013)SACD[Hi-Res]
- 24bit达人艺典《琴歌终极版》整轨WAV+CUE
- 黑鸭子.2005-《发烧DSD》柏菲[WAV分轨]
- 群星.1990-电影看板·人间道【宝丽金】【WAV+CUE】
- 周殷廷.2024-TO.WHOM.IT.MAY.CONCERN【环球】【FLAC分轨】
- 草蜢.1997-三人世界精选17首【宝丽金】【WAV+CUE】
- 【古琴音乐】管平湖《广陵散》2004[FLAC+CUE]
- 【中国民乐】《少数民族器乐·苗岭的早晨》2004[WAV+CUE]