HairyFotr / linter

Static Analysis Compiler Plugin for Scala
Apache License 2.0
268 stars 34 forks source link

2.11 .jar has no manifest #25

Closed xanderdunn closed 9 years ago

xanderdunn commented 9 years ago

I downloaded the .jar for Scala 2.11 from the link provided in the README.md and running it with java -jar linter_2.11-0.1-SNAPSHOT.jar gives me the error no main manifest attribute, in linter_2.11-0.1-SNAPSHOT.jar.

HairyFotr commented 9 years ago

I doubt it's runnable in this way, but I will check if there's something wrong with the release jars later when I'm at home... it's meant to be included into scala compilation with e.g. scalac -Xplugin:linter_2.11-0.1-SNAPSHOT.jar somesourcefile.scala.

HairyFotr commented 9 years ago

I clicked your profile, and saw you're adding all the analyzers to your machine learning repo - cool! :)

You actually have a build.sbt in your project, so you can just add this to it, and it will run on every compile: addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.12")

To not run on every compile (since it adds some overhead), and also for usage examples of some other analyzers, there is this example repo by Leif Wickland: https://github.com/leifwickland/static-analysis-skeleton

xanderdunn commented 9 years ago

@HairyFotr Ah, thanks. I missed the part where it should be run as a scalac plugin. I'll give that a try.

Yeah, for that project I can add it to sbt, but actually currently I'm trying to add the linter to an internal project that only uses gradle. Thanks!

xanderdunn commented 9 years ago

I added it as a scalac flag -Xplugin:linter_2.11-0.1-SNAPSHOT.jar to my gradle configuration and this worked well! Thanks!