ant script for css/js compression
<?xml version="1.0" encoding="UTF-8"?> <project name="yakbootstrap" default="yakbootstrap" basedir="."> <property name="yuicompressor.path" location="D:\tool\yuicompressor.jar"/> <property name="closure.path" location="D:\tool\compiler.jar"/> <property name="js.files" value="yakbootstrap.yakautocomplete.js, yakbootstrap.yaktag.js, yakbootstrap.yakpassportsearch.js, yakbootstrap.yakdatepicker.js, yakbootstrap.yaktimepicker.js, yakbootstrap.yakdatetimepicker.js, konami.js, run.js"/> <property name="yak.path" value="resources\yakbootstrap\" /> <target name="js"> <echo>Working...</echo> <mkdir dir="bin" /> <concat destfile="bin\main.js" fixlastline="true"> <fileset dir="dev\${yak.path}js" includes="yakbootstrap*.js" excludes="${js.files}" /> </concat> <concat destfile="bin\main.js" fixlastline="true" append="true"> <filelist dir="dev\${yak.path}js" files="${js.files}" /> </concat> <apply executable="java" verbose="true" dest="bin" failonerror="true" parallel="false"> <fileset dir="dev\${yak.path}js" includes="yakbootstrap*.js, konami.js, run.js" excludes="" /> <arg line="-jar"/> <arg path="${closure.path}"/> <arg value="--js"/> <srcfile/> <arg value="--js_output_file"/> <targetfile/> <mapper type="glob" from="*.js" to="*.min.js"/> </apply> <apply executable="java" verbose="true" dest="bin" failonerror="true" parallel="false"> <fileset dir="bin" includes="main.js"/> <arg line="-jar"/> <arg path="${closure.path}"/> <arg value="--js"/> <srcfile/> <arg value="--js_output_file"/> <targetfile/> <mapper type="glob" from="*.js" to="*.min.js"/> </apply> <copy file="bin\main.min.js" todir="${yak.path}js" overwrite="true" /> <!--<delete file="bin\main.js" />--> <mkdir dir="doc" /> <exec executable="cmd" dir="bin"> <arg line="/c yuidoc ."/> </exec> <copy todir="doc"> <fileset dir="bin\out" /> </copy> <delete dir="bin\out" /> </target> <target name="css"> <!--<concat destfile="bin\_style.css" fixlastline="true"> <filelist dir="dev\${yak.path}css" files="style.css" /> </concat>--> <apply executable="java" verbose="true" dest="bin" failonerror="true" parallel="false"> <fileset dir="dev\${yak.path}css" includes="style.css"/> <arg line="-jar"/> <arg path="${yuicompressor.path}"/> <arg value="--type"/> <arg value="css"/> <srcfile/> <arg value="-o"/> <targetfile/> <mapper type="glob" from="*.css" to="*.css"/> </apply> <copy file="bin\style.css" todir="${yak.path}css" overwrite="true" /> </target> <target name="html"> <copy file="dev\index.html" todir="." overwrite="true" /> <replaceregexp flags="gs"> <regexp pattern='(ui.min.js">\\x3C/script)(.*?)run.js' /> <substitution expression='\1\>\')\</script\>\ \<script type="text/javascript" src="resources/yakbootstrap/js/main.min.js' /> <fileset dir="." includes="index.html" /> </replaceregexp> </target> <target name="yakbootstrap" depends="js,css, html"> <echo message="Build complete."/> </target> </project>
相关推荐
NARUTOLUOLUO 2020-08-03
88274956 2020-11-03
Zhongmeishijue 2020-09-10
runner 2020-09-01
梦的天空 2020-08-25
IdeaElements 2020-08-19
luvhl 2020-08-17
移动开发与培训 2020-08-16
ReunionIsland 2020-08-16
lyqdanang 2020-08-16
MyNameIsXiaoLai 2020-07-08
星辰的笔记 2020-07-04
csstpeixun 2020-06-28
letheashura 2020-06-26
liaoxuewu 2020-06-26
OldBowl 2020-06-26
北京老苏 2020-06-25
Luffyying 2020-06-25