Skip to content

Commit

Permalink
Fix a bug in constructing the path for running
Browse files Browse the repository at this point in the history
Because (+) is overloaded, we were accidentally adding the segments of
the built jar file's path to the claspath, rather than the full path.
  • Loading branch information
cjfuller committed Jan 2, 2022
1 parent 93e1c5c commit a785015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/Run.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Run(val script: Path?, val runArgs: List<String>) : Runnable {

Subprocess.new {
command = "java"
addArgs("-cp", (Config.global.depsJarFiles() + KotlinC.outputJar()).toClasspathString())
addArgs("-cp", (Config.global.depsJarFiles() + listOf(KotlinC.outputJar())).toClasspathString())
arg(mainClass)
addArgs(*runArgs.toTypedArray())
}.getOrThrow().run_check()
Expand Down
2 changes: 1 addition & 1 deletion src/tools/KotlinC.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object KotlinC : ToolZipBundle<KotlinCBundle> {
Subprocess.new {
command = path(KotlinCBundle.KOTLINC).absolutePathString()
addArgs("-script", script.absolutePathString())
addArgs("-cp", (Config.global.depsJarFiles() + outputJar()).toClasspathString())
addArgs("-cp", (Config.global.depsJarFiles() + listOf(outputJar())).toClasspathString())
if (Config.global.useSerializationPlugin) {
arg("-Xplugin=${path(KotlinCBundle.SER_PLUGIN).absolutePathString()}")
}
Expand Down

0 comments on commit a785015

Please sign in to comment.