Philip Crotwell wrote:
Hi

Just realized that the problem was that the code was running in the
plugin init instead of the task execution so the project was not be
completely set up at that point. I had the usePlugin "eclipse" before
the usePlugin "scala" in the build file, so the order was backwards.

So, I guess it almost works. However, because the eclipse plugin seems
to do its checking at init time instead of task execution time, it can
fail to properly detect the scala plugin if usePlugin "eclipse" comes
before usePlugin "scala".

The eclipse plugins uses this kind of construct to detect whether the java plugin has been applied:


public void use(final Project project, ProjectPluginsContainer projectPluginsHandler) {

projectPluginsHandler.withType(JavaPlugin.class).allPlugins {... some action ... }

}

The action passed to allPlugins() is invoked when the JavaPlugin is applied, whether that has already happened, or whether it happens at some point in the future.

You should do a similar thing to detect whether the scala plugin has been applied.

--
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