All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mill.scalalib.Dependency.scala Maven / Gradle / Ivy

There is a newer version: 0.12.0-RC2-17-07e173
Show newest version
package mill.scalalib

import mill.T
import mill.define.{Command, Discover, ExternalModule}
import mill.eval.Evaluator
import mill.scalalib.dependency.{DependencyUpdatesImpl, Format}
import mill.scalalib.dependency.updates.ModuleDependenciesUpdates

object Dependency extends ExternalModule {

  /** Calculate possible dependency updates. */
  def updates(
      ev: Evaluator,
      allowPreRelease: Boolean = false
  ): Command[Seq[ModuleDependenciesUpdates]] =
    T.command {
      DependencyUpdatesImpl(
        ev,
        implicitly,
        ev.rootModule,
        ev.rootModule.millDiscover,
        allowPreRelease
      )
    }

  /** Show possible dependency updates. */
  def showUpdates(
      ev: Evaluator,
      allowPreRelease: Boolean = false,
      format: Format = Format.PerModule
  ): Command[Unit] = T.command {
    DependencyUpdatesImpl.showAllUpdates(updates(ev, allowPreRelease)(), format)
  }

  @deprecated("Use other overload instead", "Mill after 0.11.6")
  def showUpdates(ev: Evaluator, allowPreRelease: Boolean): Command[Unit] =
    Dependency.showUpdates(ev, allowPreRelease, Format.PerModule)

  lazy val millDiscover: Discover = Discover[this.type]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy