Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package test
  2.  
  3. @TestAnnotation(Constants.test + ", world!")
  4. object HelloWorld {
  5. def main(args: Array[String]) {
  6. println("Hello, world!")
  7. }
  8. }
  9.  
  10. package test
  11.  
  12. object Constants {
  13. final val test = "Hello"
  14. }
  15.  
  16. package test;
  17.  
  18. @interface TestAnnotation {
  19. String value();
  20. }
  21.  
  22. $ sbt run
  23. [info] Compiling 2 Scala sources and 1 Java source to .../so22717836annotation/target/scala-2.10/classes...
  24. [info] Running HelloWorld
  25. Hello, world!
  26.  
  27. $ for i in `echo build.sbt; find src/main -type f`; do
  28. echo '###' $i '###'; echo; perl -pe 's/^/ /' $i; echo; done
  29.  
  30. name := "so22717836"
  31.  
  32. version := "0.0.1"
  33.  
  34. scalaVersion := "2.10.4"
  35.  
  36. package test;
  37.  
  38. public @interface TestAnnotation {
  39. String value();
  40. }
  41.  
  42. import test._
  43.  
  44. @TestAnnotation(Constants.test + ", world!")
  45. object HelloWorld {
  46. def main(args: Array[String]) {
  47. println("Hello, world!")
  48. }
  49. }
  50.  
  51. object Constants {
  52. final val test = "Hello"
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement