On 08/08/2011, at 5:50 AM, evgenyg wrote:

> Hi,
> 
> I think I experience the same issue. My Gradle task can't compile with  
> https://github.com/evgeny-goldin/gradle-plugins/blob/1624f39d8eb6c23d5be130267ec37bd60de42387/src/main/groovy/com/goldin/plugins/gradle/about/AboutTask.groovy#L6
> org.gradle.api.plugins.ProjectReportsPlugin  any more after upgrading to m4:
> "unable to resolve class org.gradle.api.plugins.ProjectReportsPlugin".
> 
> After running "gradle idea" I see how only
> "gradle/lib/gradle-core-1.0-milestone-4.jar" and
> "gradle/lib/core-impl/gradle-core-impl-1.0-milestone-4.jar" are added to the
> project which explain the compilation failure, the plugin I need is located
> in "gradle/lib/plugins/gradle-plugins-1.0-milestone-4.jar", as Meikel
> mentioned above.
> 
> So it looks like in addition to *gradleApi()* something like
> *gradlePlugins()* compile dependency is required. Is there any workaround
> available ? (well, except grabbing the jar and pushing it to one of
> Artifactory repos manually) 

The gradleApi() dependency was never supposed to expose the plugins, only the 
core. The plugins were unintentionally included in previous versions, and in 
milestone-4, gradleApi() was changed to include only the core API (ignoring the 
fact that gradleApi() also includes all the runtime dependencies of core - that 
is a separate problem).

We'll probably do as you suggest, and add some methods to declare dependencies 
on the plugins. I think we should bust it up, so that you declare a dependency 
on particular plugins, rather than all the Gradle plugins lumped together. 
Perhaps something like:

dependencies {
    compile plugin('java')
}

Another option is to deprecate gradleApi() and localGroovy(), and replace them 
with a repository implementation that knows how to find stuff in 
$gradleHome/lib:

repositories {
    gradleDistro()
}

dependencies {
    compile 'org.gradle:gradle-core:${gradle.gradleVersion}'
    compile 'org.gradle:gradle-plugins:${gradle.gradleVersion}'
}

I don't think I like this approach.

Regardless of what we choose, in the meantime a workaround is:

dependencies {
    compile fileTree(dir: "${gradle.gradleHomeDir}/lib/plugins", include: 
'**/*.jar')
}


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to