Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: 'scala'
- // In this section you declare where to find the dependencies of your project
- repositories {
- // Use 'jcenter' for resolving your dependencies.
- // You can declare any Maven/Ivy/file repository here.
- jcenter()
- }
- configurations {
- scalaPlugin {
- transitive = false
- }
- }
- // In this section you declare the dependencies for your production and test code
- dependencies {
- scalaPlugin 'org.scalamacros:paradise_2.11.7:2.1.0'
- scalaPlugin 'org.spire-math:kind-projector_2.11:0.7.1'
- // We use Scala 2.11 in our library project
- compile 'org.scala-lang:scala-library:2.11.7'
- compile 'com.storm-enroute:coroutines_2.11:0.4'
- compile 'org.typelevel:cats_2.11:0.4.1'
- compile 'org.spire-math:cats_2.11:0.3.0'
- compile 'org.scalamacros:resetallattrs_2.11:1.0.0'
- // We use Scalatest for testing our library
- testCompile 'junit:junit:4.12'
- testCompile 'org.specs2:specs2-core_2.11:3.7'
- testCompile 'org.specs2:specs2-scalacheck_2.11:3.7'
- testCompile 'org.scalacheck:scalacheck_2.11:1.13.0'
- testCompile 'org.scalatest:scalatest_2.11:2.2.5'
- testRuntime 'org.scala-lang.modules:scala-xml_2.11:1.0.5'
- }
- tasks.withType(ScalaCompile) { // or: tasks.withType(ScalaCompile)
- scalaCompileOptions.useCompileDaemon = true
- scalaCompileOptions.useAnt = false
- // Set standard
- scalaCompileOptions.additionalParameters = [
- "-deprecation",
- "-unchecked",
- "-encoding", "UTF-8",
- "-feature",
- "-language:postfixOps",
- "-language:existentials",
- "-language:higherKinds",
- "-language:reflectiveCalls",
- "-language:implicitConversions",
- "-Xfatal-warnings",
- "-Xlint",
- // "-Xlint:deprecation",
- // "-Xlint:unchecked",
- // "-Yno-adapted-args",
- "-Ywarn-adapted-args",
- "-Ywarn-inaccessible",
- "-Ywarn-nullary-unit",
- // "-Ywarn-infer-any",
- // "-Ywarn-dead-code",
- // "-Ywarn-numeric-widen",
- // "-Ywarn-value-discard",
- "-Xfuture",
- "-Ywarn-unused-import" // 2.11 only
- ]
- scalaCompileOptions.additionalParameters.addAll(scalaCompilePlugins(project))
- }
- def List<String> scalaCompilePlugins(Project project) {
- project.configurations.findAll {
- it.name == 'scalaPlugin'
- }.collect {
- it.files(it.dependencies as Dependency[])
- }.flatten().collect {
- "-Xplugin:${it.getAbsolutePath()}".toString()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement