-
Notifications
You must be signed in to change notification settings - Fork 72
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
mill codegen dependancies are "provided" #1552
base: series/0.18
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -388,6 +388,25 @@ lazy val `aws-http4s` = projectMatrix | |
.jsPlatform(latest2ScalaVersions, jsDimSettings) | ||
.nativePlatform(allNativeScalaVersions, nativeDimSettings) | ||
|
||
// Seperated out to help the mill codegen plugin not require "Provided" dependencies in test | ||
val codegenDeps = Def.setting { | ||
Seq( | ||
Dependencies.Cats.core.value, | ||
Dependencies.Smithy.model, | ||
Dependencies.Smithy.build, | ||
Dependencies.Alloy.core, | ||
Dependencies.Alloy.openapi, | ||
Dependencies.Smithytranslate.proto, | ||
"com.lihaoyi" %% "os-lib" % "0.9.3", | ||
Dependencies.Circe.core.value, | ||
Dependencies.Circe.parser.value, | ||
Dependencies.Circe.generic.value, | ||
Dependencies.collectionsCompat.value, | ||
"org.scala-lang" % "scala-reflect" % scalaVersion.value, | ||
"io.get-coursier" %% "coursier" % "2.1.9" | ||
) | ||
} | ||
|
||
/** | ||
* This module contains the logic used at build time for reading smithy | ||
* models and rendering Scala (or openapi) code. | ||
|
@@ -407,21 +426,7 @@ lazy val codegen = projectMatrix | |
"alloyVersion" -> Dependencies.Alloy.alloyVersion | ||
), | ||
buildInfoPackage := "smithy4s.codegen", | ||
libraryDependencies ++= Seq( | ||
Dependencies.Cats.core.value, | ||
Dependencies.Smithy.model, | ||
Dependencies.Smithy.build, | ||
Dependencies.Alloy.core, | ||
Dependencies.Alloy.openapi, | ||
Dependencies.Smithytranslate.proto, | ||
"com.lihaoyi" %% "os-lib" % "0.9.3", | ||
Dependencies.Circe.core.value, | ||
Dependencies.Circe.parser.value, | ||
Dependencies.Circe.generic.value, | ||
Dependencies.collectionsCompat.value, | ||
"org.scala-lang" % "scala-reflect" % scalaVersion.value, | ||
"io.get-coursier" %% "coursier" % "2.1.9" | ||
), | ||
libraryDependencies ++= codegenDeps.value, | ||
libraryDependencies ++= munitDeps.value, | ||
scalacOptions := scalacOptions.value | ||
.filterNot(Seq("-Ywarn-value-discard", "-Wvalue-discard").contains), | ||
|
@@ -507,7 +512,13 @@ lazy val millCodegenPlugin = projectMatrix | |
name := "mill-codegen-plugin", | ||
crossVersion := CrossVersion | ||
.binaryWith(s"mill${millPlatform(Dependencies.Mill.millVersion)}_", ""), | ||
libraryDependencies ++= Seq( | ||
libraryDependencies := codegenDeps.value ++ Seq( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it weird that you'd have to specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding, is that the sbt Which begs the question : why not stay with the It may not be the right approach, but it set out (for me) the logic as clearly as possible... I'm not a confident sbt user, so certainly willing to stand corrected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem, I'll try and find the time to try it locally before making a decision of whether to approve as-is or not. Regardless, thank you very much for the contribution ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I have to say that I think this is a surprisingly risky, potentially high maintenance sort of change. In the interim, it appears that Tobias at mill has done something which might sort this out millside - maybe it would be preferable to see if the below mill PR sorts it out in preference to merging this? As ever, thank you for taking the time to review 🙏 |
||
Dependencies.Mill.main % Provided, | ||
Dependencies.Mill.mainApi % Provided, | ||
Dependencies.Mill.scalalib % Provided, | ||
Dependencies.Mill.mainTestkit | ||
), | ||
Test / libraryDependencies := codegenDeps.value ++ Seq( | ||
Dependencies.Mill.main, | ||
Dependencies.Mill.mainApi, | ||
Dependencies.Mill.scalalib, | ||
|
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'm not sure I understand the rationale behind extracting this. In theory, you shouldn't have to.
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 couldn't figure out the right sbt incantation to reference the dependancies of the module directly, without extracting them into their own setting.
This could simply be weak sbt-foo .