@@ -244,7 +244,7 @@ sourceSets.main.java.srcDirs 'src'
244244 // also symlink all includes
245245 includeURLs.distinctBy { it.fileName() }
246246 .forEach {
247-
247+
248248 val includeFile = when {
249249 it.protocol == " file" -> File (it.toURI())
250250 else -> fetchFromURL(it.toString())
@@ -254,7 +254,7 @@ sourceSets.main.java.srcDirs 'src'
254254 }
255255 }
256256
257- return " idea ${tmpProjectDir.absolutePath} "
257+ return " idea \" ${tmpProjectDir.absolutePath} \" "
258258}
259259
260260private fun URL.fileName () = this .toURI().path.split(" /" ).last()
@@ -313,7 +313,7 @@ $stringifiedDeps
313313 compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-runtime', version: '${KotlinVersion .CURRENT } '
314314
315315 // https://stackoverflow.com/questions/20700053/how-to-add-local-jar-file-dependency-to-build-gradle-file
316- compile files('${scriptJar} ')
316+ compile files('${scriptJar.invariantSeparatorsPath } ')
317317}
318318
319319// http://www.capsule.io/user-guide/#really-executable-capsules
@@ -360,11 +360,14 @@ exec java -jar ${'$'}0 "${'$'}@"
360360
361361 File (tmpProjectDir, " build.gradle" ).writeText(gradleScript)
362362
363- val pckgResult = evalBash(" cd ${tmpProjectDir} && gradle simpleCapsule && cp build/libs/ ${appName} *.jar ${pckgedJar} && chmod +x ${pckgedJar} " )
363+ val pckgResult = evalBash(" cd ' ${tmpProjectDir} ' && gradle simpleCapsule" )
364364
365365 with (pckgResult) {
366366 kscript.app.errorIf(exitCode != 0 ) { " packaging of '$appName ' failed:\n $pckgResult " }
367367 }
368368
369+ pckgedJar.delete()
370+ File (tmpProjectDir, " build/libs/${appName} -capsule.jar" ).copyTo(pckgedJar, true )
371+
369372 infoMsg(" Finished packaging into ${pckgedJar} " )
370373}
0 commit comments