[JavaScript] 配置JavaScript BUILD

<project name="eForm" default="concatenate">
  <tstamp>
<format property="build.time"
pattern="MMM/dd/yyyy hh:mm:ss"
locale="en,US"/>
</tstamp>

<property name="src.dir" location="C:\Seamas\Projects\eForm\src"/>
<property name="build.dir" location="C:\Seamas\Projects\eForm\build"/>
<property name="lib.dir"  location="C:\Seamas\Projects\js.build"/>

<property name="yuicompressor"  location="C:\Seamas\Projects\js.build\yui\yuicompressor\yuicompressor-2.4.jar"/>
  

<property name="jsdoc.dir"  location="C:\Seamas\Projects\js.build\jsdoc"/>
<property name="jsdoc"  location="${jsdoc.dir}\jsrun.jar"/>
<property name="jsdoc.run"  location="${jsdoc.dir}\app\run.js"/>
<property name="jsdoc.templates"  location="${jsdoc.dir}\templates\jsdoc"/>
<property name="jsdoc.output"  location="${build.dir}\docs"/>



<loadfile property="license" srcfile="${src.dir}\license.txt" />

  <target name="concatenate"> 
<concat destfile="${build.dir}\build.js" fixlastline="yes" eol="lf">
  <header trimleading="yes">/*! 
${license}
*/
/* build time: ${build.time} */</header>
        <fileset dir="${src.dir}" includes="*.js" />
    </concat>
  </target>




<target name="minify">
<apply executable="java" failonerror="true">
<fileset dir="${build.dir}" includes="*.js"/>
<mapper type="glob" from="*.js" to="${build.dir}/*-min.js"/>
<arg line="-jar"/>
<arg path="${yuicompressor}"/>

<srcfile/>
<arg line="-o"/>
<targetfile/>
</apply>
</target>




<target name="document">
<apply executable="java" failonerror="true" parallel="true">
<fileset dir="${src.dir}" includes="*.js" />
<arg line="-jar"/>
<arg path="${jsdoc}"/>
<arg path="${jsdoc.run}" />
<arg line="-t=${jsdoc.templates}" />
<arg line="-d=${jsdoc.output}" />
<srcfile/>
</apply>
</target>

</project>

 这篇blog,仅仅是个人参考....后续会有继续的更新,这个是Version 1.0

 

jslint and ANT

references:

http://505253293.blog.163.com/blog/static/268991672013183407272/

http://www.myexception.cn/web/422928.html

http://kaatz-media.com/2011/10/06/uberprufen-von-javascript-dateien-ant-und-jslint-jenkins-using-ant-on-jenkins-for-jslint/

http://code.google.com/p/jslint4java/

http://www.gototheboard.com/articles/Running_JSLint_With_Your_Ant_Build

 

http://mattsnider.com/using-ant-to-consolidate-css-and-javascript/

posted @ 2013-07-30 09:45  On the road....  阅读(919)  评论(0编辑  收藏  举报