Details
Description
I know this is not scheduled until after 1.0, but I was playing with scala and gradle and thought that this would be useful.
I have attached a patch that provides code for a plugin to perform Scala compilation and doc generation.
Unfortunately I have run out of time and wont be able to get back to do any more work on this for a while.
Hopefully it provides a reasonable starting point.
The plugin provides the basics for ant tasks and gradle convention tasks.
I have not tested it very thoroughly, but it appears to work OK for the very simple scala project.
The areas that need further work:
- downloading scala via dependencies, and setting the classpath
- testing
- mixed scala/java projects (this is just starting to be supported in 2.7.2)
- raw (not using ant) implementations of the execution classes.
A few thoughts:
- I attempted to give the execute methods of the ant tasks a signature that could be the same for the raw (not using ant) implementation.
- It would be good if compilation (and doc) tasks for all languages/compilers could be the same so that the implementation could be switched easily via configuration, and more code could be re-used across various plugins. This might mean moving properties like 'sourceCompatibility' into each options object (which would be different per compiler?)
- The ScalaCompile task extends Compile, but that means it gets a lot of properties that are not used. Perhaps a refactor to extract some common properties.
Hope this helps.
I have updated the Scala plugin so that it does not require an installation of scala, and gets the libraries it needs via dependencies. The test project now runs successfully for the full pass of compile, test, scaladoc, etc. This is definitely the last work I can do on the plugin for a significant period of time.
I could not submit it in the patch file, but the scalaproject needs junit-4.4.jar in the lib directory (same as javaproject)
I am sure it needs more thorough testing of various options and paths, but the plugin should now be generally usable.