Jeppe Nejsum Madsen wrote:
Hi,

In an attempt to resurrect my recently failing builds, I'll try to
implement a rudimentary Scala plugin.

Alas, it seems "Chapter 25. How to write Custom Plugins" in the otherwise
great user guide is suspiciously empty :-), so a few questions:

- Which plugin is the best model to start from? I was thinking about the
  Groovy plugin since it also supports joint Groovy/Java compilation

That's probably the best place to start.

We're going to have to rework how the groovy plugin changes the compilation tasks, as this approach won't work well with other plugins which do the same thing. That is, you won't be able to use the groovy and scala plugins together in the same project. We can fix this later.

- Can a plugin be written entirely in Groovy?


Absolutely. Or any language that ends up compiled to bytecode. You could even write the scala plugin in scala (if you wanted a little extra pain)

- Can I put the plugin code in buildSrc and it will just work?

Yes.

  - I tried this, but seems the gradle code is not on the classpath?? I
  get errors like these:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: 
startup failed, 
/Users/jeppe/Documents/workspaces/buildSrc/src/main/groovy/gradle/ScalaPlugin.groovy:
 19: unable to resolve class org.gradle.api.Action
 @ line 19, column 1.
   import org.gradle.api.Action;
   ^
/Users/jeppe/Documents/workspaces/buildSrc/src/main/groovy/gradle/ScalaPlugin.groovy:
 22: unable to resolve class org.gradle.api.artifacts.Configuration
 @ line 22, column 1.
   import org.gradle.api.artifacts.Configuration;
   ^
/Users/jeppe/Documents/workspaces/buildSrc/src/main/groovy/gradle/ScalaPlugin.groovy:
 31: unable to resolve class org.gradle.api.plugins.ProjectPluginsContainer
 @ line 31, column 1.
   import org.gradle.api.plugins.ProjectPluginsContainer

- Any other hints?

/Jeppe

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

    http://xircles.codehaus.org/manage_email



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

   http://xircles.codehaus.org/manage_email


Reply via email to