Skip to content

Commit

Permalink
JMH Plugin : This is a forkArg not a compiler option (#3957)
Browse files Browse the repository at this point in the history
#3578 set out to allow passing JVM flags (for example
`--add-modules=jdk.incubator.vector`) into the JVM used by the JMH
plugin when trying to benchmark something in mill.

That implementation kind of works, - it uses `javaCoptions` to pass to
the JVM args though, which isn't very idiomatic mill. Runtime arguments
are usually passed as `forkArgs`. This PR seeks to use 'forkArgs'
instead of the 'javaCoptions' of the mill module.

Both are a list of strings in the end, so both work, but I think this
revised version more correctly follows mill nomenclature as forkedArgs
rather than compiler flags.

Apologies for the spamminess.
  • Loading branch information
Quafadas authored Nov 14, 2024
1 parent 5eebf62 commit 68169eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/jmh/src/mill/contrib/jmh/JmhModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ trait JmhModule extends JavaModule {
def generateBenchmarkSources =
Task {
val dest = T.ctx().dest
val javacOpts = javacOptions().toSeq
val forkedArgs = forkArgs().toSeq
val sourcesDir = dest / "jmh_sources"
val resourcesDir = dest / "jmh_resources"

Expand All @@ -90,7 +90,7 @@ trait JmhModule extends JavaModule {
resourcesDir.toString,
"default"
),
jvmArgs = javacOpts
jvmArgs = forkedArgs
)

(sourcesDir, resourcesDir)
Expand Down

0 comments on commit 68169eb

Please sign in to comment.