Skip to content

Commit fd8544a

Browse files
Marcel Schnellehotchemi
Marcel Schnelle
authored andcommitted
Trim extracted JAR file names to avoid invalid paths on Windows (#9)
1 parent 13eaa4d commit fd8544a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/kompile/testing/Compiler.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ class Compiler(private val rootDir: File) {
137137

138138
private fun extractJarFromAar(url: URL): File {
139139
val zipFile = ZipFile(url.path)
140-
val newFileName = url.path.replace(".aar", ".jar")
140+
val newFileName = url.path
141+
.substringAfterLast(File.separatorChar)
142+
.replace(".aar", ".jar")
141143
val jar = File(File(rootDir, "unzippedAar"), newFileName)
142144
val sourceInputStream = zipFile.getInputStream(zipFile.getEntry("classes.jar"))
143145
FileUtils.copyInputStreamToFile(sourceInputStream, jar)

0 commit comments

Comments
 (0)