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
71
71
private def getMillVersion (buildRootDir : File ): F [Option [Version ]] =
72
72
for {
73
73
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)
75
80
} yield version
76
81
77
82
private def getMillPluginDeps (
@@ -119,4 +124,5 @@ object MillAlg {
119
124
update.artifactIds.exists(_.name === millMainArtifactId.name)
120
125
121
126
val millVersionName = " .mill-version"
127
+ val millVersionNameInConfig = " mill-version"
122
128
}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ package org.scalasteward.core.edit.update
19
19
import cats .Foldable
20
20
import cats .syntax .all ._
21
21
import java .util .regex .Pattern
22
- import org .scalasteward .core .buildtool .mill .MillAlg .{ isMillMainUpdate , millVersionName }
22
+ import org .scalasteward .core .buildtool .mill .MillAlg
23
23
import org .scalasteward .core .buildtool .sbt .{buildPropertiesName , isSbtUpdate }
24
24
import org .scalasteward .core .data .{Dependency , Update }
25
25
import org .scalasteward .core .edit .update .data .VersionPosition ._
@@ -169,8 +169,11 @@ object Selector {
169
169
update : Update .Single ,
170
170
versionPositions : List [VersionPosition ]
171
171
): 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
+ )
174
177
else List .empty
175
178
176
179
private def sbtVersionPositions (
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import io.circe.generic.extras.semiauto._
24
24
import io .circe .refined ._
25
25
import io .circe .{Codec , Decoder }
26
26
import org .scalasteward .core .buildtool .maven .pomXmlName
27
- import org .scalasteward .core .buildtool .mill .MillAlg . millVersionName
27
+ import org .scalasteward .core .buildtool .mill .MillAlg
28
28
import org .scalasteward .core .buildtool .sbt .buildPropertiesName
29
29
import org .scalasteward .core .data .{GroupId , Update }
30
30
import org .scalasteward .core .scalafmt .scalafmtConfName
@@ -90,7 +90,8 @@ final case class UpdatesConfig(
90
90
object UpdatesConfig {
91
91
private val defaultFileExtensions : Set [String ] =
92
92
Set (
93
- millVersionName,
93
+ MillAlg .millVersionName,
94
+ MillAlg .millVersionNameInConfig,
94
95
" .sbt" ,
95
96
" .sbt.shared" ,
96
97
" .sc" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class MillAlgTest extends FunSuite {
34
34
val expected = initial.copy(
35
35
trace = Vector (
36
36
Cmd (" read" , s " $repoDir/.mill-version " ),
37
+ Cmd (" read" , s " $repoDir/.config/mill-version " ),
37
38
Cmd (" write" , predef),
38
39
Cmd (repoDir.toString :: millCmd),
39
40
Cmd (" rm" , " -rf" , predef)
You can’t perform that action at this time.
0 commit comments