diff options
Diffstat (limited to 'docs/examples/plugintemplate/doc')
-rw-r--r-- | docs/examples/plugintemplate/doc/README | 42 | ||||
-rw-r--r-- | docs/examples/plugintemplate/doc/examples/plugintemplate/examples/BasicExample.scala | 8 |
2 files changed, 50 insertions, 0 deletions
diff --git a/docs/examples/plugintemplate/doc/README b/docs/examples/plugintemplate/doc/README new file mode 100644 index 0000000000..f3b9e15e97 --- /dev/null +++ b/docs/examples/plugintemplate/doc/README @@ -0,0 +1,42 @@ +Scala compiler plugin template +------------------------------ + +This project is a template that can be used for creating compiler +plugins for the Scala compiler. + + +Installation +------------ +To install the compiler plugin, run "ant install". This will create +an sbaz package for the template plugin and install it in the scala +installation available in your PATH. +The install command will also create a script for running the plugin +as standalone application. The command is called "runplugintemplate" +and available in your scala installation as well. +To uninstall the plugin again, run "and uninstall". + +Alternatively, copy the file build/pack/plugintemplate.jar, generated +by "ant pack", to the directory misc/scala-devel/plugins of your +scala distribution. The scala compiler will then find and integrate +the new plugin. + +Customization +------------- +The following files need to be edited when creating a new plugin +- plugin.properties +- misc/scalac-plugin.xml +- src / test / doc/examples: The source files of the template plugin + are located a package called "plugintemplate". This will most likely + be changed for new plugins. + +When using eclipse for development, make sure "scala-compiler.jar" is +in the Java Build Path: Right-Click the project and select "Properties". +Then go to "Java Build Path" -> "Libraries" and add the jar file +"eclipse/plugins/ch.epfl.lamp.sdt.core[..]/lib/scala-compiler.jar". + +Ant tasks +--------- +"build.xml" defines Ant tasks for building, testing and packing a +plugin. The tests are written using the ScalaTest framework +(http://www.artima.com/scalatest/). +Run the tests using "ant test", or "ant guitest". diff --git a/docs/examples/plugintemplate/doc/examples/plugintemplate/examples/BasicExample.scala b/docs/examples/plugintemplate/doc/examples/plugintemplate/examples/BasicExample.scala new file mode 100644 index 0000000000..d1f6c91cdc --- /dev/null +++ b/docs/examples/plugintemplate/doc/examples/plugintemplate/examples/BasicExample.scala @@ -0,0 +1,8 @@ +package plugintemplate.examples + +/** An example demonstrating the fancy features of the new + * compiler plugin. + */ +class BasicExample { + def foo = () +} |