Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
play-contrib: Fixed classloading of worker module and cleanups
Browse files Browse the repository at this point in the history
Fixed dependency resolution of worker classpath.
The collected classpath of the worker module was limited to
only use the worker module.
But this misses all transitive dependencies of the worker.
This is probably because of older limitiations in mill builds,
which also included the mill API itself.
Now, mill uses `compileModuleDeps` for the mill API and we have
clean and usable transitive module and worker classpaths.

Fixed use of mills utility classloader by settings the correct parent classloader.
Using the classloader of the module as parent makes the shared API modules
(which need to be already loaded by the mill build) visible.
The perviously used default was using the classloader which loaded the
mill build (and the ammonite script), which misses the play API module
(loaded via `$ivy` import).
lefou committed May 21, 2021
1 parent 8482922 commit 18c5d29
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ private[playlib] class RouteCompilerWorker {
val cl = mill.api.ClassLoader.create(
toolsClassPath,
null,
sharedLoader = getClass().getClassLoader(),
sharedPrefixes = Seq("mill.playlib.api.")
)
val bridge = cl
1 change: 0 additions & 1 deletion contrib/playlib/src/mill/playlib/RouterModule.scala
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ trait RouterModule extends ScalaModule with Version {
workerKey,
s"mill-contrib-playlib-worker-${playMinorVersion()}",
repositoriesTask(),
resolveFilter = _.toString.contains("mill-contrib-playlib-worker"),
artifactSuffix = playMinorVersion() match {
case "2.6" => "_2.12"
case _ => "_2.13"

0 comments on commit 18c5d29

Please sign in to comment.