From 58c6479f9d26a7ca80f33e5d57ce489ce8c899f8 Mon Sep 17 00:00:00 2001 From: sinofp Date: Sat, 5 Jun 2021 00:39:15 +0800 Subject: Add deprecation annotation in FileUtils --- src/main/scala/firrtl/FileUtils.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/FileUtils.scala b/src/main/scala/firrtl/FileUtils.scala index 3668b374..5f825a38 100644 --- a/src/main/scala/firrtl/FileUtils.scala +++ b/src/main/scala/firrtl/FileUtils.scala @@ -46,9 +46,10 @@ object FileUtils { /** * recursively delete all directories in a relative path * DO NOT DELETE absolute paths - * @todo deprecate java.io.File + * * @param file: a directory hierarchy to delete */ + @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5") def deleteDirectoryHierarchy(file: java.io.File, atTop: Boolean = true): Boolean = { if ( file.getPath.split("/").last.isEmpty || @@ -118,9 +119,10 @@ object FileUtils { /** Read a text file and return it as a Seq of strings * Closes the file after read to avoid dangling file handles - * @todo deprecate java.io.File + * * @param file a java File to be read */ + @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5") def getLines(file: java.io.File): Seq[String] = { val source = scala.io.Source.fromFile(file) val lines = source.getLines().toList @@ -144,9 +146,10 @@ object FileUtils { /** Read a text file and return it as a single string * Closes the file after read to avoid dangling file handles - * @todo deprecate java.io.File + * * @param file a java File to be read */ + @deprecated("Use os-lib instead, this function will be removed in FIRRTL 1.6", "FIRRTL 1.5") def getText(file: java.io.File): String = { val source = scala.io.Source.fromFile(file) val text = source.mkString -- cgit v1.2.3