Apache Ant - program output accompanied by "[java]" tags -
a stupid question, couldn't find answer anywhere.
currently learning apache ant , started making basic build file , java project prints line of string console. outputted when used command
ant compile jar run
ps c:\users\zayd\desktop\apps\pbox> ant compile jar run buildfile: c:\users\zayd\desktop\apps\pbox\build.xml compile: [mkdir] created dir: c:\users\zayd\desktop\apps\pbox\build\classes [javac] c:\users\zayd\desktop\apps\pbox\build.xml:9: warning: 'includeantruntime' not set, defaulting build.s ysclasspath=last; set false repeatable builds [javac] compiling 8 source files c:\users\zayd\desktop\apps\pbox\build\classes jar: [mkdir] created dir: c:\users\zayd\desktop\apps\pbox\build\jar [jar] building jar: c:\users\zayd\desktop\apps\pbox\build\jar\main.jar run: [java] ~we'll go down in history~ build successful total time: 1 second
is there way remove '[java]' tags being printed alongside program output?
by default, no can't. task prefix in output controlled ant's logging mechanism, not java
task there no way change java
task usage remove output.
the way write own buildlogger
customize build event messages, instruct ant use custom logger instead of defaultlogger
ant uses default. see https://ant.apache.org/manual/listeners.html (the link includes pointer writing own listeners , loggers).
if intend , not asking curiosity, here's snippet taken defaultlogger
pinpoints how build event message logged task name:
/** * logs message, if priority suitable. * in non-emacs mode, task level messages prefixed * task name right-justified. * * @param event buildevent containing message information. * must not <code>null</code>. */ public void messagelogged(buildevent event) { int priority = event.getpriority(); // filter out messages based on priority if (priority <= msgoutputlevel) { stringbuffer message = new stringbuffer(); if (event.gettask() != null && !emacsmode) { // print out name of task if we're in 1 string name = event.gettask().gettaskname(); string label = "[" + name + "] ";
Comments
Post a Comment