Skip to content

Instantly share code, notes, and snippets.

@Programmercito
Last active October 4, 2016 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Programmercito/c3c72514cf8c2d5509c31c1ea6794bbb to your computer and use it in GitHub Desktop.
Save Programmercito/c3c72514cf8c2d5509c31c1ea6794bbb to your computer and use it in GitHub Desktop.
Buscando comando en un proyecto Java con ANT
<target name="prueba">
<echo>************************* COMENZANDO BUSQUEDA DE COMANDOS NO PERMITIDOS ****************************</echo>
<delete file="prohibiciones.found"/>
<property name="cabecera" value="ARCHIVO DE ENCONTRADOS"/>
<echo file="prohibiciones.found">${cabecera}</echo>
<loadfile property="file" srcfile="prohibidos.list"/>
<for param="line" list="${file}" delimiter="${line.separator}">
<sequential>
<echo>REVISANDO: @{line}</echo>
<concat append="true" destFile="prohibiciones.found" >
<fileset dir="../../">
<include name="**/*.*"/>
<exclude name="**/prohibiciones.found"/>
<exclude name="**/prohibidos.list"/>
<exclude name="**/*.jar"/>
</fileset>
<filterchain>
<linecontainsregexp >
<regexp pattern="@{line}"/>
</linecontainsregexp>
</filterchain>
</concat>
</sequential>
</for>
<echo>************************* ENCONTRADOS ****************************</echo>
<loadfile property="encontrados" srcFile="prohibiciones.found" />
<if><equals arg1="${encontrados}" arg2="${cabecera}"/>
<then><echo>vacio</echo></then>
<else><echo>no vacio</echo></else>
</if>
<echo>${encontrados}</echo>
<echo>************************* TERMINA BUSCANDO *******************************</echo>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment