Skip to content

Commit

Permalink
Attempt to fix windows compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceWarne committed Nov 4, 2022
1 parent 4f0680a commit 2f20466
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions contrib/jmh/src/mill/contrib/jmh/JmhModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ trait JmhModule extends JavaModule {
val dest = T.ctx().dest
val (sourcesDir, _) = generateBenchmarkSources()
val sources = os.walk(sourcesDir).filter(os.isFile)

os.proc(
"javac",
Jvm.jdkTool("javac"),
sources.map(_.toString),
"-cp",
(runClasspath() ++ generatorDeps()).map(_.path.toString).mkString(":"),
(runClasspath() ++ generatorDeps()).map(_.path.toString).mkString(
java.io.File.pathSeparator
),
"-d",
dest
).call(dest)
Expand All @@ -80,7 +83,7 @@ trait JmhModule extends JavaModule {
Jvm.runSubprocess(
"org.openjdk.jmh.generators.bytecode.JmhBytecodeGenerator",
(runClasspath() ++ generatorDeps()).map(_.path),
mainArgs = Array(
mainArgs = Seq(
compile().classes.path.toString,
sourcesDir.toString,
resourcesDir.toString,
Expand Down
5 changes: 2 additions & 3 deletions contrib/jmh/test/src/JmhModuleTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ object JmhModuleTest extends TestSuite {

def tests = Tests {
test("jmh") {
"detects benchmarks" - workspaceTest(jmh) { eval =>
"listJmhBenchmarks" - workspaceTest(jmh) { eval =>
val paths = EvaluatorPaths.resolveDestPaths(eval.outPath, jmh.listJmhBenchmarks())
val outFile = paths.dest / "benchmarks.out"
println(outFile)
val Right((result, _)) = eval(jmh.listJmhBenchmarks("-o", outFile.toString))
val expected = """Benchmarks:
|mill.contrib.jmh.Bench2.log
|mill.contrib.jmh.Bench2.sqrt
|mill.contrib.jmh.Bench1.measureShared
|mill.contrib.jmh.Bench1.measureUnshared""".stripMargin
val out = os.read.lines(outFile).map(_.trim).mkString("\n")
val out = os.read.lines(outFile).map(_.trim).mkString(System.lineSeparator())
assert(out == expected)
}
}
Expand Down

0 comments on commit 2f20466

Please sign in to comment.