Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: None  |  size: 1.38 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Exclude files with Ant
  2. <project name="MyProject" default="build" basedir=".">
  3. <property name="buildDir"   value="${basedir}/build"/>
  4. <property name="componente" value="${basedir}/trunk/componente"/>
  5. <property name="backend"    value="${componente}/backend"/>
  6. <property name="frontend"   value="${componente}/frontend"/>
  7.  
  8. <target name="build" depends="cleanup, pro, free" />
  9.  
  10. <!-- Clean up the build directory output -->
  11. <target name="cleanup">
  12.     <echo>Clean up build directory</echo>
  13.     <delete includeemptydirs="true">
  14.         <fileset dir="${buildDir}" includes="**/*"/>
  15.     </delete>
  16. </target>
  17.  
  18. <!-- Create the pro package (no file exclusion) -->
  19. <target name="pro">
  20.     <echo>Build pro version</echo>
  21.     <zip destfile="${buildDir}/pro.zip" basedir="${componente}" />
  22. </target>
  23.  
  24. <!-- Create the free package (file exclusion) -->
  25. <target name="free">
  26.     <echo>Build free version</echo>
  27. </target>
  28.        
  29. <zip destfile="${buildDir}/free.zip"
  30.      basedir="${componente}"
  31.      excludes="**/features/pro/**, **/other/**"/>
  32.        
  33. <fileset dir="${files.directory}" casesensitive="yes">
  34.   <include name="**/*free.php"/>
  35.   <exclude name="**/*pro.php"/>
  36. </fileset>
  37.        
  38. <target name="free">
  39.     <zip destfile="${buildDir}/pro.zip">
  40.         <fileset dir="${componente}">
  41.             <not>
  42.                 <containsregexp expression="@category[ t]+ProPackage"/>
  43.             </not>
  44.         </fileset>
  45.     </zip>
  46. </target>