Haciendo eco del conjunto de archivos ant a la pantalla para la depuración
Tengo esto:
<ivy:buildlist reference="build-path">
<fileset dir="${root.dir}">
<include name="*/build.xml" />
<include name="controllers/*/build.xml" />
</fileset>
</ivy:buildlist>
<subant buildpathref="build-path">
<target name="jar.all" />
<target name="publish-local" />
</subant>
Quiero hacer eco de todo lo que está en la referencia "build-path" (para depurar algunas cosas).
He intentado:
<echo>${build-path}</echo>
Pero solo hace eco de ese texto exacto"build {build-path}"
35
Author: systemoutprintln, 2010-10-14
3 answers
Puedes usar el documentado (honestamente, está ahí en alguna parte...) toString
ayudante:
<echo message="My build-path is ${toString:build-path}" />
52
Author: martin clayton,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-02-03 15:51:42
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-02-03 15:51:42
Para depurar qué archivos se incluyen en su conjunto de archivos puede usar este ejemplo, que imprime el contenido de un conjunto de archivos en un formato legible:
<?xml version="1.0" encoding="UTF-8"?>
<project name="de.foo.ant" basedir=".">
<!-- Print path manually -->
<target name="print-path-manually" description="" >
<path id="example.path">
<fileset dir="${ant.library.dir}"/>
</path>
<!-- Format path -->
<pathconvert pathsep="${line.separator}| |-- "
property="echo.path.compile"
refid="example.path">
</pathconvert>
<echo>${echo.path.compile}</echo>
</target>
</project>
La salida de esto es:
Buildfile: D:\Workspaces\IvyTutorial\de.foo.ant\prettyPrintPath.xml
print-path-manually:
[echo] D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-antlr.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-bcel.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-bsf.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-log4j.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-oro.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-regexp.jar
[echo] | |-- D:\Programme\eclipse-rcp-helios-SR1-win32\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant-apache-resolver.jar
....
22
Author: Frank,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-21 06:26:12
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-21 06:26:12
Habilitar el registro de depuración de ant:
$ ant -h
ant [options] [target [target2 [target3] ...]]
Options:
...
-verbose, -v be extra verbose
-debug, -d print debugging information
Tenga en cuenta que esto generará una tonelada de salida, por lo que puede ser mejor capturar la salida a un archivo y luego encontrar la información del conjunto de archivos en un editor de texto:
ant -debug compile > ant-out.txt
9
Author: matt b,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 14:52:32
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 14:52:32