All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sbt.internal.inc.Compilation.scala Maven / Gradle / Ivy

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.internal.inc

import xsbti.compile.Output

import scala.runtime.ScalaRunTime

/**
 * Note that this implementation of the interface is part of the public Zinc Scala API.
 */
final class Compilation(startTime: Long, output: Output)
    extends xsbti.compile.analysis.Compilation {
  override def getOutput: Output = output
  override def getStartTime: Long = startTime
  private val product = (startTime, output)
  override def hashCode(): Int = ScalaRunTime._hashCode(product)
  override def equals(o: scala.Any): Boolean = o match {
    case c2: Compilation => startTime == c2.getStartTime && output == c2.getOutput
    case _               => false
  }
  override def toString: String = s"Compilation($startTime, $output)"
}

object Compilation {

  /** Instantiate a [[Compilation]] from a given output. */
  def apply(compileStartTime: Long, output: Output): Compilation =
    new Compilation(compileStartTime, output)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy