Ross Black wrote:
Hi,
I have completed updating the scala plugin to work with the latest
gradle code.
The code is in http://github.com/black/gradle-scala/ and should now be
ready to integrate into the main code repository (if it looks ok).
It has tasks to compile scala code and tests, and to generate scala
documentation from the source code.
The tasks are implemented using ant. I have separated the ant code
into AntScalaDefine, AntScalaCompile, and AntScalaDoc to make it
easier to replace (or supplement) these implementations with code that
uses the scala compiler API directly.
A sample is provided, and all of the code has unit tests (except for
the Ant* code - I still want to figure out a reasonable way to test
this code).
Some notes / issues:
- 2 configurations are used (scala, and scalaTools) so that the scala
tools jar does not pollute the classpath used for compilation of
application code. The ScalaDefine task is used to add the scala ant
tasks into the project ant. (there are some other ant tasks that this
makes available that are not exposed via the gradle tasks).
Is the 'scala' configuration used to add the scala APIs to the compile
configuration (more or less like the 'groovy' configuration)? We are
planning on merging the 'groovy' configuration into the 'compile'
configuration, and just extracting the groovy dependencies out of the
compile configuration:
compile ':groovy-all:1.6.0:', ':some-dependency:1.2:'
Would a similar approach work for the scala configuration?
- Should bootclasspath and extpath be part of compile/doc options?
I'm not sure what we need these for?
I put them as part of the constructor of the Ant* classes. This was
an attempt to get a common signature for all compile ant tasks so that
the compiler can be switched easily.
- How many options should get put on the convention object? Every
option is available on the ScalaCompile, but is not exposed in the
convention
I think we're still figuring out the answer to this question. I reckon
something like: if it's information about the project which is shared by
multiple tasks, then it should be on the convention. So I don't think we
want every compile option on the convention.
Adam
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email