Skip to content

Commit

Permalink
Rename 'jvmArgs' -> 'jvmOptions'
Browse files Browse the repository at this point in the history
  • Loading branch information
megri committed Mar 11, 2024
1 parent d501901 commit 655dc4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contrib/docker/src/mill/contrib/docker/DockerModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait DockerModule { outer: JavaModule =>
def labels: T[Map[String, String]] = Map.empty[String, String]
def baseImage: T[String] = "gcr.io/distroless/java:latest"
def pullBaseImage: T[Boolean] = T(baseImage().endsWith(":latest"))
def jvmArgs: T[Seq[String]] = Seq.empty[String]
def jvmOptions: T[Seq[String]] = Seq.empty[String]

/**
* TCP Ports the container will listen to at runtime.
Expand Down Expand Up @@ -114,7 +114,7 @@ trait DockerModule { outer: JavaModule =>
if (user().isEmpty) "" else s"USER ${user()}"
).filter(_.nonEmpty).mkString(sys.props("line.separator"))

val quotedEntryPointArgs = (Seq("java") ++ jvmArgs() ++ Seq("-jar", s"/$jarName"))
val quotedEntryPointArgs = (Seq("java") ++ jvmOptions() ++ Seq("-jar", s"/$jarName"))
.map(arg => s"\"$arg\"").mkString(", ")

s"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ object DockerModuleTest extends TestSuite {
override def executable = testExecutable
}

object dockerJvmArgs extends DockerConfig {
object dockerJvmOptions extends DockerConfig {
override def executable = testExecutable
override def jvmArgs = Seq("-Xmx1024M")
override def jvmOptions = Seq("-Xmx1024M")
}
}

Expand Down Expand Up @@ -138,9 +138,9 @@ object DockerModuleTest extends TestSuite {
assert(dockerfileStringRefined == expected)
}

"extra jvm args" - {
"extra jvm options" - {
val eval = new TestEvaluator(Docker)
val Right((dockerfileString, _)) = eval(Docker.dockerJvmArgs.dockerfile)
val Right((dockerfileString, _)) = eval(Docker.dockerJvmOptions.dockerfile)
val expected = multineRegex.replaceAllIn(
"""
|FROM gcr.io/distroless/java:latest
Expand Down

0 comments on commit 655dc4a

Please sign in to comment.