Skip to content

Commit

Permalink
Re-invert dependency between scriptSources and parseBuildFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Aug 18, 2023
1 parent be3c882 commit 9bcf7b5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions runner/src/mill/runner/MillBuildRootModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ class MillBuildRootModule()(implicit
* All script files (that will get wrapped later)
* @see [[generateScriptSources]]
*/
def scriptSources = T {
parseBuildFiles().seenScripts.keys.map(PathRef(_)).toSeq
def scriptSources = T.sources {
MillBuildRootModule.parseBuildFiles(millBuildRootModuleInfo)
.seenScripts
.keys.map(PathRef(_))
.toSeq
}

def parseBuildFiles: T[FileImportGraph] = T.input {
def parseBuildFiles: T[FileImportGraph] = T {
scriptSources()
MillBuildRootModule.parseBuildFiles(millBuildRootModuleInfo)
}

Expand Down Expand Up @@ -208,9 +212,7 @@ class MillBuildRootModule()(implicit
result
}

// `T.sources` is redundant, but we keep it to explicit see files in the watch list.
// [[parseBuildFiles]] is already an input target, so these files are effectively watched twice though.
override def sources: T[Seq[PathRef]] = T.sources {
override def sources: T[Seq[PathRef]] = T {
scriptSources() ++ {
if (parseBuildFiles().millImport) super.sources()
else Seq.empty[PathRef]
Expand Down

0 comments on commit 9bcf7b5

Please sign in to comment.