Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. apply plugin: 'scala'
  2.  
  3. // In this section you declare where to find the dependencies of your project
  4. repositories {
  5. // Use 'jcenter' for resolving your dependencies.
  6. // You can declare any Maven/Ivy/file repository here.
  7. jcenter()
  8. }
  9.  
  10. configurations {
  11. scalaPlugin {
  12. transitive = false
  13. }
  14. }
  15.  
  16. // In this section you declare the dependencies for your production and test code
  17. dependencies {
  18. scalaPlugin 'org.scalamacros:paradise_2.11.7:2.1.0'
  19. scalaPlugin 'org.spire-math:kind-projector_2.11:0.7.1'
  20.  
  21. // We use Scala 2.11 in our library project
  22. compile 'org.scala-lang:scala-library:2.11.7'
  23. compile 'com.storm-enroute:coroutines_2.11:0.4'
  24.  
  25. compile 'org.typelevel:cats_2.11:0.4.1'
  26. compile 'org.spire-math:cats_2.11:0.3.0'
  27.  
  28. compile 'org.scalamacros:resetallattrs_2.11:1.0.0'
  29.  
  30. // We use Scalatest for testing our library
  31. testCompile 'junit:junit:4.12'
  32. testCompile 'org.specs2:specs2-core_2.11:3.7'
  33. testCompile 'org.specs2:specs2-scalacheck_2.11:3.7'
  34. testCompile 'org.scalacheck:scalacheck_2.11:1.13.0'
  35. testCompile 'org.scalatest:scalatest_2.11:2.2.5'
  36. testRuntime 'org.scala-lang.modules:scala-xml_2.11:1.0.5'
  37. }
  38.  
  39. tasks.withType(ScalaCompile) { // or: tasks.withType(ScalaCompile)
  40. scalaCompileOptions.useCompileDaemon = true
  41. scalaCompileOptions.useAnt = false
  42.  
  43. // Set standard
  44. scalaCompileOptions.additionalParameters = [
  45. "-deprecation",
  46. "-unchecked",
  47. "-encoding", "UTF-8",
  48. "-feature",
  49. "-language:postfixOps",
  50. "-language:existentials",
  51. "-language:higherKinds",
  52. "-language:reflectiveCalls",
  53. "-language:implicitConversions",
  54. "-Xfatal-warnings",
  55. "-Xlint",
  56. // "-Xlint:deprecation",
  57. // "-Xlint:unchecked",
  58. // "-Yno-adapted-args",
  59. "-Ywarn-adapted-args",
  60. "-Ywarn-inaccessible",
  61. "-Ywarn-nullary-unit",
  62. // "-Ywarn-infer-any",
  63. // "-Ywarn-dead-code",
  64. // "-Ywarn-numeric-widen",
  65. // "-Ywarn-value-discard",
  66. "-Xfuture",
  67. "-Ywarn-unused-import" // 2.11 only
  68. ]
  69.  
  70. scalaCompileOptions.additionalParameters.addAll(scalaCompilePlugins(project))
  71. }
  72.  
  73. def List<String> scalaCompilePlugins(Project project) {
  74. project.configurations.findAll {
  75. it.name == 'scalaPlugin'
  76. }.collect {
  77. it.files(it.dependencies as Dependency[])
  78. }.flatten().collect {
  79. "-Xplugin:${it.getAbsolutePath()}".toString()
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement