Package-level declarations

Types

Link copied to clipboard

Key constants reused across multiple foundry projects.

Link copied to clipboard
interface FoundryLogger

A simple logging abstraction for use in Foundry.

Functions

Link copied to clipboard
fun <T> Collection<T>.filterToSet(predicate: (T) -> Boolean): Set<T>
Link copied to clipboard
fun <T, R> Collection<T>.flatMapToSet(transform: (T) -> Iterable<R>): Set<R>
Link copied to clipboard

Flips a map. In the context of ComputeAffectedProjectsTask, we use this to flip a map of projects to their dependencies to a map of projects to the projects that depend on them. We use this to find all affected projects given a seed of changed projects.

Link copied to clipboard
fun <T, R> Collection<T>.mapToSet(transform: (T) -> R): Set<R>
Link copied to clipboard
inline suspend fun <A> Iterable<A>.parallelForEach(parallelism: Int, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline action: suspend (A) -> Unit)

Iterates this Iterable with a given parallelism, passing the value for each emission to the given action.

Link copied to clipboard
inline suspend fun <A, B> Iterable<A>.parallelMap(parallelism: Int, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline mapper: suspend (A) -> B): List<B>

Applies a given mapper function in parallel over this Iterable with a given parallelism.

Link copied to clipboard
inline suspend fun <A, B> Iterable<A>.parallelMapNotNull(parallelism: Int, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline mapper: suspend (A) -> B?): List<B>

Applies a given mapper function in parallel over this Iterable with a given parallelism, filtering out null Bs.

Link copied to clipboard
fun Path.prepareForGradleOutput(fs: FileSystem): Path
Link copied to clipboard
fun Path.readLines(fs: FileSystem): List<String>
Link copied to clipboard
fun Path.writeLines(lines: Iterable<String>, fs: FileSystem)
Link copied to clipboard
fun Path.writeText(text: String, fs: FileSystem)