Port zinc-lm-integration

This commit is contained in:
Eugene Yokota 2022-01-30 13:31:10 -05:00
parent 4ff27d7ab7
commit 1459b8a79d
3 changed files with 10 additions and 7 deletions

View File

@ -184,7 +184,6 @@ lazy val sbtRoot: Project = (project in file("."))
(allProjects diff Seq( (allProjects diff Seq(
actionsProj, actionsProj,
mainSettingsProj, mainSettingsProj,
zincLmIntegrationProj,
scriptedSbtReduxProj, scriptedSbtReduxProj,
scriptedSbtOldProj, scriptedSbtOldProj,
scriptedPluginProj, scriptedPluginProj,

View File

@ -66,8 +66,10 @@ class ZincComponentManager(
lockLocalCache(getOrElse(fromSecondary)) lockLocalCache(getOrElse(fromSecondary))
} }
/** Get the file for component 'id', /**
* throwing an exception if no files or multiple files exist for the component. */ * Get the file for component 'id',
* throwing an exception if no files or multiple files exist for the component.
*/
def file(id: String)(ifMissing: IfMissing): File = { def file(id: String)(ifMissing: IfMissing): File = {
files(id)(ifMissing).toList match { files(id)(ifMissing).toList match {
case x :: Nil => x case x :: Nil => x
@ -79,8 +81,10 @@ class ZincComponentManager(
def define(id: String, files: Iterable[File]): Unit = def define(id: String, files: Iterable[File]): Unit =
lockLocalCache(provider.defineComponent(id, files.toSeq.toArray)) lockLocalCache(provider.defineComponent(id, files.toSeq.toArray))
/** This is used to lock the local cache in project/boot/. /**
* By checking the local cache first, we can avoid grabbing a global lock. */ * This is used to lock the local cache in project/boot/.
* By checking the local cache first, we can avoid grabbing a global lock.
*/
private def lockLocalCache[T](action: => T): T = lock(provider.lockFile)(action) private def lockLocalCache[T](action: => T): T = lock(provider.lockFile)(action)
/** This is used to ensure atomic access to components in the global Ivy cache. */ /** This is used to ensure atomic access to components in the global Ivy cache. */