Новый билд сценарий

1 parent 0b5f1219
Showing with 123 additions and 88 deletions
<?xml version="1.0" encoding="UTF-8" ?>
<project name="MTAWeb" basedir="." default="build">
<property name="src_dir" value="protected/" override="false"/>
<property name="build.dir" value="public/" override="false"/>
<property name="pkg" value="/tmp/mailadmin" override="false"/>
<target name="require">
<echo msg="This build requires:" />
<echo msg="Compass framework" />
<echo msg="YUI Compressor" />
<property name="source.dir" value="." override="false"/>
<property name="build.dir" value="build" override="false"/>
<target name="minify">
<echo msg="Minimizing: ${filename} == ${ifile}" />
<exec checkreturn="true" command="java -jar ${source.dir}/contrib/webcompress/yuicompressor.jar --preserve-semi ${ifile} -o ${ifile}" />
</target>
<target name="minify">
<echo msg="Minimizing: ${filename}" />
<exec command="java -jar yuicompressor.jar ${ifile} -o ${ifile}" />
<target name="copy">
<delete dir="${source.dir}/${build.dir}" quiet='true' />
<mkdir dir="${source.dir}/${build.dir}" />
<copy todir="${source.dir}/${build.dir}">
<fileset dir="${source.dir}">
<include name="framework/**" />
<include name="public/protected/**" />
</fileset>
</copy>
</target>
<target name="sass">
<target name="sass">
<echo msg="Building css file from sass configuration" />
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="${build.dir}/css">
<include name="*.css" />
</fileset>
</delete>
<exec command="cd ${build.dir}/sass/ &amp;&amp; compass compile" checkreturn="true" />
<delete dir="${build.dir}/css/sass" includeemptydirs="true" verbose="true" failonerror="true" />
<exec command="cd ${source.dir}/public/sass/ &amp;&amp; compass compile" checkreturn="true" />
</target>
<target name="css" depends="sass">
<echo msg="CSS compiled" />
<copy todir="${build.dir}/css" overwrite="true">
<mapper type="glob" from="*.css" to="*.min.css"/>
<fileset dir="${build.dir}/css">
<include name="*.css" />
</fileset>
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<fileset dir="${build.dir}/css">
<include name="*.min.css" />
</fileset>
</foreach>
</target>
<target name="clear.js">
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="${build.dir}">
<include name="app/controller/controller.js" />
<include name="app/view/view.js" />
<include name="app/model/model.js" />
<include name="scripts/app-debug.js" />
</fileset>
</delete>
</target>
<target name="js" depends="clear.js">
<fileset dir="${build.dir}/app/controller" id="controller.set">
<include name="*.js" />
<exclude name="controller.js" />
</fileset>
<fileset dir="${build.dir}/app/model" id="model.set">
<include name="*.js" />
<exclude name="model.js" />
</fileset>
<fileset dir="${build.dir}/app/store" id="store.set">
<include name="*.js" />
<exclude name="store.js" />
</fileset>
<append destFile="${build.dir}/app/controller/controller.js">
<fileset refid="controller.set" />
</append>
<append destFile="${build.dir}/app/model/model.js">
<fileset refid="model.set" />
</append>
<append destFile="${build.dir}/app/store/store.js">
<fileset refid="store.set" />
</append>
<append destFile="${build.dir}/app/view/view.js">
<filelist dir="${build.dir}/app/view" files="ProgramMenu.js, Taskpanel.js" />
<filelist dir="${build.dir}/app/view" files="Aliases.js, Alias.js" />
<filelist dir="${build.dir}/app/view" files="Users.js, User.js" />
<filelist dir="${build.dir}/app/view" files="Viewport.js, Authorize.js" />
<filelist dir="${build.dir}/app/view" files="Transports.js" />
</append>
<target name="css" depends="sass">
<mkdir dir="${build.dir}/public/css" />
<copy todir="public/css" overwrite="true">
<mapper type="glob" from="*theme.css" to="*theme.min.css"/>
<fileset dir="public/css">
<include name="*theme.css" />
</fileset>
</copy>
<append destFile="${build.dir}/scripts/app-debug.js">
<filelist dir="${build.dir}/app" files="Overrides.js, view/view.js, model/model.js, store/store.js, controller/controller.js, Application.js" />
</append>
<foreach param="filename" absparam="ifile" target="minify">
<fileset dir="public/css">
<include name="*theme.min.css" />
</fileset>
</foreach>
<copy todir="${build.dir}/scripts" overwrite="true">
<mapper type="glob" from="app-debug.js" to="app.js"/>
<filelist dir="${build.dir}/scripts" files="app-debug.js" />
<copy todir="${build.dir}/public/css" overwrite="true">
<fileset dir="public/css">
<include name="*theme*.css" />
</fileset>
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<filelist dir="${build.dir}/scripts" files="app.js" />
</foreach>
</target>
<target name="clear.js">
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="public/">
<include name="app/controller/controller.js" />
<include name="app/view/view.js" />
<include name="app/model/model.js" />
<include name="scripts/app-debug.js" />
</fileset>
</delete>
</target>
<target name="build" depends="require, css, js">
<target name="js" depends="clear.js">
<mkdir dir="${build.dir}/public/scripts" />
<fileset dir="public/app/controller" id="controller.set">
<include name="*.js" />
<exclude name="controller.js" />
</fileset>
<fileset dir="public/app/model" id="model.set">
<include name="*.js" />
<exclude name="model.js" />
</fileset>
<fileset dir="public/app/store" id="store.set">
<include name="*.js" />
<exclude name="store.js" />
</fileset>
<append destFile="public/app/controller/controller.js">
<fileset refid="controller.set" />
</append>
<append destFile="public/app/model/model.js">
<fileset refid="model.set" />
</append>
<append destFile="public/app/store/store.js">
<fileset refid="store.set" />
</append>
<append destFile="public/app/view/view.js">
<filelist dir="public/app/view" files="ProgramMenu.js, Taskpanel.js" />
<filelist dir="public/app/view" files="Aliases.js, Alias.js" />
<filelist dir="public/app/view" files="Users.js, User.js" />
<filelist dir="public/app/view" files="Viewport.js, Authorize.js" />
<filelist dir="public/app/view" files="Transports.js" />
</append>
<append destFile="public/scripts/app-debug.js">
<filelist dir="public/app" files="Overrides.js, view/view.js, model/model.js, store/store.js, controller/controller.js, Application.js" />
</append>
<copy todir="${build.dir}/public/scripts" overwrite="true">
<mapper type="glob" from="app-debug.js" to="app.js"/>
<filelist dir="public/scripts" files="app-debug.js" />
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<filelist dir="public/scripts" files="app.js" />
</foreach>
<copy todir="${build.dir}/public/scripts">
<fileset dir="public/scripts">
<include name="**/app.js" />
<include name="**/app-debug.js" />
<include name="**/ext-all.js" />
<include name="**/ext-all-debug.js" />
</fileset>
</copy>
</target>
<target name="build" depends="copy, css, js">
<exec checkreturn="true" command="find ${build.dir} -type f -exec chmod 644 {} \;" />
<chmod file="${build.dir}/public/protected/runtime" mode="0777" failonerror="true" verbose="true" />
<copy file="public/index.php" tofile="${build.dir}/public/index.php" overwrite="true"/>
<reflexive>
<fileset dir="${build.dir}/public">
<include name="index.php" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="(define[\(\&quot;\'\s]+YII_DEVELOP[\)\,\&quot;\'\s]+)[\w\-\_]+"
replace="\1false" />
<regexp pattern="(define[\(\&quot;\'\s]+YII_DEBUG[\)\,\&quot;\'\s]+)[\w\-\_]+"
replace="\1false" />
</replaceregexp>
</filterchain>
</reflexive>
<echo msg="All done." />
</target>
</project>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!