- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
newbie compiler plugin help
Mon, 2011-11-28, 00:29
I have followed the instructions on the scala-lang page about scalac
plugins (http://www.scala-lang.org/node/140) but cannot even get the
example they give to work. I receive the following error when trying
to run the plugin wrapped in a jar using the Xplugin: option as
detailed towards the end of the page:
Warning: class not found for plugin in divbyzero.jar
(localhost.DivByZero)
any help would be greatly appreciated,
George
Mon, 2011-11-28, 12:37
#2
Re: newbie compiler plugin help
There's another introduction to compiler plugins at:
http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part-2.html
Not sure whether you want to step in debug mode through the compiler right away (should help when authoring compiler plugins, anyway). The snippet below shows where that error message comes from:
/** Loads a plugin class from the named jar file.
*
* @return `None` if the jar file has no plugin in it or
* if the plugin is badly formed.
*/
def loadFrom(jarfile: Path, loader: ClassLoader): Option[AnyClass] =
Miguel
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
On 27 Nov 2011, at 23:29, George Chapman wrote:
> I have followed the instructions on the scala-lang page about scalac
> plugins (http://www.scala-lang.org/node/140) but cannot even get the
> example they give to work. I receive the following error when trying
> to run the plugin wrapped in a jar using the Xplugin: option as
> detailed towards the end of the page:
>
> Warning: class not found for plugin in divbyzero.jar
> (localhost.DivByZero)
>
> any help would be greatly appreciated,
That sounds very much as though the classname you specified in your scalac-plugin.xml isn't correct. Have you misspelled it? Or is the class not actually in the .jar file for some reason?
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: paul@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher