mill.util

package mill.util

Non-language-specific utility APIs provided by Mill for use in your build.mill and package.mill, in addition to the core APIs provided in the mill.api package

Attributes

Members list

Type members

Classlikes

object BuildInfo

Attributes

Source
BuildInfo.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BuildInfo.type
abstract class CachedFactory[K, V] extends AutoCloseable

Manage the setup, teardown, and caching of objects of type V safely in a multithreaded environment.

Manage the setup, teardown, and caching of objects of type V safely in a multithreaded environment.

The user provides the setup and teardown logic along with a maxCacheSize, and CachedFactory provides instances of V as requested using the withValue method. These instances are automatically constructed on-demand from the give key, cached with an LRU strategy, and destroyed when they are eventually evicted

Intended for relatively small caches approximately O(num-threads) in size that will typically get used in a build system, not intended for caching large amounts of entries

Attributes

Source
CachedFactory.scala
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
abstract class ClassLoaderCachedFactory[T](jobs: Int)(implicit e: Enclosing) extends CachedFactory[Seq[PathRef], T]

Combination of CachedFactory and RefCountedClassLoaderCache, providing an easy way to generate values of type T to each be used in a single-thread while re-using the underling URLClassLoaders where possible.

Combination of CachedFactory and RefCountedClassLoaderCache, providing an easy way to generate values of type T to each be used in a single-thread while re-using the underling URLClassLoaders where possible.

Attributes

Source
ClassLoaderCachedFactory.scala
Supertypes
class CachedFactory[Seq[PathRef], T]
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
FileSetContents.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class IgnoreQualifierVersion(val underlying: Version) extends AnyVal

Attributes

Source
Version.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class JarManifest

Represents a JAR manifest.

Represents a JAR manifest.

Value parameters

groups

additional attributes for named entries

main

the main manifest attributes

Attributes

Companion
object
Source
JarManifest.scala
Supertypes
class Object
trait Matchable
class Any
object JarManifest

Attributes

Companion
class
Source
JarManifest.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Jvm

Utilities related to the JVM platform: JVM processes, classloaders, java executables, launcher scripts, etc.

Utilities related to the JVM platform: JVM processes, classloaders, java executables, launcher scripts, etc.

Attributes

Source
Jvm.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Jvm.type

mill.api.Module containing all the default tasks that Mill provides: resolve, show, inspect, plan, etc.

mill.api.Module containing all the default tasks that Mill provides: resolve, show, inspect, plan, etc.

Attributes

Companion
object
Source
MainModule.scala
Supertypes
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes
object MainModule

Attributes

Companion
trait
Source
MainModule.scala
Supertypes
class Object
trait Matchable
class Any
Self type
MainModule.type
abstract class MainRootModule()(implicit baseModuleInfo: Info, millModuleEnclosing0: Enclosing, millModuleLine0: Line, millFile0: File) extends RootModule, MainModule

Attributes

Source
MainModule.scala
Supertypes
trait MainModule
class RootModule
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
final class MavenVersion(val underlying: Version) extends AnyVal

Attributes

Source
Version.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class OsgiVersion(val underlying: Version) extends AnyVal

Attributes

Source
Version.scala
Supertypes
class AnyVal
trait Matchable
class Any
class RefCountedClassLoaderCache(sharedLoader: ClassLoader, sharedPrefixes: Seq[String], parent: ClassLoader)

Caches classloaders that can be shared between different workers, keeping a reference count of each classloader and only closing it after no more references exist

Caches classloaders that can be shared between different workers, keeping a reference count of each classloader and only closing it after no more references exist

Attributes

Source
RefCountedClassLoaderCache.scala
Supertypes
class Object
trait Matchable
class Any
case class Retry(count: Int, backoffMillis: Long, backoffMultiplier: Double, timeoutMillis: Long, filter: (Int, Throwable) => Boolean, logger: String => Unit)

Generic retry functionality

Generic retry functionality

Value parameters

backoffMillis

What is the initial backoff time

backoffMultiplier

How much to multiply the initial backoff each time

count

How many times to retry before giving up

filter

Whether or not we want to retry a given exception at a given retryCount; defaults to true to retry all exceptions, but can be made more fine-grained to only retry specific exceptions, or log them together with the retryCount

logger

Method to log messages upon failure

t

The code block that we want to retry

timeoutMillis

How much time we want to allow t to run. If passed, runs t in a separate thread and throws a TimeoutException if it takes too long

Attributes

Returns

the value of evaluating t, or throws an exception if evaluating t fails more than count times

Companion
object
Source
Retry.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Retry

Attributes

Companion
class
Source
Retry.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Retry.type
class Secret[+A](val value: A)

A value that makes sure it doesn't print anything on toString.

A value that makes sure it doesn't print anything on toString.

Attributes

Note

this is not a case class to prevent it being accidentally printed with pprint.

Companion
object
Source
Secret.scala
Supertypes
class Object
trait Matchable
class Any
object Secret

Attributes

Companion
class
Source
Secret.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Secret.type

Mill Module to support selective test execution in large projects.

Mill Module to support selective test execution in large projects.

Read more about it at: https://mill-build.org/mill/large/selective-execution.html

Attributes

Source
SelectiveExecutionModule.scala
Supertypes
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
case class Tasks[T](value: Seq[Named[T]])

Used in the signature of Task.Commands to allow them to take one or more tasks selectors as command line parameters, and automatically resolves them to mill.api.Task.Named instances for you to make use of in the body of the command.

Used in the signature of Task.Commands to allow them to take one or more tasks selectors as command line parameters, and automatically resolves them to mill.api.Task.Named instances for you to make use of in the body of the command.

Attributes

Companion
object
Source
Tasks.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Tasks

Attributes

Companion
class
Source
Tasks.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Tasks.type
object TokenReaders extends TokenReaders

Contains the additional instances of mainargs.TokensReader necessary to support Task.Command entrypoints

Contains the additional instances of mainargs.TokensReader necessary to support Task.Command entrypoints

Attributes

Companion
trait
Source
TokenReaders.scala
Supertypes
trait TokenReaders
class Object
trait Matchable
class Any
Self type
trait TokenReaders

Attributes

Companion
object
Source
TokenReaders.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TokenReaders

Utilities to derive a useful version string from the Git commit history, including the latest tag, the commit SHA for non-tagged commits, number of commits since latest tag, and a DIRTY suffix for workspaces with un-committed changes. Used via VcsVersion.Module.vcsState.format()

Utilities to derive a useful version string from the Git commit history, including the latest tag, the commit SHA for non-tagged commits, number of commits since latest tag, and a DIRTY suffix for workspaces with un-committed changes. Used via VcsVersion.Module.vcsState.format()

Originally distributed under the Apache License, Version 2.0 as https://github.com/lefou/mill-vcs-version

Attributes

Companion
trait
Source
VcsVersion.scala
Supertypes
trait VcsVersion
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Self type
VcsVersion.type
trait VcsVersion extends Module

Attributes

Companion
object
Source
VcsVersion.scala
Supertypes
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes
object VcsVersion
class Version

Attributes

Companion
object
Source
Version.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Version

Attributes

Companion
class
Source
Version.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Version.type

Attributes

Source
VisualizeModule.scala
Supertypes
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Self type

Types

type PossiblySecret[+A] = A | Secret[A]

Attributes

Source
Secret.scala