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

org.scalajs.linker.PathOutputFile.scala Maven / Gradle / Ivy

There is a newer version: 1.17.0
Show newest version
/*
 * Scala.js (https://www.scala-js.org/)
 *
 * Copyright EPFL.
 *
 * Licensed under Apache License 2.0
 * (https://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package org.scalajs.linker

import java.nio.file.Path

import org.scalajs.linker.interface.LinkerOutput
import org.scalajs.linker.interface.unstable.OutputFileImpl

@deprecated("Part of old Linker interface. Use PathOutputDirectory instead.", "1.3.0")
object PathOutputFile {
  def apply(path: Path): LinkerOutput.File = {
    val np = path.toAbsolutePath().normalize()
    val dir = PathOutputDirectory(np.getParent())
    new OutputFileImpl(np.getFileName().toString(), dir)
  }

  def atomic(path: Path): LinkerOutput.File =
    apply(path) // PathOutputDirectory is always atomic.
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy