Skip to content

Commit f4dc077

Browse files
authored
[panama] add publish flow for panama modules (#4670)
Signed-off-by: unlsycn <[email protected]>
1 parent 04dfcf1 commit f4dc077

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

circtpanamabinding/package.mill

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import mill.scalalib._
55
import mill.scalalib.scalafmt._
66

77
import build._
8+
import build_.release
89

910
object `package` extends RootModule with CIRCTPanamaBinding
1011

1112
// Java Codegen for all declared functions.
1213
// All of these functions are not private API which is subject to change.
13-
trait CIRCTPanamaBinding extends HasJextractGeneratedSources {
14+
trait CIRCTPanamaBinding extends HasJextractGeneratedSources with release.ChiselPublishModule {
15+
override def javadocOptions = Task(super.javadocOptions() ++ Seq("--enable-preview", "--release", "21"))
16+
1417
object utils extends Module {
1518
val architecture = System.getProperty("os.arch")
1619
val operationSystem = System.getProperty("os.name")

panamaconverter/package.mill

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import mill.scalalib.scalafmt._
66
import mill.define.Cross
77

88
import build._
9+
import build_.release
910

1011
object `package` extends RootModule {
1112
// https://github.com/com-lihaoyi/mill/issues/3693
@@ -17,12 +18,16 @@ trait PanamaConverter
1718
with HasPanamaOMModule
1819
with CrossModuleBase
1920
with HasScala2Plugin
20-
with ScalafmtModule {
21+
with ScalafmtModule
22+
with release.ChiselPublishModule {
2123
def millSourcePath = super.millSourcePath / os.up
2224

2325
def panamaOMModule = panamaom.cross(crossScalaVersion)
2426
def chiselModule = chisel(crossScalaVersion)
2527
def pluginModule = plugin.cross(crossScalaVersion)
2628

27-
override def moduleDeps = super.moduleDeps ++ Some(chiselModule)
29+
// use to be propagated to downstream modules
30+
override def moduleDeps = super.moduleDeps ++ Some(unipublish)
31+
32+
override def compileClasspath = Task { super.compileClasspath() ++ unipublish.localClasspath() }
2833
}

panamalib/package.mill

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ import mill.scalalib.scalafmt._
66
import mill.define.Cross
77

88
import build._
9+
import build_.release
910

1011
object `package` extends RootModule {
1112
// https://github.com/com-lihaoyi/mill/issues/3693
1213
object cross extends Cross[PanamaLib](v.scalaCrossVersions)
1314
}
1415

1516
// The Scala API for PanamaBinding, API here is experimentally public to all developers
16-
trait PanamaLib extends ScalaModule with HasCIRCTPanamaBindingModule with CrossModuleBase with ScalafmtModule {
17+
trait PanamaLib
18+
extends ScalaModule
19+
with HasCIRCTPanamaBindingModule
20+
with CrossModuleBase
21+
with ScalafmtModule
22+
with release.ChiselPublishModule {
1723
def millSourcePath = super.millSourcePath / os.up
1824

1925
def circtPanamaBindingModule = circtpanamabinding

panamaom/package.mill

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ import mill.scalalib.scalafmt._
66
import mill.define.Cross
77

88
import build._
9+
import build_.release
910

1011
object `package` extends RootModule {
1112
// https://github.com/com-lihaoyi/mill/issues/3693
1213
object cross extends Cross[PanamaOM](v.scalaCrossVersions)
1314
}
1415

15-
trait PanamaOM extends ScalaModule with HasPanamaLibModule with CrossModuleBase with ScalafmtModule {
16+
trait PanamaOM
17+
extends ScalaModule
18+
with HasPanamaLibModule
19+
with CrossModuleBase
20+
with ScalafmtModule
21+
with release.ChiselPublishModule {
1622
def millSourcePath = super.millSourcePath / os.up
1723

1824
def panamaLibModule = panamalib.cross(crossScalaVersion)

plugin/package.mill

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import mill.scalalib.scalafmt._
66
import mill.define.Cross
77

88
import build._
9-
import $file.release
9+
import build_.release
1010

1111
object `package` extends RootModule {
1212
// https://github.com/com-lihaoyi/mill/issues/3693

0 commit comments

Comments
 (0)