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

1 parent 0b5f1219
Showing with 123 additions and 88 deletions
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<project name="MTAWeb" basedir="." default="build"> <project name="MTAWeb" basedir="." default="build">
<property name="src_dir" value="protected/" override="false"/> <property name="source.dir" value="." override="false"/>
<property name="build.dir" value="public/" override="false"/> <property name="build.dir" value="build" override="false"/>
<property name="pkg" value="/tmp/mailadmin" override="false"/>
<target name="minify">
<target name="require"> <echo msg="Minimizing: ${filename} == ${ifile}" />
<echo msg="This build requires:" /> <exec checkreturn="true" command="java -jar ${source.dir}/contrib/webcompress/yuicompressor.jar --preserve-semi ${ifile} -o ${ifile}" />
<echo msg="Compass framework" />
<echo msg="YUI Compressor" />
</target> </target>
<target name="minify"> <target name="copy">
<echo msg="Minimizing: ${filename}" /> <delete dir="${source.dir}/${build.dir}" quiet='true' />
<exec command="java -jar yuicompressor.jar ${ifile} -o ${ifile}" /> <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>
<target name="sass"> <target name="sass">
<echo msg="Building css file from sass configuration" /> <echo msg="Building css file from sass configuration" />
<delete includeemptydirs="true" verbose="true" failonerror="true"> <exec command="cd ${source.dir}/public/sass/ &amp;&amp; compass compile" checkreturn="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" />
</target> </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"> <target name="css" depends="sass">
<fileset dir="${build.dir}/app/controller" id="controller.set"> <mkdir dir="${build.dir}/public/css" />
<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>
<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"> <foreach param="filename" absparam="ifile" target="minify">
<filelist dir="${build.dir}/app" files="Overrides.js, view/view.js, model/model.js, store/store.js, controller/controller.js, Application.js" /> <fileset dir="public/css">
</append> <include name="*theme.min.css" />
</fileset>
</foreach>
<copy todir="${build.dir}/scripts" overwrite="true"> <copy todir="${build.dir}/public/css" overwrite="true">
<mapper type="glob" from="app-debug.js" to="app.js"/> <fileset dir="public/css">
<filelist dir="${build.dir}/scripts" files="app-debug.js" /> <include name="*theme*.css" />
</fileset>
</copy> </copy>
</target>
<foreach param="filename" absparam="ifile" target="minify">
<filelist dir="${build.dir}/scripts" files="app.js" /> <target name="clear.js">
</foreach> <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>
<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." /> <echo msg="All done." />
</target> </target>
</project> </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!