Skip to content

Commit

Permalink
[tests] allow mill to read include path from environment
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <dev@avimit.in>
  • Loading branch information
Avimitin committed Jul 29, 2023
1 parent 8045232 commit 9ad3bed
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ class CodeGenCase(val config: String) extends Case {
def codeGenConfig = T(testConfig().obj("name").str)
def genelf = T(codegenCaseGenerator.asmGenerator().path)
override def includeDir = T {
Seq(
millSourcePath / "env" / "sequencer-vector",
millSourcePath / "macros" / "sequencer-vector"
).map(PathRef(_))
// User can set CODEGEN_INC_PATH to "/path/to/lib /path/to/another/lib /path/to/yet/another/lib"
sys.env.get("CODEGEN_INC_PATH").map(raw =>
// Array[String] => Seq[os.PathRef]
raw.split(' ').map( each => PathRef(os.Path(each)) ).toSeq
).getOrElse(
Seq(
millSourcePath / "env" / "sequencer-vector",
millSourcePath / "macros" / "sequencer-vector"
).map(PathRef(_))
)
}
override def allSourceFiles = T.sources {
val output = T.dest / s"$config.S"
Expand Down

0 comments on commit 9ad3bed

Please sign in to comment.