sbt.internal.inc.DummyVirtualFile.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zinc-core_2.13 Show documentation
Show all versions of zinc-core_2.13 Show documentation
Incremental compiler of Scala
The newest version!
/*
* Zinc - The incremental compiler for Scala.
* Copyright Scala Center, Lightbend, and Mark Harrah
*
* Licensed under Apache License 2.0
* SPDX-License-Identifier: Apache-2.0
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package sbt
package internal
package inc
import java.io.InputStream
import java.nio.file.{ Files, Path }
import xsbti.{ BasicVirtualFileRef, VirtualFile }
/**
* This is a dummy VirtualFile that's a simple wrapper around Path.
*/
class DummyVirtualFile(encodedPath: String, path: Path)
extends BasicVirtualFileRef(encodedPath)
with VirtualFile {
override def contentHash: Long = HashUtil.farmHash(path)
override def input(): InputStream = Files.newInputStream(path)
}
object DummyVirtualFile {
def apply(encodedPath: String, path: Path): DummyVirtualFile =
new DummyVirtualFile(encodedPath, path)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy