ModuleArchive

inner class ModuleArchive

All information associated with a particular module name in this module, across all known versions.

Constructors

Link copied to clipboard
fun ModuleArchive(rootRelativeName: String)

Construct a new ModuleArchive.

Functions

Link copied to clipboard
fun cleanCompilations()

Delete all compiled versions of this module. Don't remove the cached file digests. Note that the compiled versions are still in the repository, they're just not reachable from the root metadata any longer.

Link copied to clipboard
fun digestForFile(    resolvedModuleName: ResolvedModuleName,     forceRefreshDigest: Boolean,     withDigest: (ByteArray) -> Unit,     failureHandler: (ErrorCode, Throwable?) -> Unit)

Determine the cryptographic hash of the file's current contents. Since we assume that the same filename and modification time implies the same digest, we cache the digest under that combination for performance.

Link copied to clipboard
fun getVersion(versionKey: Repository.ModuleVersionKey): Repository.ModuleVersion?

If this ModuleVersion exists in the repository, then answer it; otherwise answer null.

Link copied to clipboard
fun putCompilation(    versionKey: Repository.ModuleVersionKey,     compilationKey: Repository.ModuleCompilationKey,     compilation: Repository.ModuleCompilation)

Record a new compilation of a module version. The version must already exist in the repository. The compilation key must not yet have a compilation associated with it.

Link copied to clipboard
fun putVersion(versionKey: Repository.ModuleVersionKey, version: Repository.ModuleVersion)

Record a version of a module. This includes information about the source's digest and the list of local imports.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun write(binaryStream: DataOutputStream)

Output this ModuleArchive to the provided DataOutputStream. It can later be reconstituted via the constructor taking a DataInputStream.

Properties

Link copied to clipboard

Answer an immutable Map from ModuleVersionKey to ModuleVersion, containing entries for every version still tracked by this ModuleArchive.

Link copied to clipboard
val repository: Repository

Expose the enclosing Repository as a property.