Skip to content

Commit

Permalink
Rename ResourceMapper to NativeResourceMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jchyb committed Jul 19, 2022
1 parent dd0d7f0 commit 20e45bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package scala.build
import scala.collection.Map
import scala.jdk.CollectionConverters._

/* Maps resources from their original path, to destination path,
/* Maps c file resources from their original path to the destination path,
* also caching that mapping.
*
* Remembering the mapping this way allows for the resource to be removed
* if the original file is renamed/deleted.
*/
object ResourceMapper {
object NativeResourceMapper {

private def readMappingIfExists(mappingFile: os.Path): Option[Map[os.Path, os.Path]] =
if (os.exists(mappingFile)) {
Expand Down Expand Up @@ -52,7 +52,7 @@ object ResourceMapper {

val removedFiles = oldMapping.values.toSet -- newMapping.values.toSet
removedFiles.foreach { outputPath =>
// Delete only if in outpath, to not cause any harm
// Delete only if in outpath, to avoid causing any harm
if (isInDirectory(build.output, outputPath))
os.remove(outputPath)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ object Package extends ScalaCommand[PackageOptions] {
)

if (cacheData.changed) {
ResourceMapper.copyCFilesToScalaNativeDir(build, nativeWorkDir)
NativeResourceMapper.copyCFilesToScalaNativeDir(build, nativeWorkDir)
Library.withLibraryJar(build, dest.last.stripSuffix(".jar")) { mainJar =>

val classpath = build.artifacts.classPath.map(_.toString) :+ mainJar.toString
Expand Down

0 comments on commit 20e45bf

Please sign in to comment.