Skip to content

Commit 8291409

Browse files
Add public helper
1 parent 9d74889 commit 8291409

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main/scala/SbtModulePatcher.scala

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ object SbtModulePatcher extends AutoPlugin {
3232
val classpath = dependencyClasspath.value
3333
val jarFiles =
3434
classpath.map(_.data).filter(_.getName.endsWith(".jar"))
35-
36-
jarFiles.foreach { jarFile =>
37-
if (!isModule(jarFile, log)) {
38-
modifyJar(jarFile, log)
39-
updateChecksums(jarFile, log)
40-
}
41-
}
35+
patchJars(jarFiles)
4236
},
4337
compile := (compile dependsOn patchDependencies).value
4438
)
@@ -53,6 +47,15 @@ object SbtModulePatcher extends AutoPlugin {
5347
}
5448
)
5549

50+
def patchJars(jarFiles: Seq[File]): Unit = {
51+
jarFiles.foreach { jarFile =>
52+
if (!isModule(jarFile, log)) {
53+
modifyJar(jarFile, log)
54+
updateChecksums(jarFile, log)
55+
}
56+
}
57+
}
58+
5659
private def isModule(jarFile: File, log: Logger): Boolean = {
5760
// Support both Scala 2.12 and 2.13
5861
if (!jarFile.getName.contains("_2.12") && !jarFile.getName.contains("_2.13")) {

0 commit comments

Comments
 (0)