File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
main/scala/org/scalasteward/core
test/scala/org/scalasteward/core/buildtool/mill Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,12 @@ final class MillAlg[F[_]](implicit
7171 private def getMillVersion (buildRootDir : File ): F [Option [Version ]] =
7272 for {
7373 millVersionFileContent <- fileAlg.readFile(buildRootDir / millVersionName)
74- version = millVersionFileContent.flatMap(parser.parseMillVersion)
74+ millVersionFileInConfigContent <- fileAlg.readFile(
75+ buildRootDir / " .config" / millVersionNameInConfig
76+ )
77+ version = millVersionFileContent
78+ .orElse(millVersionFileInConfigContent)
79+ .flatMap(parser.parseMillVersion)
7580 } yield version
7681
7782 private def getMillPluginDeps (
@@ -119,4 +124,5 @@ object MillAlg {
119124 update.artifactIds.exists(_.name === millMainArtifactId.name)
120125
121126 val millVersionName = " .mill-version"
127+ val millVersionNameInConfig = " mill-version"
122128}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ package org.scalasteward.core.edit.update
1919import cats .Foldable
2020import cats .syntax .all ._
2121import java .util .regex .Pattern
22- import org .scalasteward .core .buildtool .mill .MillAlg .{ isMillMainUpdate , millVersionName }
22+ import org .scalasteward .core .buildtool .mill .MillAlg
2323import org .scalasteward .core .buildtool .sbt .{buildPropertiesName , isSbtUpdate }
2424import org .scalasteward .core .data .{Dependency , Update }
2525import org .scalasteward .core .edit .update .data .VersionPosition ._
@@ -169,8 +169,11 @@ object Selector {
169169 update : Update .Single ,
170170 versionPositions : List [VersionPosition ]
171171 ): List [VersionPosition ] =
172- if (isMillMainUpdate(update))
173- versionPositions.filter(_.version.path.endsWith(millVersionName))
172+ if (MillAlg .isMillMainUpdate(update))
173+ versionPositions.filter(f =>
174+ f.version.path.endsWith(MillAlg .millVersionNameInConfig) ||
175+ f.version.path.endsWith(MillAlg .millVersionName)
176+ )
174177 else List .empty
175178
176179 private def sbtVersionPositions (
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import io.circe.generic.extras.semiauto._
2424import io .circe .refined ._
2525import io .circe .{Codec , Decoder }
2626import org .scalasteward .core .buildtool .maven .pomXmlName
27- import org .scalasteward .core .buildtool .mill .MillAlg . millVersionName
27+ import org .scalasteward .core .buildtool .mill .MillAlg
2828import org .scalasteward .core .buildtool .sbt .buildPropertiesName
2929import org .scalasteward .core .data .{GroupId , Update }
3030import org .scalasteward .core .scalafmt .scalafmtConfName
@@ -90,7 +90,8 @@ final case class UpdatesConfig(
9090object UpdatesConfig {
9191 private val defaultFileExtensions : Set [String ] =
9292 Set (
93- millVersionName,
93+ MillAlg .millVersionName,
94+ MillAlg .millVersionNameInConfig,
9495 " .sbt" ,
9596 " .sbt.shared" ,
9697 " .sc" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class MillAlgTest extends FunSuite {
3434 val expected = initial.copy(
3535 trace = Vector (
3636 Cmd (" read" , s " $repoDir/.mill-version " ),
37+ Cmd (" read" , s " $repoDir/.config/mill-version " ),
3738 Cmd (" write" , predef),
3839 Cmd (repoDir.toString :: millCmd),
3940 Cmd (" rm" , " -rf" , predef)
You can’t perform that action at this time.
0 commit comments