Re: [Codenarc-developer] gradle + codenarc
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-02-23 11:55:41
|
Thanks for the heads-up Hamlet. I am waiting for my subscription request to us...@gr... list to be accepted/confirmed so that I can reply. (1) It looks like the problem is this code in RuleSetUtil for loading a rule script file: def inputStream = resourceFactory.getResource(path).inputStream Class ruleClass inputStream.withStream { input -> GroovyClassLoader gcl = new GroovyClassLoader() ruleClass = gcl.parseClass(input) } I expect that the new GroovyClassLoader() should probably instead be: new GroovyClassLoader(this.class.classLoader()) That may explain not being able to compile the rule script file. (2) The file:xxx URL to the rule script file can also be a relative path (to the current dir). So I was gonna suggest trying: rule('file:config/codenarc/MyCustomRuleScript.groovy') instead of: def ruleScript = new File('config/codenarc/MyCustomRuleScript.groovy') rule('file:' + ruleScript.canonicalPath) Let me know if you think I am off base on either of these. Unfortunately, Nabble is blocked at my work (don't get me started about our $%#@^ firewall policy), so it will be another half-day or so until I can reply. Thanks. Chris -----Original Message----- From: Hamlet DArcy [mailto:ham...@ca...] Sent: Tuesday, February 22, 2011 2:13 PM To: cod...@li...; cod...@li... Subject: [Codenarc-developer] gradle + codenarc Does anyone want to comment on this thread: http://gradle.1045684.n5.nabble.com/code-quality-plugin-location-of-custom-c odenarc-rule-td3373768.html A user is having trouble including their own custom rule. -- Hamlet D'Arcy ham...@ca... ---------------------------------------------------------------------------- -- Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ Codenarc-developer mailing list Cod...@li... https://lists.sourceforge.net/lists/listinfo/codenarc-developer |