1import mill._, scalalib._ 2import coursier.maven.MavenRepository 3 4object CustomZincWorkerModule extends ZincWorkerModule { 5 def repositories() = super.repositories ++ Seq( 6 MavenRepository("https://oss.sonatype.org/content/repositories/releases"), 7 MavenRepository("https://oss.sonatype.org/content/repositories/snapshots") 8 ) 9} 10 11/** 12 * Scala 2.12 module that is source-compatible with 2.11. 13 * This is due to Chisel's use of structural types. See 14 * https://github.com/freechipsproject/chisel3/issues/606 15 */ 16trait HasXsource211 extends ScalaModule { 17 override def scalacOptions = T { 18 super.scalacOptions() ++ Seq( 19 "-deprecation", 20 "-unchecked", 21 "-Xsource:2.11" 22 ) 23 } 24} 25 26trait HasChisel3 extends ScalaModule { 27 override def ivyDeps = Agg( 28 ivy"edu.berkeley.cs::chisel3:3.2.0-RC1" 29 ) 30} 31 32trait HasChiselTests extends CrossSbtModule { 33 object test extends Tests { 34 override def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.4", ivy"edu.berkeley.cs::chisel-iotesters:1.2+") 35 def testFrameworks = Seq("org.scalatest.tools.Framework") 36 } 37} 38 39trait HasMacroParadise extends ScalaModule { 40 // Enable macro paradise for @chiselName et al 41 val macroPlugins = Agg(ivy"org.scalamacros:::paradise:2.1.0") 42 def scalacPluginIvyDeps = macroPlugins 43 def compileIvyDeps = macroPlugins 44} 45 46object chiselModule extends CrossSbtModule with HasChisel3 with HasChiselTests with HasXsource211 with HasMacroParadise { 47 def zincWorker = CustomZincWorkerModule 48 def crossScalaVersion = "2.11.12" 49} 50 51