I can't figure out how to adapt the java compile tool reg expression to ANT. Note ANT is a build tool for Java.
The difference is in the outpt, and I'd like to adapt the reg expression to be able to jump to the file / line in this output. Below an example. As you notice, it is very simlar to the the java compile tool out put, basically it just inserts stuff at the beginning of the line:
>>>> Java compile output >>>>
C:\src\WWServlet.java:290: cannot resolve symbol
symbol : variable ServletSession
location: class com.webwarecorp.html.WWServlet
final ServletSession us = ServletSession.getSession(sessionID);
^
2 errors
Tool completed with exit code 1
<<< end Java compile output <<<<
>>>>ANT output >>>>
compile:
[javac] C:\src\WWServlet.java:290: invalid method declaration; return type required
[javac] public TreeNodeDelegsate(TreeDelegateBean treeDel, String name, String path, boolean bIsRoot) {
[javac] 1 error
BUILD FAILED
Tool completed successfully
<<< end ANT output <<<<
Please help!!!
Thanx,
John
Regular expressions and Java/ANT **Please Help**
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Jens Hollmann
Re: Regular expressions and Java/ANT **Please Help**
Try:
\[javac\] \(.*\):\([[:digit:]]+\):
The file is the first espression (1) and the line the second (2).
"\[javac\] " is the literal string "[javac] ". You have to escape the "[" and "]"!
"\(.*\)" matches anything and stores it in \1 (the file name)
":" matches the literal ":"
"\([[:digit:]]+\)" matches one or more digits and stores them in \2 (line number)
":" matches the ":" after the line number.
This works because TextPads regular expressions are greedy. So the ":" after the drive letter does not disturb us because it should never be followed by a digit.
I hope this works I only tried it manually by calling find and replace.
HTH
Jens
\[javac\] \(.*\):\([[:digit:]]+\):
The file is the first espression (1) and the line the second (2).
"\[javac\] " is the literal string "[javac] ". You have to escape the "[" and "]"!
"\(.*\)" matches anything and stores it in \1 (the file name)
":" matches the literal ":"
"\([[:digit:]]+\)" matches one or more digits and stores them in \2 (line number)
":" matches the ":" after the line number.
This works because TextPads regular expressions are greedy. So the ":" after the drive letter does not disturb us because it should never be followed by a digit.
I hope this works I only tried it manually by calling find and replace.
HTH
Jens
-
John Averty
Re: Regular expressions and Java/ANT **Please Help**
Thak you very much for your answer, but...this still doesn't work, unless I'm doing something wrong. I set the file register to 1 and the line regiter to 2.
It still says "cannot jump item under the cursor"...
Would that be because [javac] is part of the selection when we search for that reg exp?
Playing around with it more, I had managed to make something work, but it turns out to be complete luck. I would appreciate you telling explaining why it should work.
reg expression:
^ \[javac\] \(\(\(.[^:]\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):
--> which seems to make the same seletion than yours on a search.
Registers:
File: 1
Line: 4 <--- ??!!??
And that seems to work. Magic?
Thanx,
John.
It still says "cannot jump item under the cursor"...
Would that be because [javac] is part of the selection when we search for that reg exp?
Playing around with it more, I had managed to make something work, but it turns out to be complete luck. I would appreciate you telling explaining why it should work.
reg expression:
^ \[javac\] \(\(\(.[^:]\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):
--> which seems to make the same seletion than yours on a search.
Registers:
File: 1
Line: 4 <--- ??!!??
And that seems to work. Magic?
Thanx,
John.
-
Jens Hollmann
Re: Regular expressions and Java/ANT **Please Help**
Definitely magic.
I have one idea left: When you change the setting for a tool, you have to close the output window and reinvoke the tool to reopen the output window. The change has no effect on already open output windows.
Apart from that: I'm at my wits end.
Kind regards
Jens
I have one idea left: When you change the setting for a tool, you have to close the output window and reinvoke the tool to reopen the output window. The change has no effect on already open output windows.
Apart from that: I'm at my wits end.
Kind regards
Jens