@@ -110,25 +110,19 @@ final class MillAlg[F[_]](defaultResolver: Resolver)(implicit
110110}
111111
112112object MillAlg {
113- private [mill] def millMinVersion (millVersion : Option [Version ]): Option [String ] =
114- millVersion.flatMap(_.value.trim.split(" [.]" , 3 ).take(2 ).lastOption)
115-
116113 private [mill] val cliPluginCoordinate : String =
117114 s " ivy: ${org.scalasteward.core.BuildInfo .organization}:: ${org.scalasteward.core.BuildInfo .millPluginArtifactName}:: ${org.scalasteward.core.BuildInfo .millPluginVersion}"
118115
119- private [mill] def content (millVersion : Option [Version ]) = {
120- def rawContent (millBinPlatform : String ) =
121- s """ |import $$ ivy.` ${org.scalasteward.core.BuildInfo .organization}:: ${org.scalasteward.core.BuildInfo .millPluginArtifactName}_mill ${millBinPlatform}: ${org.scalasteward.core.BuildInfo .millPluginVersion}`
122- | """ .stripMargin
123-
124- millMinVersion(millVersion) match {
125- case None => rawContent(" $MILL_BIN_PLATFORM" )
126- // We support these platforms, but we can't take the $MILL_BIN_PLATFORM support for granted
127- case Some (" 6" ) => rawContent(" 0.6" )
128- case Some (" 7" ) | Some (" 8" ) => rawContent(" 0.7" )
129- case Some (" 9" ) => rawContent(" 0.9" )
130- case _ => rawContent(" $MILL_BIN_PLATFORM" )
116+ private [mill] def content (millVersion : Option [Version ]): String = {
117+ // We support these platforms, but we can't take the $MILL_BIN_PLATFORM support for granted
118+ val millBinPlatform = millVersion match {
119+ case Some (v) if v >= Version (" 0.10" ) => " $MILL_BIN_PLATFORM"
120+ case Some (v) if v >= Version (" 0.9" ) => " 0.9"
121+ case Some (v) if v >= Version (" 0.7" ) => " 0.7"
122+ case Some (v) if v >= Version (" 0.6" ) => " 0.6"
123+ case _ => " $MILL_BIN_PLATFORM"
131124 }
125+ s """ import $$ ivy.` ${org.scalasteward.core.BuildInfo .organization}:: ${org.scalasteward.core.BuildInfo .millPluginArtifactName}_mill ${millBinPlatform}: ${org.scalasteward.core.BuildInfo .millPluginVersion}` """
132126 }
133127
134128 val extractDeps : String = " org.scalasteward.mill.plugin.StewardPlugin/extractDeps"
0 commit comments