Skip to content

Commit 0ee02bd

Browse files
authored
Update remaining examples still referencing JvmWorkerModule.jvmId (#5950)
With the move of `jvmId` from `JvmWorkerModule` to `JavaModule` in PR #5327 a few examples were not updated. <!-- Please open all PRs as drafts and ensure that your fork of Mill has `settings/actions` / `Allow all actions and reusable workflows` enabled to run CI on your own fork of the Mill repo. Only once CI passes mark the PR as `Ready for review` and CI will run on the main Mill repo before we merge it. -->
1 parent a8e15fa commit 0ee02bd

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

example/thirdparty/commons-io/build.mill

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
package build
44

55
import mill.*, javalib.*, publish.*
6-
import mill.api.ModuleRef
76
import contrib.jmh.JmhModule
87

98
object `package` extends PublishModule, MavenModule {
10-
11-
object JvmWorkerJava11 extends JvmWorkerModule {
12-
def jvmId = "temurin:11.0.24"
13-
}
14-
15-
override def jvmWorker = ModuleRef(JvmWorkerJava11)
9+
def jvmId = "temurin:11.0.24"
1610
def javacOptions = Seq("-encoding", "UTF-8")
1711
def publishVersion = "2.17.0-SNAPSHOT"
1812

website/blog/modules/ROOT/pages/7-graal-native-executables.adoc

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ To build `Foo.java` using Mill, we can use the following build configuration:
8181
----
8282
package build
8383
import mill._, javalib._
84-
import mill.api.ModuleRef
8584
8685
object foo extends JavaModule {
8786
def mvnDeps = Seq(
@@ -125,7 +124,6 @@ above:
125124
----
126125
package build
127126
import mill._, javalib._
128-
import mill.api.ModuleRef
129127
130128
object foo extends JavaModule with NativeImageModule {
131129
def mvnDeps = Seq(
@@ -134,25 +132,21 @@ object foo extends JavaModule with NativeImageModule {
134132
mvn"org.slf4j:slf4j-nop:2.0.7"
135133
)
136134
137-
def jvmWorker = ModuleRef(JvmWorkerGraalvm)
135+
def jvmId = "graalvm-community:23.0.1"
138136
139137
def nativeImageOptions = Seq(
140138
"--no-fallback",
141139
"-H:IncludeResourceBundles=net.sourceforge.argparse4j.internal.ArgumentParserImpl"
142140
)
143141
}
144-
145-
object JvmWorkerGraalvm extends JvmWorkerModule {
146-
def jvmId = "graalvm-community:23.0.1"
147-
}
148142
----
149143

150144
Notable changes:
151145

152146
- `foo` now needs to inherit from `NativeImageModule`
153147

154-
- We need to override `jvmWorker` to point at our own custom `JvmWorkerGraalvm`,
155-
using the version of Graal that we want to use to build our native image.
148+
- We need to override `jvmId` to point at
149+
the version of Graal that we want to use to build our native image.
156150
This uses Mill's ability to xref:mill:ROOT:fundamentals/configuring-jvm-versions.adoc[]
157151
to download the necessary Graal distribution as necessary
158152

0 commit comments

Comments
 (0)