On 18/02/10 10:10 PM, Peter Ledbrook wrote:
Hi,

I'd like to add my plugin as a runtime dependency to whatever project
has applied it. I'm currently going with:

   dependencies {
       ...
       def r = getClass().getResource("GrailsPlugin.class")
       if (r.protocol == "jar") {
           def path = r.toString() - "jar:"
           path = path[0..<(path.indexOf('!'))]

           runtime files(new URL(path).file)
       }
       ...
   }

It's pretty ugly though. Is there a better approach?


Not really. I guess having some way to ask for the classpath of a plugin as either a FileCollection or a Dependency would be useful here, something like

dependencies {
    runtime plugins[myplugin].classpath
}

Could you add a JIRA issue for this problem?


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to