Advertisement
hbabayan

SO#14457508 - build.xml

Feb 8th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.91 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <project name="MyApp" default=".help">
  3.     <import file="${basedir}/.sencha/app/build-impl.xml"/>
  4.  
  5.     <target name="-before-build">
  6.  
  7.         <echo message="Collecting all controllers in application class property ... "/>
  8.         <fileset id="app_controllers" dir="${app.dir}/app/controller" casesensitive="yes">
  9.             <include name="**/*.js"/>
  10.         </fileset>
  11.         <pathconvert pathsep="," property="app_controller_names" refid="app_controllers" targetos="unix">
  12.             <chainedmapper>
  13.                 <globmapper from="${app.dir}/app/*" to="${ant.project.name}/*" casesensitive="no" handledirsep="yes"/>
  14.                 <chainedmapper>
  15.                     <regexpmapper from="^(.*)\.js$$" to='"\1"'/>
  16.                     <filtermapper>
  17.                         <replacestring from="/" to="."/>
  18.                         <replacestring from="\" to="."/>
  19.                     </filtermapper>
  20.                 </chainedmapper>
  21.             </chainedmapper>
  22.         </pathconvert>
  23.         <echo message="Collected controllers: ${app_controller_names}"/>
  24.  
  25.         <echo message="Injecting into app.js ..."/>
  26.         <replaceregexp file="${app.dir}/app/app.js"
  27.                       match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
  28.                       replace="/*ant-generated-content-start*/ ${app_controller_names} /*ant-generated-content-end*/"
  29.                       byline="true"
  30.                />
  31.     </target>
  32.  
  33.     <target name="-after-build">
  34.         <echo message="Reverting to original app.js ..."/>
  35.         <replaceregexp file="${app.dir}/app/app.js"
  36.                       match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
  37.                       replace="/*ant-generated-content-start*/ /*ant-generated-content-end*/"
  38.                       byline="true"
  39.                />
  40.     </target>
  41.  
  42. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement