I have tried it, but the parser throughs an error not knowing "$JenkinsHome"  
string. 

Am 13.12.2012 um 04:04 schrieb "Strausser, Barrett" 
<barrett.straus...@snapretail.com>:

> You could probably do $JenkinsHome + "/jobs/" + $WorkSpace
> 
> 
> 
> 
> On Wed, Dec 12, 2012 at 5:58 PM, schneim <markus.schnei...@netic.de> wrote:
>> Hello,
>> 
>> 
>> I have created a custom warning parser. This works quite well. However, I 
>> have trouble to display the content of the source files.
>> 
>> I found out the path in the warning is only relative to the workspace path, 
>> e.g.  $WORKSPACE/src/file.c 
>> 
>> But for displaying the source file, the plugin requires the full path.
>> 
>> The question is, how to find the workspace path to concatenate it with the 
>> file path inside the groovy script.
>> 
>> import hudson.plugins.warnings.parser.Warning
>> 
>> String workspace = getWorkspacePath()
>> String fileName = matcher.group(1)
>> String fullPath = workspace+fileName
>> String lineNumber = matcher.group(2)
>> String category = matcher.group(3)
>> String message = matcher.group(4)
>> 
>> return new Warning(fullPath, Integer.parseInt(lineNumber), "Dynamic Parser", 
>> category, message);
>> 
>> 
>> Any way to find out the value for the workspace or some other solution 
>> available?
>> 
>> Thanks
> 

Reply via email to