[Nice-commit] Nice/src/nice/tools/ant NicecListener.nice,NONE,1.1 Nicec.java,1.20,1.21 NiceDoc.java,
Brought to you by:
bonniot
From: <bo...@us...> - 2004-02-20 03:02:52
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/ant Modified Files: Nicec.java NiceDoc.java Added Files: NicecListener.nice Log Message: Make the nicec ant task report messages through the ant framework. --- NEW FILE: NicecListener.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.tools.ant; /** Listener for Nicec that reports to Ant. @author Daniel Bonniot (bo...@us...) */ import nice.tools.compiler; import org.apache.tools.ant.*; public final class NicecListener extends StatusCodeListener { org.apache.tools.ant.Task task; progress(packageName, phase) { if (packageName != null) task.log(packageName + ": " + phase); else task.log(phase); } progress(percent) { // This is not reported to the console. } warning(location, message) { super; if (location != null) task.log("\n" + location + ":\n" + message); else task.log("\n" + message); } error(location, message) { super; if (location != null) task.log("\n" + location + ":\n" + message, Project.MSG_ERR); else task.log("\n" + message, Project.MSG_ERR); } /** A bug has occured inside the compiler. */ bug(stackTrace, url) { super; task.log ("\nAn exception has occured in the compiler\n" + "Please fill-in a bug report at the following webpage:\n" + url + // "\n\nException: " + exn.toString() + "\n\nStack trace:\n" + stackTrace, Project.MSG_ERR); } } Index: Nicec.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Nicec.java 19 Feb 2004 15:49:31 -0000 1.20 --- Nicec.java 20 Feb 2004 02:51:58 -0000 1.21 *************** *** 289,295 **** project.getBaseDir().getAbsolutePath()); ! nice.tools.compiler.console.ConsoleOutput console = ! nice.tools.compiler.console.fun.consoleOutput(); ! Compilation compilation = bossa.modules.fun.createCompilation(console); if (sourcepath != null) compilation.sourcePath = sourcepath; --- 289,295 ---- project.getBaseDir().getAbsolutePath()); ! NicecListener listener = new NicecListener(this); ! Compilation compilation = bossa.modules.fun.createCompilation ! (listener); if (sourcepath != null) compilation.sourcePath = sourcepath; *************** *** 305,319 **** nice.tools.compiler.fun.compile (compilation, pack, output, native_compiler, editor); ! int retval = console.statusCode; switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.console.fun.OK: log(OK_MSG, Project.MSG_INFO); break; --- 305,319 ---- nice.tools.compiler.fun.compile (compilation, pack, output, native_compiler, editor); ! int retval = listener.statusCode; switch (retval) { ! case nice.tools.compiler.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.fun.OK: log(OK_MSG, Project.MSG_INFO); break; Index: NiceDoc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/NiceDoc.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NiceDoc.java 14 Feb 2004 00:57:32 -0000 1.1 --- NiceDoc.java 20 Feb 2004 02:51:58 -0000 1.2 *************** *** 165,176 **** switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.console.fun.OK: log(OK_MSG, Project.MSG_INFO); break; --- 165,176 ---- switch (retval) { ! case nice.tools.compiler.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.fun.OK: log(OK_MSG, Project.MSG_INFO); break; |