Skip to content

Commit 0eb2cee

Browse files
committed
Fix incorrect prepareOffline in AssemblyModule
`prepareOffline` method should be a member of the trait, otherwise it will not be evaluated by downstream modules. Signed-off-by: unlsycn <[email protected]>
1 parent 06170d5 commit 0eb2cee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

libs/javalib/src/mill/javalib/AssemblyModule.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import mill.util.Jvm
1111
/**
1212
* Module that provides functionality around creating and configuring JVM assembly jars
1313
*/
14-
trait AssemblyModule extends mill.api.Module {
14+
trait AssemblyModule extends mill.api.Module with OfflineSupportModule {
1515
outer =>
1616

1717
def finalMainClassOpt: T[Either[String, String]]
@@ -148,22 +148,22 @@ trait AssemblyModule extends mill.api.Module {
148148
created.pathRef
149149
}
150150
}
151+
152+
override def prepareOffline(all: mainargs.Flag): Task.Command[Seq[PathRef]] = Task.Command {
153+
(
154+
super.prepareOffline(all)() ++
155+
AssemblyModule.jarjarabramsWorkerClasspath()
156+
).distinct
157+
}
151158
}
152-
object AssemblyModule extends ExternalModule with CoursierModule with OfflineSupportModule {
159+
object AssemblyModule extends ExternalModule with CoursierModule {
153160

154161
def jarjarabramsWorkerClasspath: T[Seq[PathRef]] = Task {
155162
defaultResolver().classpath(Seq(
156163
Dep.millProjectModule("mill-libs-javalib-jarjarabrams-worker")
157164
))
158165
}
159166

160-
override def prepareOffline(all: mainargs.Flag): Task.Command[Seq[PathRef]] = Task.Command {
161-
(
162-
super.prepareOffline(all)() ++
163-
jarjarabramsWorkerClasspath()
164-
).distinct
165-
}
166-
167167
private[mill] def jarjarabramsWorkerClassloader: Task.Worker[ClassLoader] = Task.Worker {
168168
Jvm.createClassLoader(
169169
classPath = jarjarabramsWorkerClasspath().map(_.path),

0 commit comments

Comments
 (0)