-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First draft of the mill plugin for smithy4s #450
Conversation
Co-authored-by: David Francoeur <dfrancoeur04@gmail.com>
44c4223
to
fa2bcbf
Compare
|
||
/** Input directory for .smithy files */ | ||
protected def smithy4sInputDir: Source = T.source { | ||
PathRef(millSourcePath / "smithy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed from os.pwd
modules/mill-codegen-plugin/test/src/smithy4s/codegen/mill/Smithy4sModuleSpec.scala
Outdated
Show resolved
Hide resolved
modules/mill-codegen-plugin/test/src/smithy4s/codegen/mill/Smithy4sModuleSpec.scala
Show resolved
Hide resolved
|
||
test("multi-module codegen works") { | ||
val fooEv = testKit.staticTestEvaluator(foo)(FullName("multi-module-foo")) | ||
val barEv = testKit.staticTestEvaluator(foo)(FullName("multi-module-bar")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the implicit FullName
here is rather pointless
I'd rather have the evaluator for foo
to write in foo
in this example if I don't provide it, it writes to barEv
and if you have multiple tests that use an evaluator with the same name, they write to the same out
directory.
I think this is more a criticism of https://github.com/com-lihaoyi/mill/pull/1893/files rather than this PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is more a criticism of https://github.com/com-lihaoyi/mill/pull/1893/files rather than this PR though
UX can be improved as we learn more by using it. MiMa has not been set on this module, specifically to be able to iterate.
def smithy4sCodegenDependencies: T[List[String]] = List.empty[String] | ||
|
||
def smithy4sLocalJars: T[List[os.Path]] = T { | ||
T.traverse(moduleDeps)(_.jar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
the new tests add quite a bit of overhead |
artifact name of other mill plugin:
|
@daddykotex I've been thinking the IDE experience hasn't been great recently due to how large the matrix is 😬 I think Oli mentioned one time that a Mill build would work better in Metals. As for new tests slowing this down, maybe we can run scripted tests in parallel with some others (on a separate job)? |
It's not about the build being large, it's that IJ sucks at cross-built modules.
Meh, the scripted tests need some compilation resulting from this job, so it'd be suboptimal to parallelise only to compile the same thing twice. |
@daddykotex looks like this is what we want, let's add it to this PR |
yeah, I've been working on that for the last two hours, I can't figure out the right config
But this produce:
which is slightly off, we want: |
reached out to discord |
Added a bit of logic to override the from this url, we can see that the artifact contain the I've tested locally, given a dummy project like:
I can update my import mill._, mill.scalalib._
object demo extends ScalaModule {
def scalaVersion = "2.13.8"
}
to: import $ivy.`com.disneystreaming.smithy4s::smithy4s-mill-codegen-plugin::dev-SNAPSHOT`
import smithy4s.codegen.mill._
import mill._, mill.scalalib._
object demo extends ScalaModule with Smithy4sModule {
def scalaVersion = "2.13.8"
override def ivyDeps = Agg(
ivy"com.disneystreaming.smithy4s::smithy4s-core:dev-SNAPSHOT"
)
}
Then add a |
you can also use: |
I meant metals though! |
From the 2.13 job:
👍 |
@daddykotex could you add some docs in a subsequent PR ? |
oh yes, I forgot about that |
docs PR: #458 |
This brings mill support on top of `multimodule