~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to docs/examples/plugintemplate/src/plugintemplate/TemplatePlugin.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package plugintemplate
2
 
 
3
 
import scala.tools.nsc.Global
4
 
import scala.tools.nsc.plugins.Plugin
5
 
 
6
 
/** A class describing the compiler plugin
7
 
 *
8
 
 *  @todo Adapt the name of this class to the plugin being
9
 
 *  implemented
10
 
 */
11
 
class TemplatePlugin(val global: Global) extends Plugin {
12
 
  /** The name of this plugin. Extracted from the properties file. */
13
 
  val name = PluginProperties.pluginName
14
 
 
15
 
  val runsAfter = List[String]("refchecks")
16
 
 
17
 
  /** A short description of the plugin, read from the properties file */
18
 
  val description = PluginProperties.pluginDescription
19
 
  
20
 
  /** @todo A description of the plugin's options */
21
 
  override val optionsHelp = Some(
22
 
    "  -P:"+ name +":option     sets some option for this plugin")
23
 
 
24
 
  /** @todo Implement parsing of plugin options */
25
 
  override def processOptions(options: List[String], error: String => Unit) {
26
 
    super.processOptions(options, error)
27
 
  }
28
 
 
29
 
  /** The compiler components that will be applied when running
30
 
   *  this plugin
31
 
   *
32
 
   *  @todo Adapt to the plugin being implemented
33
 
   */
34
 
  val components = TemplatePlugin.components(global)
35
 
 
36
 
  val checker = new TemplateAnnotationChecker {
37
 
    val global: TemplatePlugin.this.global.type = TemplatePlugin.this.global
38
 
  }
39
 
  global.addAnnotationChecker(checker.checker)
40
 
}
41
 
 
42
 
object TemplatePlugin {
43
 
  /** Yields the list of Components to be executed in this plugin
44
 
   *
45
 
   *  @todo: Adapt to specific implementation.
46
 
   */
47
 
  def components(global: Global) =
48
 
    List(new TemplateComponent(global),
49
 
         new TemplateTraverseComponent(global),
50
 
         new TemplateTransformComponent(global),
51
 
         new TemplateInfoTransformComponent(global))
52
 
}