A place to chat about mill and ask questions. You can also use our new forum at Github Discussions (https://github.com/lihaoyi/mill/discussions)
github-actions[bot] on gh-pages
Updated github pages from commi… (compare)
lefou on 0.10.5
lefou on main
Prepared release 0.10.5 (compare)
github-actions[bot] on gh-pages
Updated github pages from commi… (compare)
lefou on main
Update bloop-config to 1.5.2 (#… (compare)
github-actions[bot] on gh-pages
Updated github pages from commi… (compare)
lefou on main
Added a link to JProfile websit… (compare)
github-actions[bot] on gh-pages
Updated github pages from commi… (compare)
lefou on main
Test case ensuring zinc is only… (compare)
github-actions[bot] on gh-pages
Updated github pages from commi… (compare)
lefou on main
Fix zinc binary dependencies (#… (compare)
hi, thanks for everything
we're using mill a lot here and sometimes we write or own plugins (libraries pull in other builds)
we started looking into writing test for those and so far we've had to grab a copy of https://github.com/com-lihaoyi/mill/blob/main/main/test/src/util/TestEvaluator.scala to run our test
would you be interested in a PR that does the following:
(cross posting from scala#com-lihaoyi)
TestEvaluator
, but on the other side, it allows more integrationtest-like setups and also supports tests against different Mill versions.
There seems to be what I would consider to be an error in mill 0.10.4 -- possibly in earlier version (I haven't checked). Here's what I see:
I've defined the following in a JAR archive that I build locally and add to the local maven repo (local maven coordinate "bmaso::mylib:0.0.1", package bmaso
):
package bmaso
import upickle.default.{ReadWriter => RW, macroRW}
case class DatasetFile(filename: String, timestamp: Long, size: Long)
object DatasetFile {
//...upickle RW so I can use this as the value type of a mill target...
implicit val rw: RW[DatasetFile] = macroRW
}
I have this very simple build.sc
script:
import $repo.`file://<my home dir>/.m2/repository`
import mill._, scalalib._
import $ivy.`bmaso::mylib:0.0.1`, bmaso._
def test = T {
DatasetFile("test", 1L, 1L)
}
I would expect mill show test
to just spit out the JSON representation of that DatasetFile object. Instead I get the following stack trace:
Exception in thread "MillServerActionRunner" java.lang.NoClassDefFoundError: scala/Serializable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
...(elided for readability)...
Caused by: java.lang.ClassNotFoundException: scala.Serializable
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at ammonite.runtime.SpecialClassLoader.findClass(ClassLoaders.scala:241)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 80 more
ReadWriter
in a jar loaded from the startup set of repos, or defined in the script itself, or in a script imported from a static location (using $file
). You just can't load from a JAR loaded from a dynamically-defined repo location
Out of interest: Have you tried (or are you aware of) mill-integrationtest, a plugin specifically for testing mill plugins? It is more loosely coupled to Mill than
TestEvaluator
, but on the other side, it allows more integrationtest-like setups and also supports tests against different Mill versions.
I gave it a shot, but I got blocked. Our plugin pulls dependencies from an internal artifactory. When the IT test runs, it tries to pull dependencies maven central instead. it ignores the configured repositoriesTask
. I tried configuring it in multiple places but I did not succeed (our plugin configures it, I added the configuration to the ittest
module I created, I also added the configuration in the test itself)
perTestResources
(see documentation: https://github.com/lefou/mill-integrationtest#configuration-and-targets), which could be a shared.sc
which you generate and include in each project under test
I have the feeling that something silly is happening, but I can't see it. Can anyone?
import $ivy.`com.disneystreaming.smithy4s::smithy4s-codegen:0.12.16`
import coursier.maven.MavenRepository
import mill._
import mill.api.PathRef
import mill.scalalib._
import os.Path
import smithy4s.codegen.{Codegen => Smithy4s}
import smithy4s.codegen.CodegenArgs
import scala.util._
trait Smithy4sModule extends ScalaModule {
}
And I get this;
Compiling /Users/simon/Code/mill-full-stack/mill-full-stack/project/smithy4s.sc
/Users/simon/Code/mill-full-stack/mill-full-stack/project/smithy4s.sc:8: value codegen is not a member of object ammonite.$file.project.smithy4s
import smithy4s.codegen.{Codegen => Smithy4s}
smithy4s.codegen
isn't part of them.
smithy4s
which Ammonite uses to create the object smithy4s
which wraps your code. You need to either change the imports to import _root_.smithy4s.codegen.{Codegen => Smithy4s}
etc. or rename the file to some other name.
mill
dir, and everthing went crazy.
CrossType.Full
sources
to add shared folder too?
build.sc
, you can't avoid it.
./out
does not support distribution