Skip to content

Commit

Permalink
add HasChisel API for build chisel from source in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Mar 15, 2023
1 parent 3c3dbcf commit 4279fb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ class Stdlib(val crossScalaVersion: String)
def chiselModule = chisel(crossScalaVersion)

def pluginModule = plugin(crossScalaVersion)

def macroParadiseIvy: Option[Dep] = if (majorScalaVersion(crossScalaVersion) < 13) Some(v.macroParadise) else None
}

trait ChiselPublishModule extends PublishModule {
Expand Down
16 changes: 12 additions & 4 deletions common.sc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ trait HasChiselPlugin

trait StdLibModule
extends ScalaModule
with HasChiselPlugin {
with HasChisel {
def chiselModule: ChiselModule

override def moduleDeps = super.moduleDeps ++ Seq(chiselModule)
Expand All @@ -150,11 +150,18 @@ trait ChiselModule
override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, coreModule)
}

trait HasChisel
extends ScalaModule
with HasChiselPlugin
with HasMacroAnnotations {
def chiselModule: ChiselModule

def pluginModule = chiselModule.pluginModule
}

trait ChiselUnitTestModule
extends TestModule
with ScalaModule
with HasChiselPlugin
with HasMacroAnnotations
with HasChisel
with TestModule.ScalaTest {
def chiselModule: ChiselModule

Expand All @@ -169,3 +176,4 @@ trait ChiselUnitTestModule
scalacheckIvy
)
}

0 comments on commit 4279fb5

Please sign in to comment.