Skip to content

Commit

Permalink
Make package command handle directories in extra classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 committed Aug 14, 2024
1 parent 915e7cb commit a45ce34
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,11 @@ object Package extends ScalaCommand[PackageOptions] with BuildCommandHelpers {
ClassPathEntry.Url(url)
}
val byteCodeEntry = ClassPathEntry.Resource(s"${destPath.last}-content.jar", 0L, tmpJarContent)
val extraClassPath = build.options.classPathOptions.extraClassPath.map { classPath =>
ClassPathEntry.Resource(classPath.last, os.mtime(classPath), os.read.bytes(classPath))
}
val extraClassPath = build.options.classPathOptions.extraClassPath
.flatMap(path => if os.isDir(path) then os.walk(path) else Seq(path))
.map { classPath =>
ClassPathEntry.Resource(classPath.last, os.mtime(classPath), os.read.bytes(classPath))
}

val allEntries = Seq(byteCodeEntry) ++ dependencyEntries ++ extraClassPath
val loaderContent = coursier.launcher.ClassLoaderContent(allEntries)
Expand Down

0 comments on commit a45ce34

Please sign in to comment.