Community
Participate
Working Groups
* there should be a way to navigate from the console output to the corresponding resource. For example, the user can select a javac error message and execute "Goto File" from the context menu. NOTES: FB (09/07/2001 4:36:44 PM) The above suggestion is from EG.
PRODUCT VERSION: 125
Moving to Platform UI (External Tools). It would be a nice feature but it is not critical for 2.0.
*** Bug 15386 has been marked as a duplicate of this bug. ***
This is actually fairly important. Anything we can do here would be good, even if it means hardcoding knowledge about the format of Javac error messages. (There is a dup PR for this).
I believe messages here might depend on the compiler adapter. Sun's javac and JDT could be different. A common pattern could be tricky to find (although worth trying).
If an error occurs during execution of the Ant file, a BuildException should be shown and reported, and it should show up in the Tasks view (as it used to) so that you can at least jump to the offending line in the Ant file. In my view, it is the reposibility of the Ant task implementation to generate task-specific entries in the Eclipse Task view.
I have made a small addition to the Log console code and somewhat discussed it in the newsgroup. You can find the exact discussion by searching for "Ant problems (and where to report them)". Im willing to share my patch and ideas if you are interested. But I must say it must be worth looking into how CDT handle this issue - their mailing list seem to include discussion on how to generally parse an(y) compilers output via regular expression - just as Emacs, jedit, idea etc. can do it. It should not be that hard to build into the external tools core.
To be fixed in 2.0.1
Code added by Ryan.
We needed to roll back the changes on this. We cannot make use of the JDT code because external tool is part of the platform, and JDT is only part of the SDK. Need to reinvestigate for 2.1
By moving the debug console/process views into the platform, external tools could make use of it. And when JDT is present, it would handle the double click on java file request.
We currently support hyperlinks from output back to the associated task. However, we need to extend this support to take into consideration error output from javac to associated java code. We also need to consider how we can support linking for other tasks (i.e. do we need an extension point to allow clients to register parsers/linkers for task specific output?)
An extension point would be interesting for tasks you do not have control over like the javac task or any other contributed by Ant (I believe there is a bug report related to that). If providing a solution like that we should make sure it scales well (e.g. a hundred listeners running but none associated with the current running tasks).
We have added support for parsing "javac" output. Errors are linked back to the associated ".java" file.
We do not yet have a task-based extension point (currently, we just have a "console line tracker" extension point supported by the debugger). There are some issues with an ant extension point - the implementation has to be on the ant classpath, etc. Moving to M5 for consideration with bug 26830.
Is the parsing of javac output functional yet? I can't get it to work using a new project, all ant settings on defaults, and a simple buildfile which just does a <javac srcdir="src"/> - the error shows up, but without a hyperlink for it. Hyperlinks only exist for the javac task back to the buildfile. It would be nice if the jikes compiler's output was also supported by default. I'd imagine it would be a pretty common scenario for large projects due to the drastic speed increase it provides to the development cycle.
The links may only work on the Sun compiler output format - have not tested with jikes.
It looks like the string you are using to match an error isn't correct? Or do I have to configure the buildfile in some way to force the Sun java compiler from within eclipse? I tried setting the build.compiler property to "modern", and had exactly the same results. Here's the buildfile I was using, and the resulting output. The match string, "*[javac]*ERROR in*.java*(at line*)*", doesn't appear in the error output src/Foo.java: public class Foo { public static void main(String[] args) { blah; } } link.xml: <project name="bar" default="all"> <target name="all"> <javac srcdir="src"/> </target> </project> Buildfile: D:\dev\eclipse\runtime-workspace\SimpleAnt\link.xml all: [javac] Compiling 1 source file [javac] D:\dev\eclipse\runtime-workspace\SimpleAnt\src\Foo.java:12: not a statement [javac] blah; [javac] ^ [javac] 1 error [javac] BUILD FAILED: file:D:/dev/eclipse/runtime-workspace/SimpleAnt/link.xml:6: Compile failed; see the compiler error output for details.
Sorry, I was fooled. We parse output from the Eclipse Java Compiler.
Added support for parsing Jikes and Sun Javac error output. Fixed.
Please verify. (Code changes are in JavacLineTracker)
RE-open to re-assign
Darin, Jared is away this week, so I will assign this bug to you for verification.
Fixed. Please verify, Darin (S).
Verified.